Sound Sensor only showing Max and Min Values in Serial Monitor

I recently bought multiple sound sensors and have started testing with them. For wiring, I plugged GND into ground, VCC into 5V, and OUT into analog pin 4.

Here is my code:

int micPin = 4;
int micVal;

void setup() {
//pinMode(micPin, INPUT);
Serial.begin(9600);
}

void loop() {
micVal = analogRead(micPin);
Serial.println(micVal);
delay(50);
}

The sound sensor itself has a light that shows how much sound it is picking up, and I have set the sensitivity to a value that looks good when looking at the light. My issue is that within the serial monitor the value never changes from 1023 unless I make a very loud sound (or if I make the sensor more sensitive with the attached potentiometer) in which case it shows 15.

I'm wondering why the serial monitor will only show me those two values when the light shows a range in brightness depending on the amount of sound it picks up. Is it an issue with the code or analogRead()?

Thanks in advance.

Which sound sensor? Many have digital outputs and that's what you'd expect to see. The adjuster only changes the volume at which it switches from HIGH to LOW.

Steve

That is the link from where I bought them.

I would assume that it is analog because there is a light directly on the microphone that detects how much sound is being picked up and you can tell that the light on there is analog. If I could pick up the input for that light exactly then that would be analog and it would give me what I need.

From the page you linked to:
"This sensor can identify presence or absence of sound,but it can't recognize the frequence or volum, "
"Output form: digital switch output (0 and 1 high and low levels)"

If you're looking for an analog volume output it seems that you have the wrong type of sensor.

Steve

These sensor modules seem to come in a variety of flavors and from what I see in some cases there is different data for the same module. Reading your link I see:

It has a built-in capacitive electret microphone which is highly sensitive to sound.
This sensor can identify presence or absence of sound.
They are small and lightweight. With a mounting hole,convenient for install and fixed.
Sensitivity Adjustable : On the top of the sound sensor is a little flathead screw you can turn to adjust the sensitivity and analog output of the sound sensor.
Online Tutorial is offered. and Size: 1.34*0.63inch / 3.4cm * 1.6cm

That would lead me to believe the output is analog. Then there is this:

There is a mounting screw hole 3mm.
Use 5v DC power supply
There are threshold level output flip.
Real-time output of the microphone voltage signal / DO. when the sound intensity reaches a threshold
The output high and low signal threshold - Sensitivity potentiometer adjustmen. Application:Microphone sound detection

That implies a digital out and the sensitivity pot sets a threshold. The modules look identical.

Finally I am seeing more expensive and more pin modules using what looks to be the same sensor. They offer more features. The Spark Fun module is one such example.

My guess is you have a basic digital out so you should be able to adjust, based on sound level. and find a digital out threshold.

Ron

And if you think the light shows "analog" values, it's probably only a pwm like on/off signal.