Hi , I am an eye surgeon and don't really know anything about computers or electronics. My son would like to make a small radar device with a sound output proportional to distance so that blind people can "hear " the output. Ideally, would like some sort of servo motor that rotates the sound beam/IR beam and then outputs the result of the radar sweep as a sound wave , rather than a single tone.
I saw this ultrasonic range finder and video. http://www.sparkfun.com/products/639
but rather than having the output visually as in the video , I need an audio connection.
His aim to to train visually impaired to recognize the shape of the sound output and hence their surroundings.
Would love to hear your ideas and since either one of us knows how to proceed, we will need some detailed instructions.
First off, I can't give you a step-by-step, mainly because I haven't played with these ultrasonic sensors, but I can tell you what tutorials you could use to proceed. Note that this isn't a beginner's project.
First off, you need to learn how to control a servo programmatically; given that you want to "sweep" the sensor using the servo, the sweep tutorial seems best:
Now - if you notice, that tutorial shows how to set the position of the servo to a given "degree" position; so in the "brute force" manner (more on what I mean by this later), your loop will be something like this (pseudo-code):
servo-angle = 0
direction = 1
set servo to servo-angle
ping ultrasonic sensor and get reading (distance)
output tone based on distance
increase servo-angle by direction
if servo-angle = 180 then direction = -direction
if servo-angle = 0 then direction = -direction
I hope that is clear enough to understand what is going on.
Ok - so, you have your servo sweeping (which is most of the lines in the pseudo-code above, actually!); you need to read your ultrasonic sensor. I don't have any example for that particular sensor you mention, but here are a couple of more examples for two different sensors, again from the playground:
The first is the Parallax Ping ultrasonic sensor (a fairly common ultrasonic sensor - it was one of the first of the "new breed" hobbyist distance sensors); it is fairly simple to control as you can see from the code (basically pulse it, wait for the pulse back, measure the time difference to get distance - you won't really need the conversion code, but you might need some kind of scaling for the sound part using the map() function perhaps).
The second example is more complex, and is for the Devantech SRF10 or SRF08, which use an I2C bus for communications; the same thing as above is happening, except the electronics on-board the sensor does the actual ping-and-receive-the-calculate step; you're basically sending a command to the device over the bus saying "hey, give me a distance reading now" - and it does, and returns the data. Again, you'll probably have to do some conversion on it to get something compatible for the sound output.
Which leads us to that step - which is fairly simple. See this example:
Here, the code basically plays a tone via a digital output line (using a square wave - which is kinda harsh sounding). You'd likely have to build an amplifier to hook up headphones (maybe something based on the LM386 - or an equivalent module of sorts). You might also want to put an LC filter or something on there to "smooth" the waveform into something approaching a sine wave (more pleasant to hear).
Another option - rather than using tone(), you could use PWM (on two separate pins), and output a fixed frequency at a volume level somewhere between 0-255 for each output, mapped to the angle of the servo (that is, if the servo was at 100 degrees, you would map one output to 100, and the other to 80) - then feed each to each ear; the varying volume levels (perhaps) could give a directional indication of where the objects were (?)...
Now - recall above how I said this is a "brute force" method? That's because you are essentially polling everything, and running things as fast as possible in a loop - which actually is fairly slow (not that this system will ever be quick, mind you). If you wanted to take things to the next level, you would use interrupts. Basically, on receipt of the ping return, that would trigger an interrupt, which would update the servo position (in the instance where no return occurred, you'd have to have some kind of watchdog to tell it to advance anyhow after so many milliseconds). Doing it this way, you would run the sweep at the speed of ping-returns, instead of a fixed polling method with the built-in delays. Your worst case speed scenario would be when nothing was in range, as set by the minimum value on the watchdog. This kind of method is actually fairly advanced and complex - but it's something to keep in mind if you want to take the project to the "next level".
...and the level after that? Well, you'd have to likely go optical; I've got a few ideas there on how this could be done somewhat inexpensively - but are too complex to detail here (and likely would need something more than an Arduino to process the data). Give it some thought, though, and you might be able to come up with a similar solution as well!
Good luck, and I hope this at least inspires you and your son...