Author Topic: Sound sensor  (Read 4474 times)

0 Members and 1 Guest are viewing this topic.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Sound sensor
« 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 ......
« Last Edit: June 23, 2010, 08:56:48 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Sound sensor
« Reply #1 on: June 23, 2010, 09:23:15 PM »
Next version: adjustable frequency range, and adjustable sensitivity  ;D Help us out Soeren  :)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Sound sensor
« Reply #2 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Sound sensor
« Reply #3 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
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Sound sensor
« Reply #4 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

I'm an off-the-shelf kinda guy 8)

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Sound sensor
« Reply #5 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
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Sound sensor
« Reply #6 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

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: Sound sensor
« Reply #7 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 ;-)))
For whom the interrupts toll...

 


Get Your Ad Here