Quote Originally Posted by lerameur View Post
HI I did the test , as I suspected, I get 0.7v all the time. So I caould put a few in a row to get a higher voltage difference and use that as a reference voltage.
You could, but those diodes will vary in voltage with time, temperature, current flow, moon phases, etc, not by much, but they will change over time and temperature at least, and in series, they'd do nothing but get worse. Therefore, you're battery voltage reading will change accordingly, and probably screw you up in the long run. And you have to have X amount of current to even get the diodes to conduct. You might end up using more power than you would really want to just to get a reading.

Have you been able to get the A/D working yet?
Like I said, spare pin to a resistor (probably 1K or so), other side of resistor to non-banded side of diode, banded side of diode to ground. Tap the non-banded side to your A/D port and take some readings with the battery hooked up as normal and A/D converter set up with Vref+ at Vdd and Vref- at Vss. If you're using the 10bit A/D, you should get a reading arorund 150-ish. Then as the battery wears down, the reading will go up. A reading of roughly 200 will mean a dead battery.

And, you can save the power to read the battery by change that 'spare pin' mentioned above to an input and shutting off the A/D module.