Ultrasonic Range Finders

Hello again,

I am using six Maxbotix LV-EZ1 Ultrasonic Range Finders hooked up in parallel to my Arduino's +5V pin. They are hooked up to a "harness" I made for them, in which secures them in all in a hexagonal shape facing outwards.

So here is my problem: I am unable to get any consistences out of this system. Letting it run in an enviornment where there is no movement, I get some pretty erratic results from the sensors.

The code I have been using to is below. It works to both debug in the Arduino window, but also matches up with the Processing program I have been using to visually look at the system. The part of the processing code that performs the "handshake" with the Arduino is also below.

Any comments would be appreciated. Not sure where to go from here.

Arduino Code:

void setup()

void loop()



Processing Code:

void serialEvent (Serial myPort) {
  // get the ASCII string:
  String inString = myPort.readStringUntil('\n');

  if (inString != null) {
    // trim off any whitespace:
    inString = trim(inString);
    // split the string on the commas and convert the 
    // resulting substrings into an integer array:
    float[] colors = float(split(inString, ","));
    // if the array has at least three elements, you know
    // you got the whole thing.  Put the numbers in the
    // color variables:
    if (colors.length >=6) {
      // map them to the range 0-255:
      I = round(map(colors[0], 0, 200, 0, (width/2-5)));

      J = round(map(colors[1], 0, 200, 0, width/2-5));

      K = round(map(colors[2], 0, 200, 0, width/2-5));

      L = round(map(colors[3], 0, 200, 0, width/2-5));

      M = round(map(colors[4], 0, 200, 0, width/2-5));

      Z = round(map(colors[5], 0, 200, 0, width/2-5));

How are you firing the rangfinders?
All at once, or in a ripple?
Could they be picking up echoes from others?

See the answer to this question.