Radioshack Special - Build your own bot ears!

Hey guys,

I have provided my schematic to anyone who wants to try and build their own simple robotic ears. All parts for this schematic (Except the ADC0832)can be bought at your local Radioshack store, or from their online website.

Enjoy!

http://img152.imageshack.us/img152/5207/stampaudiowj7.gif

EDIT
Ok guys, I have provided a complete parts list to make it easy for you.
Note: all parts are listed except the ADC0832 part available from Digi-Key.

[size=150]Parts List: (Bill of materials)[/size]

Sound Sensor Parts List - All parts needed except - ADC0832 - (Digi-Key item)


Move to Shopping Cart
Remove from Wish List 10K Ohm 1/4-Watt Carbon Film Resistor5 Pack
Item#: 2062347
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 2.2K Ohm 1/4-Watt Carbon Film Resistor5 Pack
Item#: 2062344
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 1M Ohm 1/4-Watt Carbon Film Resistor5 Pack
Item#: 2062351
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 1K Ohm 1/4-Watt Carbon Film Resistor5 Pack
Item#: 2062343
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 220 ohm 1/4W 5% Carbon Film Resistor pk/5
Item#: 2062340
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 8-Pin Retention Contact
Item#: 2062604
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 15, 2006 $0.69

Move to Shopping Cart
Remove from Wish List Electret Microphone Element with Leads
Item#: 2062216
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 28, 2006 $3.69

Move to Shopping Cart
Remove from Wish List 1N4004 Micro 1-Amp Rectifier Diode
Item#: 2036270
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 28, 2006 $0.79

Move to Shopping Cart
Remove from Wish List LM741CN Operational Amplifier (8-Pin Dip)
Item#: 2062547
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Feb 28, 2006 $0.99

Move to Shopping Cart
Remove from Wish List 0.047µF 50V Hi-Q Ceramic Disc Capacitor Pk/2
Item#: 2062364
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details) Mar 1, 2006 $1.29

Move to Shopping Cart
Remove from Wish List 10µF 35V 20% Radial-lead Electrolytic Capacitor
Item#: 2102509
IN STOCK
Leaves warehouse in 1 - 2 full bus. days. - (Details)

wow, it looks a little complicated, but Im sure its easy once you get started. Looks good too!

It’s only 20 parts. It’s not bad at all. :laughing:

hmm, interesting…i wish i could read it, lol

mike, do you think you could maybe…post wat these parts are? and how many there are? for use newbs? :laughing:

Great, gunna give it a try! Does DigiKey sell ADC0832s? I need to buy an IC or two from them anyway.

yes, digi-key sells them.

I added a parts list to the original post.

this looks good. Once I find a use for it, I might use it …

I understand that you said it was an “ear” for your robot. Does that mean that the robot can pick up sounds around it? IF this is true, than You could program your robot to respond to different sounds, and when a sound like a bell sounds off, the robot would perform a task, or when A sound like brocken glass sounds off the robot would respond to it and take necessary precautions. You could also you this for autonomus. If your robot bumps into something and it makes a sound, The robot would recognise the sound and know what it juts hit. With all these Ideas, it is possibly to use this very practically. Thanks for the parts list! :smiley:

Yes, this circuit gives your bot the ability to respond to sounds. as for identifying sounds, it is not that advanced. This circuit just allows the bot to respond sounds from the left or right. If you use “single” mode in the code, you could program the device to calculate the percentage of the left and right values and get basic angles of the sound source. I have not done this since I do not have the skills to program such a task.

I see. I understand that it would be a difficult project. I myself have not coded much, so this would be extremely difficult in that matter. However, it would be a cool project with the right equitment and job for the robot to perform.

thanks mike :smiley:

this does make it much easier :laughing:

Thanks for the schematic, Mike.
I was actually going to ask if I could borrow it a while ago, but projects just started stacking up and I forgot.
:smiley:

I’ve followed your other post in which you methodically beat this beast down, but me gots a question…
From the look of it, you’ve got two mics feeding two amplifiers through RC circuits (to slow down the sound to a processable level?) which in turn is read by an ADC through another low-pass filter.

That much I think I understand.
But, C1, D1, and especially R3 confuse me.
Lumping all three together looks like a low-pass filter (with a diode to drop some extra voltage?), but I don’t understand why R3 is bypassing the amplifier.

