Maxbotix Controller Available


Howdy All,

I've just released the project contents of my Maxbotix EZ1 sensor controller board. The maxbotix EZ1 is an ultrasonic sensor that measure distance to any object and reports it. It's inexpensive and pretty small. However, it puts out a steady stream of messages which can present a load on a computer or controller to keep up.

My controller acts as a front end and provides the following:

* Can be told to send an update only when there is change (and you can control how much of a change before an update is sent).
* Can be told to monitor an area within the measuring range and inform when something moves into out of range
* Can manage up to 12 sensors, allowing 12 sensors to use only a single serial port
* Because only one sensor is turned on at a time, multiple sensors can be in close proximity to each other without interference (if you run them all the same time and they are close by, they can intefere and through off measurements).
* Because the interface is RS232, it allows you to put the sensors at considerable distance from the computer/controller (the sensors use a faux RS232 level that can get weak over longer runs).

The controller is pretty easy to build -- you need two chips and 6 capacitors for a single sensor controller. For a 2 or more controller, add a diode per sensor and a single resistor (just one, no matter how many sensors). You can prototype the thing in about 15 minutes on a bread board and wirewrap one in about 30 minutes.

The serial control protocol is a simple text protocol that is well documented and easy to use. It has features that should make integrating it into HA controllers fairly easy as well as having lots of details available for integrating with computers. Finally, it include an xPL gateway that allows measurments to be broadcast on the local LAN and allows control over the sensors via that same LAN (it's optional, of course).

Also, while not yet available, I do have a PC Board in manufacturing. It allows 1 to 4 sensors on the board (I had to pick a good median number). When they arrive, I'll be making a kit available that will include the board, a pre-programmed PIC and all needed connectors and other parts. Probably about 2 weeks out. However, everything you need -- schematics, PC Board layouts, documentation, firmware, etc are downloadable so you can create your own PC Boards if you'd like.

You can read more about it at

Gerry: I've looked at your schematic for the 12 sensor version. I don't understand how the serial interface allows them to be hooked up this way. I thought RS232 was idle high. When one sensor tried to pull the line low won't the diode prevent this ?

I know I'm missing something so want to learn.



First, just to be clear, the 2, 4, 12 and any version with >1 sensor basically uses the same schematic, with an obvious addition of one diode per sensor. For a single sensor setup, you can drop the diode and resistor since the sensor can wired directly to Pin 6/RB0.

When a sensor in inactive (because the RX pin is held low), the TX pin from the sensor goes low. So if you have a 12 sensor config, at any given moment, 11 sensors have a "low" on RX and subsequently have a low on the TX pin and one sensor has a high on RX and as a result TX is pulsing.

The diodes block low and pass high (electrical low and high -- +5 and 0, not logical low/high). The pull down resistor fills in the blocked lows (when nothing is getting through the diode) so the input doesn't float when a low signal is present. When data comes through on the active sensor, the "high" comes through, the low is blocked (like others) and the pulldown fills in the missing lows.

The output of the sensors is indeed inverted as all RS232 stuff is, though the levels are shifted from +15/-15 to +5 and 0. I use a software UART on RB0 (pin 6) and invert the data as it's being received so it's back to normal.

Hope that helps -- let me know if I skipped anything.

Thanks Gerry, that was peice I was missing that when not selected (RX low) the TX line is low. Now it makes sense.


For those interested, I just received a batch of PC boards. These boards are designed to allow controlling from 1 to 4 sensors (if you need more, you can build the controller on perf-board and support up to 12 sensors).

As with my other projects, I'm making the boards available either as a bare board (board and pre-programmed PIC), kit (all parts) and assembled. Of course, you absolutely do not have to buy anything as everything (firmware, documentation, schematics even board CAD files for creating your own boards) is available for download. The "store" is just for folks who do not want to create their own PCBs or don't have the facilities to bur the PIC chip.

You can read about the project at the site and see pics of the board by clicking the Store link and scrolling down to the Maxbotix controller items.

I'm in for a kit (unassembled). I may need a little help with the software interface to the serial port, but luckily we have a host of people here that should be able to assist with this! :)
Rupp said:
Is this not the same device that you built for your salt monitoring project?
Yes Rupp, that project sort of spurred this project. :)

I found out that the Maxbotix sensor constantly pushed data unless a transmit input was held low.

Gerry's project will provide a hardware interface between the sensors and the pc so his pic can do the polling/comparison work and only send pertinent data to the PC's serial port (as you desire). It can also interface multiple sensors to one PC serial port.

I'm going to look into using it for motion sensing applications (PIR sensors don't work outside for me here in my location).
Plus, you can hook one of these up to a HA controller which supports serial input, such as the Stargate or Elk M1.