Monday, February 17, 2014

High Sensitivity Arduino Sound Level Detector

Generally we want to sense the environment when something interesting is occurring. Sometimes the presence of sound is indicative of an interesting activity. If we can detect sound level we can trigger a sensing activity to capture information about the activity of interest. I have posted a short video of this simple high sensitivity Arduino sound level detector working.

In this project we use an Arduino Uno, an electret microphone and an LM358 dual operational amplifier to create a simple sound level detector. The signal from the mic is amplified by the one side of the LM358 with a gain of approximately 221 (see op-amp wiki) as defined by the 220k feedback resistor and the 1k pull down resistor connected to the negative input of the LM258 amplifier.
The output of the first stage amplifier provides input to the other side of the LM358 used as a comparator. The triggering threshold of the comparator is controlled using the potentiometer. When the audio signal from the first amp exceeds the triggering threshold the comparator sends a digital '1' to the Arduino Uno on pin 8. When the Uno detects the sound level high input it turns an LED on. You can see a schematic diagram of the sound detection part of the circuit below.

Prototyping this on a breadboard looks something like this:

The actual breadboard prototype appears below:

... and the simple sketch I used to drive the Arduino Uno appears below:

Stay tuned for projects that receive the sound detection as input and use it to drive other interesting activities. Have fun. Feel free to share below if you built something cool with this, or have some ideas for enhancements.

I am looking to use something similar to your design in an industrial setting. there will a constant noise level and i am wanting to monitor excessive noise levels e.g a machine takes a knock. Would varying the potentiometer be able to account for the standard noise level?

Possibly. It would depend on the contrast between the ambient noise and the excessive noise levels you expect. In other words, there should be no problem adjusting the potentiometer so it doesn't trigger on regular ambient noise. The question is whether the interesting events you want to alert on are significantly louder to where they would trigger above this threshold. I recommend a quick prototype and test in the target environment.

This is really a wonderful blog for some great information. I have been searching for a long time for this types of content. Keep up posting more and thanks for your great staff.Battery Operated Ultrasonic Level Sensor

I have a project involving triangulation by tdoa of sound which requires use of 3 equaly calibrated microphones. I have used the sparkfun sound sensor boardhttps://www.sparkfun.com/products/12642, but have found that they are firstly overpriced and difficult to calibrate. By replacing R17 with a trimpot, i came quite close to same calibration for 3 boards hooked up to a Teensy 3.5 Digital Inputs 10,11 and 12.

I require a circuit which firstly has an opamp (LM358), bandpass filter 300hz-3Khz and an adjustable trimpot for gain and calibration. Output Digital High/Low signal to the Teensy 3.5 for use with interrupts.

I have built the circuit as you have designed and found that it is easy to build and fits the specification above except for the bandpass filter. Would you be so kind as to guide me in the right direction in adding a bandpassfilter?