I am trying to set-up a simple voltage meter using the Arduino Duemilanove..
First I need to make the voltage divider...
I am current using a PSU to power... but am trying to use 7.4v in my equation for figuring out the math (which I set my PSU to)... (which doesnt seem to be working)..
Im sure I have it wired up wrong =(
alternately..once past the voltage divider.. I am un-sure if I need to use a resistor on each led.. or can I combine all negative leads and use 1 resistor for the total?
(to throw a wrench in all this.. but not needed.. I was hoping to maybe use different color leds too.. which of course reds/yellows have lower vF...I believe)..
anyways.. the voltage divider first I guess...
here is what I tried before posting:
I took the LEDs out of the picture.. until I can dial in the voltage.. (at least 'close enough'..doesnt need to be perfect)
using this simple code.. I watched the serial monitor:
//voltmeter tester/PLI
int voltagePin = 5;
int voltageVal = 0; // variable to store the value read
void setup()
{
Serial.begin(9600); // setup serial
}
void loop()
{
voltageVal = analogRead(voltagePin); // read the input pin
Serial.println(voltageVal); // debug value
}
if at 7.4v. I should be getting 1023..
and as I turn down lower.. the reading/output should also adjust (lower)..
however.. I dont get a change in the reading until I am under 5v+.. (which to me says the voltage divider is set up wrong)
as always.. I tried to read what I could (and understand).. and also give it a 'try' before asking to be spoon fed! lol
Thanks