Converting Ping to an audible signal
Chrisknopp
Posts: 2
I'm a newbie so please be patient. I have a blind dog that I would like to outfit with the ping module. I would like it to change audible frequency as he approaches an object. Thanks for any suggestions.
Chris
Chris
Comments
Look at the existing PING demo code (follow the links on the Parallax webstore page for the PING). You'll see that you end up with a value for the distance to the closest object. Use some kind of formula (experiment to find what works best) to come up with a frequency given a distance and use the frequency with a FREQOUT statement. The Stamp Syntax and Reference Manual shows how to hook up a piezospeaker to an I/O pin to get the "beep" from the FREQOUT statement. I think the Kits mentioned come with a speaker, but check. If not, Parallax sells it separately too.
Once you get this working, you could use just the Stamp module to make a smaller version. The PING can be powered from the Stamp module's regulated 5V output (Vdd) so all you'd need would be the PING, the Stamp, the piezospeaker, and a battery. There are ways to turn the power to the PING on and off from the Stamp that you could work on once you get some experience and the Stamp could go to sleep in between readings to reduce power further.
Chris