I have a "problem" while trying to measure the external voltage from a coin cell. I have simplified my circuit, but basically I have a DS1307 real time clock powered by the Arduino 5v output, and a coin cell connected to vBat to keep the clock alive while the Arduino is shutdown. My idea was to measure the battery level with Arduino by connecting its positive to an analog input and read the voltage level. So, I thought, as the max voltage is 3v, I can use the 3v3 as AREF and set analog reference to external and then read accurate results. The result is pretty cool and the readings from Arduino are the same as reading the battery voltage from my multimeter. The problem comes when I disconnect the source power from Arduino (an USB connection). For my surprise, the Arduino does not shutdown (some leds keep turned on), and seems to be powered by the 3V input (at the moment not a coin cell, but two AA batteries) connected to Analog pin.
Why is this happening? How is the Arduino taking current from the Analog Pin? Is this little circuit an electronic aberration?