# Rough Battery (9V Alkaline) Level Estimation with Analogue Reading

I'm building a portable desktop weather station using an Arduino Nano micro-controller. The system is being powered by a consumer 9V alkaline battery, with the voltage being regulated by the Nano's on-board regulator.

I want to have a rough battery level displayed on the LCD screen.

The initial approach I have taken is by using a voltage divider which scales the input 9V to 3.3V. This signal is then input into to the Analogue IN (A6) of the Nano, ( AREF is set to 3.3V due to other analogue input device requirements).

From this I was assuming that ranges of voltage readings could correspond to FULL, HALF and LOW battery indications.

I understand that the battery terminal voltage will change with current draw. I expect a peak current draw of 350mA with a typical draw of about 100-150mA.

What is a good scheme/algorithm/cutoff values I should use to roughly measure battery level?

EDIT: -My Estimated power draw was wildly inaccurate. After measuring the current draw of the final device, consumption was approximately 30-40mA continuous, with rare peaks of 50mA.

-I ended up using a simple battery percentage using AnalogRead(). I calibrated a fresh battery to display ~90% by adding a fudge factor. It was fairly successful as a rough estimation.

• You have bigger problems - first, the whole scheme of using a linear regulator in a battery powered device is wasteful. But also, without a multi-stage enable circuit, the voltage divider you will need to read the battery level will itself drain the battery even when your MCU is sleeping at what should be microamp current. Oct 17, 2015 at 4:40
• A 9V alkaline is really 6 1.5V alkaline cells in series. You can discharge to, say, 1V per cell. But you don't want to draw 350 mA from a 9V alkaline cell. Not even 100 mA. Those batteries can't supply that much current for very long. Oct 17, 2015 at 4:51
• Oct 17, 2015 at 4:56
• If you use a linear regulator to bring the 9V to 3.3V at 50mA it will need to dissipate almost 285mW as heat while your circuit draws 165mW. Nov 4, 2015 at 15:23
• at 20mA that battery will not last a week. Feb 7, 2016 at 11:50

## 1 Answer

Expect 9V as a fresh battery, and about 6-7V as a dead battery (I guess you need 5V in your device, right?)

In case of a good battery, continous load shall not give you really different measurements. Of course, the battery voltage may drop by say, 0.1V, but it is really something you can ignore.

You may want to take into account the discharge curve of your battery to improve accuracy of power estimation: http://www.powerstream.com/9V-Alkaline-tests.htm This could be done by having a simple array converting measured voltage to expected % of remaining power.

I suggest you to code some histeresis, otherwise you will see your status bouncing between "full" and "half" states when the battery is nearly drained to half.

I agree with the other comments that a 9V battery has only one advantage: convenience. It is really not the best power source for your circuit, you may run your stuff from 3xD cells (4.5V connected right to the 5V rail, bypassing the LDO) for about 40-50 times longer than from a 9V battery.