Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Webbot on June 23, 2010, 08:50:16 PM

Title: Sound sensor
Post by: Webbot on June 23, 2010, 08:50:16 PM
Here's a quick design for a sound sensor. You may need to add supply capacitors between +5v and Ground ie 220uF and 100nF.

The electret microphone I used was Digikey part# P9897-ND

The output signal can go to an ADC input. Note that its voltage will not be zero but will then vary up and down from that initial position on hearing a sound.

Thought I might get round to making two of them and mount them as ears. ie turn the robot until the volume is the same in both ears. A sound source hunter !

Alternatively: listen for a short loud sound like a hand clap to trigger a response.

Have hooked it up to an oscilloscope and it works - but I'm sure I'm letting myself in for a barrage of responses telling me whats wrong ......
Title: Re: Sound sensor
Post by: Razor Concepts on June 23, 2010, 09:23:15 PM
Next version: adjustable frequency range, and adjustable sensitivity  ;D Help us out Soeren  :)
Title: Re: Sound sensor
Post by: Soeren on June 24, 2010, 06:34:56 PM
Hi,

Next version: adjustable frequency range, and adjustable sensitivity  ;D Help us out Soeren  :)
That would take the circuit from simple to something quite involved and I guess Webbot was aiming for letting even the wettest B1FF have a chance.

Frequency range selection would best be done in DSP, where you can make extremely steep filters (assuming a fast enough clock speed). An HP and an LP, both done as Chebychews should go a long way (for robotics, a passband ripple of 3dB or even higher shouldn't be an issue).
A similar analog filter (HP and LP) of a much lower order (i.e. not very steep) would take a load of opamps and would be a nightmare for an amateur (you will need horrendously precise resistors and caps with a low tc).

The adjustable sensitivity is easy, in Webbots circuit, just change the 100k resistor - lower resistance means more negative feedback (and hence lower gain).

Personally, I would have thrown an extra transistor into the circuit, added decoupled emitter resistors (to stabilize the transistors and stay in control of their input impedance) and most important, decoupled the bias voltage by one or two R/C circuits - to keep electrical noise from modulating the bias supply which will be seen as audio on the mikes output pin and then be amplified like any real sound.


The most usefull I could do here, would probably be a dual layout with a relatively balanced and noise free gain stage and with the right ECM capsules (there's a large variety in the range of max. allowable SPL from one make to another), I guess it could be set to a high gain and just go into a variable potential divider - perhaps with a "digital potentiometer" controlled from the µcontroller.
Disclaimer: Just from the top of my head right before bed time.

If anyone is serious about making sound based circuits, I suggest looking at either dedicated DSPs , dsPICs or similar.
Title: Re: Sound sensor
Post by: Webbot on June 24, 2010, 06:48:28 PM
Guess there is a distinction to be made here. ie

1. do you just want a sound switch - something that can re-act to sound

2. do you want some 'hi-fi' sound input for more complex audio processing

My goal was point 1 and wanted something small, simple and cheap - hence avoiding op amps or other amplifier circuits.

The sensitivity of the circuit can be changed as Soeren said or by using transistors with different gain co-efficients.

A 'volume control' could be added by having a trimmer between the capacitor/ground and the base connection of the transistor - but I prefer to set the response in the ADC on the microcontroller coz then it can change dynamically.

This is a primitive circuit to do a primitive thing - its not a hi fi audio sampler/recorder
Title: Re: Sound sensor
Post by: Admin on June 25, 2010, 02:39:29 PM
I would have just bought three of these and used timed interrupts to triangulate:
http://www.parallax.com/Store/Accessories/Sound/tabid/164/CategoryID/38/List/0/SortField/0/Level/a/ProductID/614/Default.aspx (http://www.parallax.com/Store/Accessories/Sound/tabid/164/CategoryID/38/List/0/SortField/0/Level/a/ProductID/614/Default.aspx)

I'm an off-the-shelf kinda guy 8)
Title: Re: Sound sensor
Post by: Webbot on June 25, 2010, 06:48:44 PM
Off-the-shelf is fine but its sometimes good to keep up your electronic skills and have that "I made this" satisfaction - and here is a simple sensor where you can do that easily and very cheaply. Of course: you can also buy. Decision is probably price vs time vs learning etc
Title: Re: Sound sensor
Post by: Admin on June 28, 2010, 07:43:12 AM
Quote
Decision is probably price vs time vs learning etc
And goal of the project ;D

If you want to learn how to make a robot, buy the microcontroller. If you want learn how to make a microcontroller, buy the capacitors and resistors. If you want to learn how to make a capacitor, buy the salt and aluminum foil. If you want to make aluminum foil, buy a shovel :P

At some point you gotta buy something, just depends on your goals ;D
Title: Re: Sound sensor
Post by: TrickyNekro on June 30, 2010, 03:09:34 PM
The same old admin.... Eeeexxxx....

Still nothing beats "good" homemade projects... They look more legit... and much less boring... ;-)

It's not the same to see some endless green PCBs compared with the copper removed epoxy....

The first is cold, faceless... The other means passion, dedication, faith and love for something....


Unless you go on production... The homemade is much better.... (if you can make it better ;-)))