Sound Sensors

From Wiring

Jump to: navigation, search

By Jaime Patarroyo

“Sound is an amazing thing. All of the different noises we hear are caused by minute pressure differences in the air around us. What's amazing about it is that the air transmits those pressure changes so well -- and so accurately -- over relatively long distances.”
Boyer, Mark. "10 Types of Microphones." HowStuffWorks Electronics. N.p., n.d. Web. 29 June 2012.

Microphones have the ability to detect those pressure differences in the air and transform them into electrical signals, the ones we receive in the wiring board as analog input. Sound sensors can be understand as simple microphones, the signal received is so low that they usually need some components that allow to amplify it. One way of doing it, is to buy all the components separately and assemble your own as shown on the Microphone (sound sensor) example. But I highly recommend to buy a pre assembled circuit to avoid complications (sound is pretty tricky to measure).

There’s a wide offer of Sound Sensors for microcontrollers in the market and a longer list of people complaining about them. Here I’m going to talk about three I have had experience with. (Sparkfun’s Breakout Board for ADMP401 MEMS Microphone, HiTEC h10 Sound Sensor and my personal favorite INEX Robotics ZX-Sound)

Theres also another sound sensor that I would like to try, the Grove - Sound Sensor by Seeed. It catches my attention because it has an integrated potentiometer that allows you to adjust the input value. If you’re able to try it or any other sound sensor feel free to add it.

Contents

Code

The code for reading data from the sensors and printing it in the serial is the same. For calibrating your projects I recommend using the Visual Sensor Test.

/**
 * AnalogReadSerial
 * Reads an analog input pin 0 and prints the result to the serial monitor
 * Click on the serial monitor button to open it.
 */

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int sensorValue = analogRead(0);
  Serial.println(sensorValue, DEC);
  delay(100);
}


Sparkfun’s Breakout Board for ADMP401 MEMS Microphone

This sound sensor does the job, in a silent environment it returns values that oscillate between 504 and 520, speaking at a normal volume in a 50 cm range, will return values that oscillate between 400 and 625 and shouting will return something beneath 250 or above 750. It is really small, so you’re able to place it almost anywhere an it’s easy to plug. It hardly catches claps. Download Fritzing part.‎

Setup diagram

ADMP401MEMSmicrophone.jpg

HiTEC h10 Sound Sensor

I rather call it a clap sensor, it doesn’t seem to detect your voice at least you scream really hard and near, but as I say is really good for catching claps. It’s easy to wire and small to hide. Download Fritzing part.‎

Setup diagram

HiTECsoundSensor.jpg


INEX Robotics ZX-Sound

I’d say is my personal favorite because it does the job really well. It works very similar to the Sparkfun’s sensor with the advantage that you can detect different voice volumes. In a silent room it returns values between 24 and 53. Speaking at a normal volume in a 50 cm range, the reading will go up until 106. If you increase your voice volume, the readings can go up to 250. If you shout the value can go up to 700 and if you shout louder you can even reach 1024. My only complain is that it is not as small and fancy as the one from Sparkfun. It’s the worst at clap detection. Download Fritzing part.‎

Setup diagram

ZX-Sound.jpg


Language: English  • Español
Personal tools