Sonar Is Cool!

One of the things I find oddly intriguing about working with microcontrollers is that they interact with the environment. This isn’t some amazing insight, of course — what would be the point of working with something whose name includes the word controller if it didn’t actually control things? — but it’s still kind of kicky. Particularly when all of your previous computer experience involves typing, clicking and interacting with a screen.

Which is why I really enjoyed tying a sonar module into an Arduino. Now I had a computer that could “see”! It was fun walking around the room and watching my laptop indicate where the Arduino could find me and where it couldn’t.

I got my sonar module, a MaxBotix LV-MaxSonar-EZ0 Sonar Range Finder MB1000, from Pololu. Interfacing it to the Arduino was really easy — +5V, ground and a connection to return a pulse-width modulated signal. The width of the pulse is directly proportional to the distance of the object the sensor is seeing, and the Arduino can determine the pulse width with one function call. Neat!

1 thought on “Sonar Is Cool!”

  1. Hey, stumbled on your blog through a few searches about sonar control. I started working with PICs on and off last years, but I learning a low level language like Assembly was proving to be a stumbling block. I bought an arduino recently and WOW! This thing is super awesome. I learnt language in like a few hours (the easy parts anyways).
    I’m building a robot, and I’m done with motor control circuits. I’m now moving on to obstacle detection using sonar. Unfortunately, I have access to only transducers, not the complete module, so I have to build surrounding circuitry.
    Too much rambling.
    Your blog has helped and encouraged me.
    Thank you.

Leave a Comment

Your email address will not be published. Required fields are marked *