I have an Arduino which is being powered by a battery. I would like to monitor the charge level of this battery. Normally, this is very easy, just check the voltage across the disconnected battery's + and - terminals and then use an appropriate comparison table to find out what % of charge this voltage corresponds to. I can easily measure voltage with the analog pin on the Arduino, but there is an obvious problem: The Arduino is powered by this very same battery I am trying to measure, which will throw off the readings.
So, how can I handle this?