VU meter arduino project help - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 17th December 2012, 04:43 PM   #1
diyAudio Member
 
Join Date: Dec 2011
Default VU meter arduino project help

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[i], 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], (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!
  Reply With Quote
Old 22nd December 2012, 02:37 AM   #2
diyAudio Member
 
linuxworks's Avatar
 
Join Date: Jul 2008
Location: santa clara, CA
test your a/d circuit with a simulator. a pot with one end to vcc, one end to gnd and wiper to the a/d arduino input pin. run your 'print' debug program and vary the pot from end to end. do you read values? are they stable?

also, you should multiread and average to get better readings.
__________________
My Photostream:http://www.flickr.com/photos/linux-works/
  Reply With Quote
Old 22nd December 2012, 04:32 AM   #3
diyAudio Member
 
Join Date: Nov 2008
Location: Victoria,TX
Blog Entries: 1
Hi,
Check the voltage coming from the transistor to the input port #0 in the micro. Normally the input range for the A/D it is 0 to 5 volts and the micro will convert it to 0 to 1023 counts. So each count would be 5 / 1023 = .0049mv.
  Reply With Quote
Old 22nd December 2012, 02:03 PM   #4
diyAudio Member
 
Join Date: Dec 2011
it turns out the diode was backwards. very strange since i thought the black line was the cathode on most diodes
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
another DIY LCF meter (arduino based) linuxworks Equipment & Tools 2 2nd December 2011 12:18 PM
vu meter surfstu Tubes / Valves 14 24th March 2009 09:03 PM
t-amp vu meter and volt meter question.... rectaacies Class D 7 3rd February 2006 11:22 AM
VU Meter Deltat Everything Else 5 19th January 2005 08:59 PM
VU meter nbcd Solid State 5 16th November 2003 09:02 PM


New To Site? Need Help?

All times are GMT. The time now is 04:04 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2