I have (more than) a few project ideas for the Pi, and one of them involves being used in a portable form factor. Power would come from a set of rechargeable batteries that would run a small LCD screen and the Pi itself (as well as some interface peripherals). I haven't decided on battery chemistry yet - there are factors such as overall power draw of the system and ease of charging to consider - but I'm trying to get an idea of how I would go about measuring the current remaining battery power and displaying that information.
I've found a circuit that uses an LM3914 to drive an LED bargraph display that shows the remaining battery life. This looks like a great solution, but it has a couple of flaws that I can see:
- It is based on the voltage reducing over time as the charge level drops. I have read that some lithium-based battery technologies (lithium ion, lithium polymer, etc) do not do this - they may drop by a small amount, but typically the voltage curve is more or less flat until the point where the charge just "dies".
- This is a "hardware" based solution, in that it would be an LED mounted on a case. I'd prefer to report the remaining battery level in software; this circuit would work, but it's not my ideal solution. I have a fair idea how you could achieve this with an Arduino - resistor divider connected to an analogue input pin - which could be applied to the Pi GPIO pins. The real hard work would be calibrating it to a specific battery capacity. However, this is again based on the voltage level reducing over time as the charge level decreases.
Assuming that I have only the positive and ground connections of a battery, and no additional magical wizardry to monitor battery level, what is going to be the "best" way to report/monitor the battery level in software? Are there any more efficient or accurate solutions which I should consider? I ain't afraid of no soldering iron or schematic, but I'm afraid I'm at a bit of a loss when it comes to designing my own circuits.