Problems with a Sound detection Module

hey guys, i ordered this Sound detection Module from Ebay : link

i connected 5V and GND to the Module and attched no wire to the output pin.

theres a led on it wich shows the Volume Level recorded by the microphone (if i clap my hands, the led flashes..) so far so good.

i settet up a test sketch to read the output pin via analogread:

void setup() {

  pinMode(A0, INPUT); //sensor
  Serial.begin(9600);
  
}



void loop() {

 int sensorState = analogRead(soundSensor);
 Serial.println(sensorState);
 delay(100);
 }

now the Problem: Everytime i connect the output pin to A0 of my arduino the LED on the Module changes to permanent on , no matter if i clap my hands or whatever ( yey , i tried using the potentiometer)
the ADC Value changes to 15.

if i use my multimeter to measure the voltage between the output and ground the module works properly.
loud music -> low
no music -> 5V

i dont get it.. please help me:)

The code that you posted will not compile. The soundSensor variable is never declared.

The output of the module is digital. The output will change state when the sound level exceeds the threshold set by the potentiometer as you saw with the DMM.

You could try:

Serial.print(digitalRead(A0);

in loop(). No need to set the pinMode for A0 to input as it defaults to input on reset.

now the Problem: Everytime i connect the output pin to A0 of my arduino the LED on the Module changes to permanent on , no matter if i clap my hands or whatever

That shouldn't happen. Arduino inputs are very-high impedance and they shouldn't affect anything they are connected to (as long as whatever they are connected to is between 0 and +5V).

And, the 100mS delay is a bad idea if you're trying to read a hand-clap. :wink: It can't read during the delay time so I just reads for a few microseconds and then delays again.... You'd have to be lucky to "catch" the clap between delays. The delay should be OK with continuous music.