# Optimized voltage divider for low power application?

Well, I'm (trying) to build a low power node which is powered by a tiny 80mAh NiMH battery pack which in turn is recharged (kept charged) by a small photovoltaic panel.

I want to measure the voltages at both panel and battery, so I'm thinking of using a couple of voltage dividers. Usually I wouldn't think too much on it and would just use a couple of resistors, that would divide the max Vin to the voltage at which my chip would be running.

In this case I intend to run an Atmega8 (if everything fits -- else atmega328p) at 3.3V...

hence 6.5V (max I read from the photocell) ---> 3.3V

and 4.35V (theoretical max of 3 NiMH in series) --> 3.3V

now, I'm not asking for that math (algebra) of resolving the equations, I'm asking for the REASONING of picking, say R1, the first resistor, or even if it's more important to choose R2 first (or indiferent).

All this taking into account that this is a low-power application where I'll periodically monitor the voltages, but don't want to waste a lot of current on that.

## Comment viewing options

I am not doing the math since it's all available: http://www.raltron.com/cust/tools/voltage_divider.asp and http://www.random-science-tools.com/electronics/divider.htm

That works on my Desktop Companion Bot quite good, reading the voltage from the divder and compare it with the reference voltage of the chip.

If you connect the voltage divider ground to an output instead, and only switch it to an output low when you need it and taking it high or hiZ when you don't will save lots of otherwise dropped power accross your voltage divider.

Yeah, I guess I did not quite think that one all the way through.... My bad.

So how are you protecting that output from being fried by voltages higher than Vcc?

Considering we are talking about saving a few microamps it's just not practical.

This is pretty easy although you should buy an LMR wall chart which has this sort of stuff on it.

The ratio of your resistors determines how much you divide the voltage (I suspect you know this) so in your cas, if both resistors are the same value then you will get half the input voltage at the junction. In your application this is perfect and will give maximum resolution.

By maximum resolution I mean the highest voltage you will read (6.5V) will be just under the 6.6V limit (3.3V x 2).

That's the ratio. As for the actual resistor value. You want that to be fairly high so the dividers don't waste power. For example you could use 2x 1K resistors but the maximum current draw would be 6.5V/2000=0.00325A or 3.25mA.

In this case the ADC inputs of the ATmega chips are very high and while the datasheet recomends 10KΩ or less since higher resistance values will slow down the charging of the sample hold circut. If you use 2x 10K resistors your maximum current will be 325μA.

From what I can tell from the datasheet, higher resistances can be used but will slow down the charging of the sample/hold capacitor so you could go higher (e.g. 100K or even 1M) but as your resistance gets higher you should add a capacitor between ground and the junction of the resistors.

The sample/hold capacitor in the ATmega analog input is only 14pF and your voltages are not fluctuating at high frequencies so add a 100nF (0.1uF) capacitor and then when the Atmega takes a measurement the sample hold capacitor will be chaged very quickly by the 100nF capacitor. This capacitor will also double as a noise filter.

It should also be noted that although the analog inputs cannot have an input voltage that exceeds the reference voltage, the high resistances used here (at least 10K) will limit current enough that the anti-static protection diodes in the ATmega can limit the voltage without being damaged. So if your solar cell does drift above 6.5V then no damage will be done.

Thanks, very compreensive explanation! In the meantime I had found somewhere suggesting using a resistor combo of 1M/470K with a 1uF for the internal reference of 1.1V. Since it done, I knew it would work, but now with your explanation I can understand a bit more of the why, which is was what I wanted :D

Actually, it might be Mac as well...

Download and install the Electrodroid app. It not only has everything you would ever need, it has an incredible voltage divider calculator. Will tell you amp draw and watts and just about every other resistor bridge calculation you could possibly need.