Thanks again.
^.^

I’m not sure if this would work for quick sounds, since there might be too much delay between the two readings to grab both sound values at the “same” time.
In that case, the second-read sound would probably always seem a bit less loud than it should, but perhaps you’ve got something in your circuit to prevent this.

Assuming that the values can be grabbed quickly enough not to matter, this psuedo code should work to determine the relative positions:

// Get the two ADC readings.
RightMic = GetADCch1()
LeftMic = GetADCch2()

//Find the ratio of one ear to the other.
Ratio = RightMic / LeftMic

//Assume a servo mid position pulse length of 1500
//Assume that 2250 is 90 degrees to right
//Assume that 750 is 90 degrees to left.
//If that's true, then adding 750 to mid position = full 90 degrees right.
//And subtracting 750 from mid position = full 90 degrees right.

//Is the ratio more towards the right mic?
If Ratio > 1 Then
//Then find where to move to.
NewPosition = 1500 + Ratio * 750

//Is the ratio more towards the left mic?
NewPosition = 1500 - Ratio * 750

//Move the servo to the new position.
MoveServo(NewPosition)

There’s more direct ways to accomplish the above, but I thought it best to space everything out into simple steps.

The first new placement might not be very accurate, but after a few loops of this code, it should hone in on the target pretty well.
There needs to be a delay between reiterating, though, to allow the servos to move and then quiet down again.
So, like a human ear, it would easily track down a long drawn out sound, but wouldn’t be terribly accurate for pinpointing quick, unrepeated sounds.

The cap / resistor from the mic is to filter the signal before amplification. This is to smooth out the signal, to get rid of some of the noise. The audio has sharp peaks if looked at with an 'O scope.

The R3 resistor is for gain. The larger the value the more gain. The op amp monitors the output. The resistor is a feedback loop. With a larger value, you “trick” the op amp in thinking the output is weaker, thus causing an increase in gain output.

The Diode and cap after the op amp, is to further refine the signal before converting to a nice square wave (digital signal). The caps also change the response of the circuit. Larger values tend to slow down the signal coming out.

Keep in mind that I had a lot of help from others with this design. It’s not my own design 100%. Pete helped out a huge amount in the beginning. The mic circuit was taken from a web page that talked about mic amplification. I took my idea and pieced together a complete circuit to do what I wanted.

Ahh, that makes perfect sense.

I suppose I was looking at it from a component-by-component perspective rather than the grab-this-schematic-from-datasheet-and-whack-it-together-with-what-I-know perspective.

Odd, though, that I would see it that way, when the latter is the way I usually tend to do things.
:laughing:

To expound a bit on how the circuit works:

The cap before the op-amp is for “DC blocking” - the op-amp needs an AC-only input, but the output of the mic is a large DC voltage with the very small AC signal added to it. The cap effectively removes the DC component of the signal. You could also call it a “high-pass filter”, but that’s not the best description in this case.

The resistor that goes from the output of the op-amp back to the (-) input is primarily what determines the “gain” of the circuit. Exactly how that happens requires a lot of theory to explain.

The diode and cap after the op-amp (D1 and C1) are really not a filter, but instead they form a circuit called a “sample and hold” (S&H). The purpose is to ‘capture’ the highest voltage level coming out of the op-amp, and keep that level stored in the cap for awhile, so that the A-to-D has time to measure it (via the software). Without the S&H, the A/D would not be able to ‘catch’ the output at the right time to determine how loud the sound is.
Side-note: If you replace the diode with a resistor, then it becomes a low-pass filter circuit.

Pete

I forgot to mention:
With the resistor values shown, the gain of the op-amp is probably in the 300-500 range (that is, it amplifies the signal coming from the mic by a factor of 300 to 500).
The reason I say ‘probably’ is because the output impedance of the mic is part of the equation, and I’m only guessing about what that value is.
One estimate is that the mic Z is about 1K. If that’s the case, then the gain is about (1000000 / (1000+1000)), which is 500.

Pete

Thanks Pete, I also learned more about this circuit. I appreciate all the help you have provided on this in the past.

Ahhh…
That gives me some new tricks to mull over.
:smiley:

Thanks, Pete!