Measuring the amount of charge in batteries with Arduino

Hello!
I was thinking of building a simple Arduino project that displays the amount of charge in percent left in batteries (e.g. NiMH, 9V). Does anyone know how to determine the amount (percent) of charge left in a battery, what is considered "low battery" for as many types of batteries as possible? Where can I find the chart for the amount of current capability versus the voltage of each type of battery? Also, the Arduino has a method of measuring its Vcc. At what voltage would the working voltage (Vcc) be "to low" for normal operation?
Thanks!

For alkaline batteries, the voltage goes down as the battery is depleted. In general, Nimh/li-on/lithium batteries charge stays roughly the same until the battery is nearly completed. This makes measuring the charge level much harder. The site http://batteryuniversity.com/ and its companion book (Batteries in a Portable World, http://batteryuniversity.com/buy/) offer lots of information about batteries.

li-on/lithium batteries charge stays roughly the same until the battery is nearly completed.

While true for Nimh and nicads, I disagree on this about Li cells. A fully charged Li cell will have a 4.2vdc voltage and pretty linearly decrease to around 3.0vdc for fully discharged. So in the case of Li cells, terminal voltage is a decent relative indicator of state of charge. To have a truly accurate state of charge measurement one needs to measure current being delivered to the load and integrate the value over time until it matches MAH rating of the cell.

Lefty

retrolefty:
li-on/lithium batteries charge stays roughly the same until the battery is nearly completed.

While true for Nimh and nicads, I disagree on this about Li cells.

Ok, I was thinking of nimh and nicads, and I though the graph looked rather flat for Li (at batteryuniversity), but in looking at it, it does slope down, but perhaps not as much as alkalines.

There are a gazillion websites that talk about battery chemistry. You should really
do a little background research before going too far.

For NiMH, the discharge curves are pretty flat until the endpoints, so it's difficult to
know exactly how much charge is left in them by simply measuring the voltage in
general, but when the cell voltage gets down to 1V, it's falling fast, and they're
pretty well gone, gone, gone.

I have a question: does the Secret Arduino Voltmeter measuring the actual voltage inputted into the Arduino, or the working voltage?

P.S. I have not been on the forum for a long time.