Audio Detector for Starting Robots

Control Systems & Robotics Topics
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Audio Detector for Starting Robots

Post by Neo » Sun Nov 29, 2009 9:56 am

The following circuit can be used to detect those annoying piezo whistles that one can get from Radio Shack. For the Trinity Home Fire Fighting Contest, additional points accrue when the robot is started by a sound similar to a fire alarm. The actual whistle is specified as a particular Radio Shack piezo element, but the following circuit should be tunable across a wide range of pitches.
Audio_Detector_Schematic.gif
Audio_Detector_Schematic.gif (39.64 KiB) Viewed 3087 times

The Circuit Description

Gain Stage: The input is a standard surplus electrect microphone. Although I have not tried it, I suspect any condenser computer microphone will work just fine. The microphone is powered by the 4.7k load resistor. The resulting signal is coupled to the input stage via C4 and amplified by roughly 100x. The gain is set by the ratio of R2/R5.

The second stage is a band pass filter. The centre frequency of the filter is set by C7, C5 and R1. The Q (or narrowness) of the filter is set by R9. With R9=560 the filter is pretty particular.

The third stage is simply more gain, about 30x and the forth stage is a peak detector. The diode makes a rectifier that charges C9 to the peak value of the signal from the second gain stage. R14 is then chosen to determine the decay of the peak detector. With R14=10k the capacitor discharges in a couple milliseconds.

There is nothing critical in the circuit except for the band pass components, C5, C7, R1 and R9. Most +5v quad op amps should work fine and if you use an op amp that works rail-to-rail, modify R6 and R7 to bias the amps more in the centre of the voltage range.
Tuning

To tune the audio detector, hook an oscilloscope, or DVM to the output of the circuit. With your signal on, adjust R1 to the centre of the peak reading. If your signal is really loud it will be hard to determine the centre frequency. In that case, move your signal across the room or tape the piezo element so it isn't so loud.
Use

The detector will detect random noises or whistles or hand claps, but, the output will not be held high for very long. So, to determine when a valid signal has been detected, sample the output and verify that it has been active for more than 2-300ms. My Fire Fighting robot, Dilbert uses the detector as a "Push On, Push Off" switch; so the output is sampled every 100ms (10hz) and five consecutive active samples are required before changing the state of the internal switch.
PCB Artwork

If you have the EAGLE cad package you can use the following files to generate your artwork:

If not, the following images are the top and bottom view of the PCB. The bottom view is mirrored so it is correct when placed upon the bottom of the blank PCB. The images were intended to be printed out at 300dpi - that is why they are so big on your screen. So, copy them down, load them into your favourite image processor and print them out at 300dpi.. The board is ~1.2" x 1.5" - so it should be pretty tiny.
Audio_Detector_Board_Top.gif
Audio_Detector_Board_Top.gif (8.57 KiB) Viewed 3087 times
Audio_Detector_Board_Bot.gif
Audio_Detector_Board_Bot.gif (7.07 KiB) Viewed 3087 times
Courtesy: Larry Barello
Post Reply

Return to “Control Systems & Robotics”