I'm working through a book i found and am making a simple single cell battery tester, and i'm using analog pin 0 to read the voltage on the battery. The problem is that even when there is no battery between the pin and GND its still reading some voltage.
Also my LEDs are not blinking.
The input pin is floating - with nothing connected, it is acting like an antenna and picking up signals from the air - the input is that sensitive.
If you want to see 0, then add a 10K resistor from the pin to Gnd.
The 10k resistor worked great in terms of bring it to 0 and not reading random voltages, but for some reason it still not working right. i put in a battery that reads 1.62 volts on my meter but the arduino is reading 1.56.
That's also normal... you need to supply 5v exactly or there will be error...
So the easiest method is to change thd code from 5v / 1024 to what you actually have it might be 4.7v or 4.8v etc but when you use a multimeter to find out use that voltage instead of 5v