So I have a small single cell lithium-polymer battery (3.7 volts nominal) and I am trying to read the voltage level via analog in. measured with my multimeter (10Mohm input impedance) I find the voltage to be 3.8 volts. However using my arduino I find the voltage to be a tad over 4 volts. I am hoping it is the code I am using and not the arduino. The battery is 70mAH.
It does work some what because it shows a large voltage drop if i connect a load that draws a fair amount of current from it (small motor). Its just inaccurate.
There is a surprising amount of voltage drop in regular 24AWG hookup wire when it starts carrying current. Try to keep the wires from the battery to the Arduino as short as possible (both the positive and the negative wires). Connect to the Arduino ground pin close to the analog inputs. Use separate wires from the battery to the motor.
--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins
You also seem to have some funny average of 2 readings over 200mS going on? Am I reading that right?
Why not just read A0 twice and just use the 2nd reading?
it reads the analog pin like ~200 times. then every 200 milliseconds takes the average of all those readings and calculates actual volts. Its about 0.3v too high. I’m waiting for the battery to wear down somewhat to see if the 0.3 volts remains consistent. I suspect that it won’t.