Friday, June 14, 2013

Ultrasonic proximity sensor

The WBMD called for a means by which we could tell the balloon was full, and the boys wanted to use a proximity sensor of some sort for it.  Little luck getting the right kind from Halted.  They had had some, but were sold out, though the guy there was really nice in suggesting that he'd let me borrow one from his lab o' tricks.

In lieu of having a fancy IR proximity sensor, I found and purchased a couple of ultrasonic proximity sensors over the web. 


(From the top of image to bottom, pins on the sensor read: ground, echo, trigger, Vcc)



After getting it wired up, coding for it required use of the NewPing library.  But after playing with it and monitoring its results, I came away unconvinced that it would meet our needs.  All too often, it would generate a false zero, and you couldn't tell if that was a zero caused by things getting too close, or if it was a zero generated by having no response to the echo (timeout reached waiting for echo).  The backup plan was to change the physical design to have a reflective back wall within the configured max ping distance, to try to avoid the false zeroes.


Along the way, I had hoped to figure out how to repurpose a Lego Mindstorms ultrasonic sensor, but after reading the specs on i2c.  And, now that I'm writing this blog, I'm wondering why I didn't find and consider this link earlier:
http://forum.arduino.cc/index.php?topic=62899.0

Merit badges:
- Wire up a proximity sensor
- Download, install, and use an Arduino library
- Learn about how i2c devices work

No comments:

Post a Comment