Sound Sensor/Detection Module

Anybody has any experience using sound detection module like this?

the main output pin spits-out 0 to 1024 on the analog pin. sounds like good resolution, but problem is, required distance from microphone to the sound source is very very short! you have get really close to the mic to make any impact. there is a potentiometer to control the "sensitivity". but its doesn't control sensitivity instead it changes the level so it would now output higher number all the time and if you still want see change then you have to go real close to the mic and scream!

I thought its a bad mic, so i change with a mic that my pc microphone had. I remember i used to talk on skype using this mic from 8/10 feet distance. but with this module if I go 1/2 feet away.... then no change on the output due to sound!

any idea whats going on?

Do you have a link to the schematic?

Usually, these things are biased at 2.5V and silence reads around 512. Background noise or quiet sounds should "bounce around" near 512, and very loud sounds should give readings between 0 and 1023. Since you are "randomly" reading a "wave" that goes positive and negative, you can read 512 (silence) with a loud sound if you happen to read at the zero crossing. That means you have to make several readings to find the positive & negative peaks. (Of course, you'll never get a negative reading, since the Arduino can't read negative voltages, but with the 2.5V/512 bias, anything below 512 is the negative part of the waveform.)

Thanks DVDdoug.

do you mean my connection schemantic? its very simple. ardunio 5volt to power(+), ardunio groud to ground (g), Analog 0 to a0 and digital 6 to d0. although you can forget about d0 since its just threshold indicator. which u can calculate from a0 as well in ur code.

i coudn't find a datasheet for the module :frowning: thats the bad side of buying oversea cheap module on ebay. I'm sure someone on this planet made it. and if they followed any engineering principal they did made datasheet as well. but i have no clue how to find it! the seller says manufacture does't supply it :roll_eyes:

but I don't think it measure negative. i don't think it measure frequency at all for that matter. on the description it says it measure voltage on the mic. and i think that's exactly what it do. I can really loosen up the potentiometer and make the background noise on 500 level. but then it doesn't go down when when i make sound. only go up 500 to 1000.

at close proximity and and loud sound. it works pretty well if I put speaker on 2 inch away and pay loud music. i see the number goes up and down very well with the sound base. with very good accuracy should i say. but i take the speaker away or reduce the volume keeping the close distance... either way the output level drops to the background noise level.

do you mean my connection schemantic?...

...i coudn't find a datasheet for the module

I was looking for a schematic for the module which might be on the datasheet if there was one. Then, I could figure-out what the pot is doing.

I think that module just doesn't have enough gain for your needs.

but I don't think it measure negative. i don't think it measure frequency at all for that matter.

It won't measure frequency, but the sound-frequency that goes-in as sound should come-out as the same electrical-frequency (if it works like a regular microphone & preamp).

A sound wave and the corresponding electrical wave goes negative. Since the Arduino can't read negative voltages, the output is usually biased at 2.5V (so that +1V comes-out as 3.5V and -1V comes-out as 1.5V, etc.), but we don't know what that module is doing... Or if you are only "detecting" sound or volume, you can throw-away the negative part of the waveform, but I doubt that's what it's doing...

I can really loosen up the potentiometer and make the background noise on 500 level. but then it doesn't go down when when i make sound. only go up 500 to 1000.

That almost sounds like the pot might be a bias control instead of a gain control. Do you get a bigger range of numbers with the "gain" turned-up? i.e. If you get numbers between 500 and 1000 with the pot at one extreme and numbers between 0 and 500 at the pot at other extreme, that's a bias control (not a gain control).

If it is a bias control, there is something else you can do: Adjust the pot for a reading of 0 with silence (or just slightly above 0). Then you can change the ADC reference to 1.1V (from the default 5V) in your sketch. That will increase the sensitivity by about 5 times.

If it's a gain control (or "sensitivity" control) that's not going to help because turning the gain down to zero is obviously the opposite of what you want.

so it turned out a simple lm386 based circuit works much better then these so called sound detector module! (these module was based on lm393 by the way).

i build following circuit with lm386. and i get nice evenly spread sensitive signal using the same mic! :smiley:

the problem is though i get only about 280 maximum reading on A0 using power from arduino. if i use external power source like 10v then i get reading up 800. and it increase noise reading aswell. anyone has any idea tweaking the circuit to get higher gain using only 5v from arduino? Im thinking using a higher sensitive mic. that would produce higher volt for the same sound pressure and i would get higher reading on the analog pin. am i right?

also can anyone suggest me a high sensitive uni directional mic? best i came up is this one
Sensitivity -46dB ±4dB
S/N Ratio 60dB
Impedance 2.2 kOhm
although little pricey for a tiny mice like this :roll_eyes:

thanks

update can beuseful: module datasheet.
or http://www.mpja.com/download/31072mp.pdf

