Its not a software problem, when I use this code:
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/AnalogReadSerial
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
it shows exactly the same readings. I have 2 sound sensors, they both give the same output.
I should also note that my power supply is from usb, so my schematic is something like this:
USB -> USB mini
ARduino 5V -> vcc led strip
Arduino GND -> gnd led strip
Arduino D6 -> data led strip
Sound sensor analog output -> A0 arduino
Sound sensor VCC -> vcc led strip
Sound sensor GND -> GND led strip
And one more thing. When I only connect sound sensor analog output to A0 arduino, the sensor is giving me results of how close I am to the sound sensor. So for example when I get closer to sensor, the readings are higher, when I go away the readings go low.