VU meter arduino project help

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello, I have been trying to finish the VU meter project found in the 30 arduino projects for the evil genius book.

I have followed it to the best of my abilities, but for some reason it is not working.

The VU meter only lights up when I blow hard into the microphone or play loud music from my phone directly overtop, and even then it doesnt seem to be very in sync with the music. Its as if it refreshes only every half second.

When there is no noise at all, the VU meter sits at the first bar, and even stays there when I shout from a distance.

-here is the project from the book: http://i50.tinypic.com/23k3gy1.png
- here is the code copied from the book:

int ledPins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
int switchPin = 2;
int soundPin = 0;
boolean showPeak = false;
int peakValue = 0;
void setup()
{
for (int i = 0; i < 10; i++)
{
pinMode(ledPins, OUTPUT);
}
pinMode(switchPin, INPUT);
}
void loop()
{
if (digitalRead(switchPin))
{
showPeak = ! showPeak;
peakValue = 0;
delay(200); // debounce switch
}
int value = analogRead(soundPin);
int topLED = map(value, 0, 1023, 0, 11) - 1;
if (topLED > peakValue)
{
peakValue = topLED;
}
for (int i = 0; i < 10; i++)
{
digitalWrite(ledPins, (i <= topLED || (showPeak && i == peakValue)));
}
}

here is a overhead view of my circuit: http://i45.tinypic.com/2zfqu5s.jpg
side view: http://i49.tinypic.com/15ews35.jpg
computer screen: http://i46.tinypic.com/wukuf8.jpg

I printed out the values coming from the input of the mic, they hover around 140-150 no matter what, even if I tap the microphone. they only change when I blow into the mic or play loud music directly on top of it. And even then, they dont really go with the music... sometimes they go really low.

So I'm not sure what I did wrong, I followed the instructions as best as I could and I'm pretty sure I did everything right.
The transistor is a BC548-4 30v 100ma transistor, the cap is 10nf film rdl...


does anyone know where I went wrong?


Thanks!
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.