Instructables

Sound Pressure sensor for Arduino based on ZX-sound board

Picture of Sound Pressure sensor for Arduino based on ZX-sound board
zx-sound-self.JPG
There are a number of sound sensors available for the Arduino, some of them fairly cheap so when I needed one, I thought that building one myself was lunacy and I set out to buy one.
First thought of course was to check out Dealextreme.com as they always have a hoist of goodies available at reasonable quality and pretty good price and they do not charge for postage.

Unfortunately the sound module there (with an LM393) did not get many good reviews (note, they do have a new one now) and when I checked Sparkfun, it seemed that their original sound BreakOutBoard, the BOB-08669 (with an OPA344) had a bit of a rocky start with lots of complaints  and they replaced it with the BOB-09964, the difference between the two being some changes in resistor and capacitor values. Also the new BOB apparently did not make many users happy, + at USD 7.95 +S&H it wasn't really altogether a great deal either.

So my hunt went on. Well there really are a lot of circuits available: with  1 transistor, with many transistors with 1 op-amp with 2 op-amps.
However, I came upon a ready build board that had users enthusiastic: The zx-soundboard from Inex. They are a Thai company under a Singaporean mother company and have many distributors in Europe. Sadly however, none of these distributors seemed to have any information about this board. Fortunately they provide a clear circuit so that had to be the one. (In the mean time I found out it costs 7.57 euro in France.)

So why provide an instructable on such a simple thing. Well, 2 reasons:
  1. The Circuit Inex provides in my opinion is wrong
  2. If I design a PCB I best provide that to other would be builders
At first glance the circuit I designed is identical to the Inex schedule:
IC1a is used as a non-inverting amplifier. It offers a higher impedance than the inverting amplifier. The gain of the non-inverting amplifier is determined by 1+R4/R1 and is 40dB (100x).

In most cases it is possible to DC couple the circuit. However in this case it is necessary to ensure that the non-inverting has a DC path to earth for the very small input current that is needed. This can be achieved by resistor, R2 in the diagram. The value of this may typically be 100 kΩ or more. If this resistor is not inserted the output of the operational amplifier will be driven into one of the voltage rails.

When adding a resistor in this manner the capacitor-resistor combination forms a high pass filter with a cut-off frequency. The cut off point occurs at a frequency where the capacitive reactance is equal to the resistance. This is expressed in the Formula 1/2πRC. For the used combination it is =16Hz.

It is around IC1b where the Inex circuit goes wrong: The output from IC1a in the Inex circuit goes to the inverting entrance, labelled as 'pin 5'. However, the TLC272 has its inverting input on pin 6 and it's non-inverting input on pin 5.

So.. which was wrong the entrance or the pin number? I presumed the entrance was wrong as it seemed very unlogical to use the inverting input and I came across some people who had build the board succesfully and I presumed they just had followed the pin numbering and did not bother to question the design and thus unknowingly used the right entrance.

Anyway, why is Op-amp 1b even necessary?  Wel, if  the output of IC1a is fed directly to an ADC (as in the Arduino) there will be very strong fluctuations in the reading and as such the signal is not really representing the total sound pressure. We do that  with op-amp IC1b that is used as a comparator with a reference voltage on the inverting entrance (pin 6). When fed with  5Volt, the Voltage on the inverting entrance will be 72mV ((5000/69)*1)
As long as V+ < V-, Vo will be low, but when the sound level rises above 72mV, IC1b will make the output go high.
With a gain of 100 in IC1a, a voltage of 720uV from the microphone would be enough.  The Voltage build up over C3 is depending on the number of times the Output goes high and thus is an indication for the sound pressure. The delay in the RC filter at the SPL output is 3.3ms 150Ω*22uF  in which 150Ω is the internall pull up of the TLC272.

Bill of materials.
1x TLC 272 dual op-amp: €0.35
1x 8 pin IC holder.  €0.15
1x electret microphone:   €0.75
1x 22kΩ   €0.10
2x 100kΩ €0.20
2x 1kΩ     €0.20
1x 68kΩ  €0.10
1x 12Ω €0.10
1x 100nF  €0.15
1x 470uF  €0.10
1x 22uF    €0.10

Grandtotal €2.40
Furthermore: piece of Circuitboard 3 pieces of wire, solder, solderingiron

A copy of the fritzingfile for  the PCB is found here

For those who do not want to build and can't find the ZX board, there is always the Freetronics board, that also has proper sound level detection >71 mV.
You may also want to build this one, that is somewhat similar to the Freetronics board to the extend it has a sound pressure output and an audio output.
 
Remove these adsRemove these ads by Signing Up
Very clear and useful guide. How could I modify this to work at 3.3V?

Thanks!
diy_bloke (author)  robmeyerproductions8 months ago
the TLC272 has an operating voltage starting at 3.3 volt. Ideally therefore it should work as is.I have not tested it at that voltage though
skhell8 months ago
Do you have any idea of what decibel range you can detect with this sensor?
diy_bloke (author)  skhell8 months ago
I have not measured that as I do not have the gear. It reacts to normal speech at 1 meter away
manoj1000711 months ago
hey also tell me what is the wrong thing as mentioned above

diy_bloke (author)  manoj1000711 months ago
That is actually described in the text: the + and - entrances of the 2nd opamp were switched around.

Manoj, you probably don't mean bad but questions starting with 'hey answer me' or 'hey also tell me' may seen by some people as a rather harsh, if not impolite way to start off and they may not be inclined to reply
manoj1000711 months ago
hey any body answer me in the above circuit when does the output goes high.
it is when v+is greater than v ref or v-.but above it said in reverse.and how the reference voltage raises with sound pressure
diy_bloke (author)  manoj1000711 months ago
'Above' it says
"As long as V- < V+, Vo will be low, but when the sound level rises above 72mV, IC1b will make the output go high."
And it seems I made a mistake there: if V+>V- the output will be high.
Thanks for pointing that out
diy_bloke (author)  manoj1000711 months ago
'Above' it says
"As long as V- < V+, Vo will be low, but when the sound level rises above 72mV, IC1b will make the output go high."
And it seems I made a mistake there: if V+>V- the output will be high.
Thanks for pointing that out
guomo1 year ago
Did you ever use this for anything? You mentioned sending the output to the arduino ADC. I'm interesting in this as well. The problem is the sampling rate, even with tweaking the pre scaler values, can only achieve enough to sample audio at 8khz. I am going to try it just the same but I am curious if you had already done this and if you had audio files captured by the arduino. I'd be most interested to hear how they sound.
diy_bloke (author)  guomo1 year ago
If you are interested in Audio sampling try this one http://www.instructables.com/id/Sound-Pressure-sensor-and-Mike-pre-amp-for-Arduino/
diy_bloke (author)  guomo1 year ago
no i did not do any audiosampling because this board just is not that suitable for that. It gives an output related to the actual sound pressure.

I have built a board that does two things: amplify the actual wave signal and output that and give a spl indication and i will post that shortly
diy_bloke (author) 1 year ago
Added the fritzing file for download as well. It is in the introduction