I'm using one of these http://www.hobbyist.co.nz/?q=real_time_clock
When I attach the Battery Pin to an analog pin on an Uno, I can read the voltage of the battery. That's kind of cool.
The problem is, if you remove the power from the Uno, it seems like power drains from the RTC module to the Arduino, causing a significant voltage drop on the RTC device and thus 'loosing' it's time setting. (Voltage drops below 1v on the RTC device where it is normally closer to 3.3v)
I've reverted my project back to not monitoring the Battery Level, but it seems like there must be a way to do this: Allow monitoring of the battery level if and only if the Arduino has power. On power outage, prevent the battery from draining through the analog pin.
My first thoughts were to put a transistor between the pins such that the transistor was 'on' only when Arduino is powered and otherwise off.
Any other thoughts on how to handle this?