Hi! I am currently working on my project which is a library noise monitor. The problem is that I think the sound sensor module is not detecting accurate noise on surroundings unless its near the microphone. The system is meant to have 3 levels of noise 'quite, moderate, and loud' and has a corresponding alarm. I think the sensor is detecting the alarm and its stuck on the loud level. I don't know how to fix it or whats the main problem given I don't have much background in this. Hope you can give advices
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
The microphone module you have does not have an amplifier so they are not very sensitive to sounds. You need to get close and yell into them to see any measurable output.
Buy a microphone module that has an amplifier on the module.
You have chosen a good project. However I agree strongly with jim-p in that to detect low level sound as in a library you will need a very good sensor. Based on your image I will guess you are using one of these or similar. That is hardly going to work for your application. A good microphone for detecting low level sound is expensive.
Next, I suggest you gain a good understanding of sound as measured in dba (decibels audio) . Then learn how fast sound decreases with distance. A decent sound meter cost well over $200 USD which gives you an idea of what’s involved in sound measurement.
I am not trying to dissuade you from this project but merely pointing out how important it is to understand what you wish to measure.
I think we all made this inexpensive project early in electronics: Big Ear Amplifier
OMG, I built one of those big ears as a kid. I put a cone on my microphone to make it directional. It was raining outside and I pointed it at a puddle. The actual sound of the rain drops splashing in the puddle was incredible. That had to be early 60s. Thanks for that memory.
Sparkfun do a Sound Detector module which might be worth a look.
Must admit, I didn't have a lot of success with it (trying to pick up the sound of a contactor on an electricity utility meter time switch).
Tried quite a few things, cone, sound-proofing the meter box.
Not the way I would do things.
I would dynamically measure the difference between high and low peaks and then use a single threshold value.
Like this (untested)
const byte soundPin = A0;
int rawValue, minPeak, maxPeak; // peak values
unsigned long startMillis;
void setup() {
Serial.begin(115200);
}
void loop() {
maxPeak = 0; // reset
minPeak = 1023; // reset
startMillis = millis(); // mark
while (millis() - startMillis < 250) { // sampling time
rawValue = analogRead(soundPin); // get samples
if (rawValue > maxPeak) maxPeak = rawValue;
if (rawValue < minPeak) minPeak = rawValue;
}
rawValue = maxPeak - minPeak; // final peak to peak value
Serial.println(rawValue); // see what values you're getting first
// LED code here
}