Random readings on sound sensor

Hi guys. I am trying to make something like VU meter, I am doing everything as shown in this video: Music Reactive Desk Light || DIY - YouTube

This is mine sound sensor: link

I am getting random readings from sound sensor, why is that?
Also, when only AOD is connected to a0, the sensor is catching as I am getting closer or further away from sensor. What should I do to make it work properly?
edit: pictures of readings from sound sensor: Imgur: The magic of the Internet

The hardware people will tell you it is a software problem.

Paul

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.

Fold up a soft blanket and put the sensor on top of it. Do you still get the random results? Then put the sensor inside several fords of the blanket. Same results?

Paul

You are very infrequently sampling the microphone, so of course the results seem random.

  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1);        // delay in between reads for stability

Just printing out "sensorValue" at 9600 Baud slows the program down enormously, and of course, the idiotic delay() doesn't do you any good.

How can I print it out more frequently, what should I change in the code?
I wasn't replying because I burned my arduino...

EDIT: I changed serial.begin to 2000000 and also removed delay();

Here is how it looks now. Pic

It looks the same as before, the only difference is that now is taking results more frequently I think.

Ok, time for detective work.

Did you solder all connections like in the Utube video?

Are you powering the sound detector and Arduino from a separate power source, like the video?

If you place a piece of black electrical tape over the microphone opening, do you still get the same random results?

Are you testing in a noise filled environment, such as music or TV playing, or kids playing or street noises?

Earlier you mentioned the analog values indicated when you were closer to the mike. Were you making noise at that time? What was happening that caused the change in values?

Paul

I know this is very late but have you found a solution to this? I am having the exact same symptoms and am close to buying a new one. But before I do that I want to make sure nothing is wrong with my code.

dr_death47:
I know this is very late but have you found a solution to this? I am having the exact same symptoms and am close to buying a new one. But before I do that I want to make sure nothing is wrong with my code.

im here too! this is maddenning, ive been at this for so long trying to get it to work, my serial read is just floating at one number, and it takes a ton of audio input to trigger any change, i cant figure out a way to get it to more accurately print the output