This code is very sensible and have spectrometer VU.

Note: ajust the potenciometer with optimal sensibility.

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

double volts;
int led = 13;
int threshold = 500; //Change This
int volume;
int maxvolume;
const int sampleWindow = 3; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
unsigned int peakToPeak = 50;
LiquidCrystal_I2C lcd( 0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE );
// create custom characters for LCD
byte level0[8] = { 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000};
byte level1[8] = { 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b11111};
byte level2[8] = { 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b11111, 0b11111, 0b11111};
byte level3[8] = { 0b00000, 0b00000, 0b00000, 0b00000, 0b11111, 0b11111, 0b11111, 0b11111};
byte level4[8] = { 0b00000, 0b00000, 0b00000, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111};
byte level5[8] = { 0b00000, 0b00000, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111};
byte level6[8] = { 0b00000, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111};
byte level7[8] = { 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111};
int strobe = 4; // strobe pins on digital 4
int res = 5; // reset pins on digital 5
int left[7]; // store band values in these arrays
int right[7];
int band;

void setup() {
analogReference(INTERNAL);
lcd.clear();
lcd.begin(16,2);
Serial.begin(9600); // For debugging
pinMode(led, OUTPUT);
maxvolume = 0;
lcd.begin(16, 2);

lcd.clear();
lcd.createChar(9,level0);
lcd.createChar(1,level1);
lcd.createChar(2,level2);
lcd.createChar(3,level3);
lcd.createChar(4,level4);
lcd.createChar(5,level5);
lcd.createChar(6,level6);
lcd.createChar(7,level7);
lcd.setCursor(0,1);
lcd.print("Left");
lcd.setCursor(11,1);
lcd.print("Right");
pinMode(res, OUTPUT); // reset
pinMode(strobe, OUTPUT); // strobe
digitalWrite(res,LOW); // reset low
digitalWrite(strobe,HIGH); //pin 5 is RESET on the shield
}

void readMSGEQ7()
// Function to read 7 band equalizers
{
for( band = 0; band < 7; band++ )
{

volume = analogRead(A0); // Reads the value from the Analog PIN A0
/*
//Debug mode
Serial.println(volume);
delay(100);
*/

if(volume>=threshold){
digitalWrite(led, HIGH); //Turn ON Led
}
else{
digitalWrite(led, LOW); // Turn OFF Led
}

unsigned long startMillis= millis(); // Start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level
unsigned int signalMax = 0;
unsigned int signalMin = 1024;

// collect data for 50 mS
while (millis() - startMillis < sampleWindow)
{
sample = analogRead(0);
if (sample < 1024) // toss out spurious readings
{
if (sample > signalMax)
{
signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
signalMin = sample; // save just the min levels
}
}
}
peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude
double volts = (peakToPeak * 3.3) / 1024; // convert to volts

left[band] = peakToPeak; // store left band reading
right[band] = peakToPeak; // ... and the right

Serial.println(peakToPeak);

}
}

void loop() {
readMSGEQ7();
// display values of left channel on LCD
//band = peakToPeak * 50;

for( band = 0; band < 7; band++ )
{
lcd.setCursor(band,0);
if (left[band]>=12) { lcd.write(7); } else
if (left[band]>=11) { lcd.write(6); } else
if (left[band]>=10) { lcd.write(5); } else
if (left[band]>=9) { lcd.write(4); } else
if (left[band]>=8) { lcd.write(3); } else
if (left[band]>=5) { lcd.write(2); } else
if (left[band]>=4) { lcd.write(1); } else
if (left[band]>=0) { lcd.write(9); }

}
delay(50);
// display values of right channel on LCD
for( band = 0; band < 7; band++ )
{
lcd.setCursor(band+9,0);
if (right[band]>=12) { lcd.write(7); } else
if (right[band]>=11) { lcd.write(6); } else
if (right[band]>=10) { lcd.write(5); } else
if (right[band]>=9) { lcd.write(4); } else
if (right[band]>=8) { lcd.write(3); } else
if (right[band]>=5) { lcd.write(2); } else
if (right[band]>=4) { lcd.write(1); }
if (right[band]>=0) { lcd.write(9); }
}
}

Does someone could tell me if exist an Arduino sensor which could get the frequency of external vibrations, or better, if it could throw information about the frequency and intensity of a vibration (or a sound).

Thanks.

I am using a sound sensor for my project ,the output of which I want to amplify (voltage amplification needed).
Am using a amplifier circuit using bc547 but am getting flactuated output from sensor .
but for the same amplifier circuit if I give input from regulated power supply instead of sensor output,
I am getting proper output.
I need help to recognise what may be causing the issue to get proper output from sensor.
Please be needful ,thanks in advance.