Go Down

Topic: MaxSonar Noise Problem? (SOLVED) (Read 1 time) previous topic - next topic


Feb 01, 2013, 06:34 am Last Edit: Feb 08, 2013, 07:10 pm by Mark Olbert Reason: 1
I'm trying to diagnose a problem with a MaxSonar sensor. I'm using pulse width detection, but in a free-running state (i.e., I don't toggle the RX line high/wait 25 microseconds/low/wait 25 microseconds each time I take a reading). That's because I don't have enough free pins on my Arduino to control the RX line.

When I run my project off of a laboratory/bench power supply everything works exactly as I expect. Objects are detected when they come within a defined horizon, and lost when they move beyond it.

When I run the project off a wall wart, an object will be detected successfully, but once it is, it's never seen to leave (i.e., the sonar sensor is reporting that something's within the horizon even when nothing is). If I cycle the RX line low/high manually (i.e., by pinning it to ground and then to +5V), and leave it pinned high, the lack of an object within the horizon gets detected. But once I try to repeat the object seen/object departed cycle, the sensor once again can't detect the departure.

This sounded like noise on the line. But putting a 0.1 uF capacitor across the MaxSonar board's power supply pins didn't solve the problem. Neither did putting a 1000 uF capacitor across the output from the wall wart.

Normally I'd conclude you have to cycle the MaxSonar's RX pin to use the sensor. But that doesn't square with everything working fine off of the laboratory power supply. Then again, neither does the persistence of the problem after putting a big capacitor across the wall wart output.

I'd be interested in thoughts or suggestions as to what might the problem, or what I might try to work around it.


Can you post your code and schematic? That would be a huge help for diagnostics.


This wiring diagram is from Maxbotix to help suppress noise.


Thanks, I came across that power filter spec after I posted the question. However, it didn't help.

I was able to reduce the noise problem by using a shielded cable to connect the MaxSonar to the project. But there are still oddities.

MaxBotix Inc

Hello! This is Tom Bonar from MaxBotix Inc.

Mark I saw your forum post and I would like to help you with your application.  Can you please email me at thomas@maxbotix.com with your wiring diagram, and any questions you have regarding our sensor?

Please let me know if you have any questions.

Best regards,

Tom Bonar
Technical Support
of MaxBotix Inc.
Phone: (218) 454-0766
Fax: (218) 454-0768
Email: thomas@maxbotix.com

Web: www.maxbotix.com

Follow us on Facebook at: http://www.facebook.com/pages/MaxBotix-Inc/125159384204938

Technical support and sales are subject to
the terms and conditions listed on our
website at http://www.maxbotix.com/ MaxBotix,
MaxSonar,EZ0, EZ1, EZ2, EZ3, EZ4, AE0, AE1,
AE2, AE3, AE4, WR1, WRA1, and WRLA1 are
trademarks of MaxBotix Inc.


Thanx for the offer, Tom. But I think I've solved the problem. There's a more detailed discussion in a subsequent thread I opened, but this is the gist: I purchased a model with a wide detection envelope because I need to sense people standing anywhere along a five foot span four or so feet from the sensor. The sensor is mounted in a position where a hardwood floor is just at, or slightly beyond, the detection envelope.

When no observer is present the sensor occasionally senses the hardwood floor. Based on what I saw when I put the sensor output on my scope this happens once or twice out of every 10 scan cycles. For the other 8 or 9 cycles the distance reading is maxed out. Unfortunately, those one or two "spurious" results were enough to trip my detection algorithm.

I fixed the problem by angling the sensor up, away from the floor. I also changed the algorithm so that instead of reporting the median distance of a series of 7 or so observations, it reports the maximum distance observed. For my application that works better than the median approach.

- Mark

Go Up