Shop OBEX P1 Docs P2 Docs Learn Events
Converting Ping to an audible signal — Parallax Forums

Converting Ping to an audible signal

ChrisknoppChrisknopp Posts: 2
edited 2010-10-17 19:47 in Accessories
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-17 11:31
    The simplest way to do this would be to use a Stamp to drive the PING and to generate a tone based on the distance from the PING. Get a Stamp Discovery Kit or a Basic Stamp Activity Kit so that you can learn how to program the Stamp and some basic digital electronics.

    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.
  • ChrisknoppChrisknopp Posts: 2
    edited 2010-10-17 19:47
    Thank you Mike for such a detailed and helpful answer.
    Chris
Sign In or Register to comment.