Arduino + Maxbotix Sonar (EZ0/1 etc)

Hi all,

I've just purchased a couple of Maxbotix's Sonar products (EZ1 x2 and EZ3 x1). I'm planning a fun project messing about with my radio controlled-car (we're trying to make it semi-autonomous). My idea is to place two of the sensors on the front of the car (one on the front-left, one on the front-right) and another on the rear.

The goal is to react to obstacles in the way of the car and act accordingly.

So far, in testing on the bench, I've found that the sensors are quite 'noisy' - i.e. pointing a sensor at a wall while keeping it in a fixed location may yield slightly different results per scan, but I suspect that could be 'dampened' by taking multiple readings and averaging.

My main query here is in my planned implementation. Due to the fact I'll be using three sensors on the same frequency, I'm guessing the best way to go is to power up each sensor individually, get a reading, power it down, then cycle to the next sensor, and so on.

Does this sound viable? To control power to the sensors, I was just planning to use 3 digital pins to connect to +5V on the sonar boards and then set them to high/low accordingly.

Wondering if anyone else has done this before and if they can offer any insight/experience?


I think what you are suggesting will work but I suggest some 100 ohm series resistors on the pins. I don't think you'll even need 3 pins -- 1 pin will probably be enough. The EZ1 sensor, for example, says it needs 3mA at 5V. One digital pin can easily provide that. But it might need a current "spike" when you first turn it on to charge the capacitors on the EZ1, and that could damage the I/O pins or lower their reliability (i.e., they work for 3 months then magically stop).

Only drawing 3mA, a 100 ohm resistor will drop 5V down to 4.7V which should work just fine for the EZ1.

Hi, thanks for such a detailed post.

I will certainly include the resistors as you have suggested. The reason for using three digital pins was to be able to independently switch each sensor on or off btw.


Oh, sorry, I thought you meant 3 pins per sensor (9 pins total) in order to parallel the pins for greater current.

A quick scan of the EZx datasheets suggests to me that powering them up and down is not the best idea -

Each time after the LV-MaxSonar®-EZ1? is powered up, it will calibrate during its first read cycle. The sensor uses this stored information to range a close object. It is important that objects not be close to the sensor during this calibration cycle. The best sensitivity is obtained when it is clear for fourteen inches, but good results are common when clear for at least seven inches.


Best (IMHO) to power-up just once, then use RX to enable or disable transmission.

*Disclaimer - I have never used this sensor, just read the datasheet.

Oh yes, this is a much better idea. Good call.

Fantastic, thanks again for your input everyone. I had wondered about using the RX pin instead of simply powering up/down, but hadn't spotted that section in the datasheet regarding calibration. I'll solder the RX pins on now and see how that works out. Cheers!