How to Limit voltage and read battery percentage

I am using a 11.1v lipo to power a Arduino nano and I want to read battery percentage on one of the pins. I was trying to use a 12v zener to clamp any voltage above 12 and feed it to a voltage devider circuit using 100k & 68k resistors. With 12v in and devider circuit should give me 4.85v at the Arduino pin.

What is the best way to keep the voltage from going over 12v with a freshly charged battery?

Hello Kevin,

First of all the maximum voltage of the nano is 20 Volt, 12 Volt is the recommended max voltage, as you can see in this datasheet.

Datasheet Arduino Nano

Then my next question, do you really need the battery voltage to be read in to your arduino, or would it also be ok for you to just have a little meter showing the percentile voltage of your battery? There are allot of different meters sold that will do just what you want, and they are pretty cheap. If however you really want it to be connected to an arduino pin I think your idea with the two resistors is pretty good.

With regards,

Mike

KevinRoach:
I was trying to use a 12v zener to clamp any voltage above 12 and feed it to a voltage devider circuit

Your circuit should have looked a bit like this then:

Diagram:
ZenerLimit.png

In which case it would be Ok.

Yours,
TonyWilk

ZenerLimit.png

Mikeb1970:
Hello Kevin,

First of all the maximum voltage of the nano is 20 Volt, 12 Volt is the recommended max voltage, as you can see in this datasheet.

Datasheet Arduino Nano

Then my next question, do you really need the battery voltage to be read in to your arduino, or would it also be ok for you to just have a little meter showing the percentile voltage of your battery? There are allot of different meters sold that will do just what you want, and they are pretty cheap. If however you really want it to be connected to an arduino pin I think your idea with the two resistors is pretty good.

With regards,

Mike

Mike, I just wanted the battery indication on the screen and not have to add an extra meter. Might as well use the extra pin or pins since they are there.

TonyWilk:
Your circuit should have looked a bit like this then:

Diagram:
ZenerLimit.png

In which case it would be Ok.

Yours,
TonyWilk

Tony, Yes you are correct on the diagram. For some reason I cant get my 12v zener to work correctly. I have calculated the current limiting resistor etc. Just doesn't seem like it wants to clamp and stay at 12v and gets hot just at 12.5 input. I have tried it with and without a load.

I mainly want this for over voltage protection to the voltage divider and arduino pin.

Of course Kevin, I agree with you. It's sometimes difficult if you answer a question here to fully understand what the person wants and how big their knowledge is. Your knowledge is clearly above average here. Have fun with this and other future projects.

Sincerely,

Mike

Just doesn't seem like it wants to clamp and stay at 12v and gets hot just at 12.5 input.

So what is the value of R1? Yes zeners get hot when they dissipate power. They also do not clamp at a steady voltage like you think it does.

KevinRoach:
I mainly want this for over voltage protection to the voltage divider and arduino pin.

Zeners are generally a poor solution. Voltage compression near the knee-point, and thermal drift.
Better to use a voltage divider to ~1volt, and use the internal 1.1volt Aref in code.
With 10k from pin to ground and 120k from pin to battery, you can have ~70volt on the divider before the pin reaches 5.5volt.
I would also add a 100n cap from pin to ground for stability.

I would worry more about powering the Nano from 12.6volt.
You can't draw very little current from the 5volt or 3.3volt pin at that voltage before you overheat the 5volt regulator.
Leo..

[u]Over-voltage protection circuits[/u].

But.. with those high resistance values in your voltage divider you should be able to get-by without it. There are protection diodes built-into the ATmega chip. I'm not sure what the current rating is for those internal diodes but with 68K & 100K to limit the current I'm pretty sure you'll be OK.

Tony, Yes you are correct on the diagram. For some reason I cant get my 12v zener to work correctly. I have calculated the current limiting resistor etc.

If the Zener is getting hot, the resistance (R1) is too low. And of course that heat energy is coming from the battery...

Just doesn't seem like it wants to clamp and stay at 12v and gets hot just at 12.5 input.

That's normal. Zeners are not "perfect". There is a "knee" that's not perfectly sharp. As you reach the Zener voltage it begins to conduct (the resistance drops dramatically) but it doesn't suddenly switch-on to zero resistance. A higher value for R1 will bring-down the voltage.

Note that below the Zener voltage, R1 adds to the "top" resistance in the voltage divider.

I am using a 11.1v lipo to power a Arduino nano and I want to read battery percentage on one of the pins.

Just remember - The discharge is not linear. It's not half-voltage at half-life. An ideal battery would be like a gas tank... Your car doesn't slow down when you get low on gas... The curves I've seen show a rapid discharge at the beginning, then it levels-off to some extent, then it discharges quickly again near the end of its life. And, the Zener is going to make your readings it even more non-linear. (And, a battery is considered "dead" below something like 70% of its rated voltage.)

Hello again Kevin,

If I read what has been said and suggested sofar on your project one must admit there wasn't much progress made, each solution presented had a serious drawback. Therefore, If I may I would like to present a solution from a different angle. I have no doubt some people will point out some drawback of my solution, we will see. How about reducing the battery voltage from it's, at full charge 12+ Volts with a buck converter to 7.5-8 Volt, this way the built in 7805 on the arduino has no problem providing a stable 5 Volt, yet reducing the power dissipation and the heat coming with it. I would suggest using this Buck converter.

Buck Converter

And, a battery is considered "dead" below something like 70% of its rated voltage

This is what Doug said, and it's true, if you look at the diagram of a LiPo, hence me going back to my previous suggestion and using a simple battery meter, but since you said to me you liked to use your extra free pin, we could do this differently. If you do some math your Lipo should be "dead" at around 7.8 Volt and full somewhere above 12 Volt. If you use the voltage divider you made with a resistor of 100K and 68K you could easily connect the voltage divider point to your pin and calculate how much % you approx have left. Based on previous experience I'm sure your able to tweak your software for this to be more accurate.

Hoping this will give you another option you could consider and with regards,

Mike

What do you guys think of just using a small regulator like the 78L12 100ma to regulate any voltage over 12v? Then I can monitor the voltage divider for less than 12v.

KevinRoach:
I am using a 11.1v lipo to power a Arduino nano and I want to read battery percentage on one of the pins. I was trying to use a 12v zener to clamp any voltage above 12 and feed it to a voltage devider circuit using 100k & 68k resistors. With 12v in and devider circuit should give me 4.85v at the Arduino pin.

What is the best way to keep the voltage from going over 12v with a freshly charged battery?

Why limit the voltage - you want to arrange that the divider can handle the maximum voltage meaningfully. Use, say, 160k upper and 100k||100nF for the lower divider arm. With a high resistance divider the capacitor will keep the value stable during ADC reads. || means "in parallel with". The arduino ADC only gives reliably
accurate results with low impedance sources (10k or below), as the ADC sample/hold capacitor has to charge up
from the source in microseconds.

BTW putting a 12V zener across a fully charged LiPo sounds like a very simple way to vaporize a zener to me - no current limit except the LiPo, which deliver dozens of amps effortlessly.

The upper arm of the resistive divider already protects the Arduino from over voltage adequately since the fault currents are reduced to microamps should the battery voltage rise to 15V even, and even the smallest input protection diode can handle that level of current.

How can I calculate current drop to the Arduino pin in a voltage divider circuit? I tried looking it up and I am not able to find it anywhere. I somewhat understand Ohms law but I guess I can't think that one through since there may not be any current draw from the Arduino.

The battery max charge for the 11.1v lipo has been 12.58. With the 100k & 68k voltage divider it is good up to 13v.

What is the max voltage etc. on a Arduino pin?

Thanks,
Kevin

KevinRoach:
How can I calculate current drop to the Arduino pin in a voltage divider circuit? I tried looking it up and I am not able to find it anywhere. I somewhat understand Ohms law but I guess I can't think that one through since there may not be any current draw from the Arduino.

The Atmel datasheet gives a figure of 100Mohm for the analog input resistance.

The battery max charge for the 11.1v lipo has been 12.58. With the 100k & 68k voltage divider it is good up to 13v.

Why not simply use 100k & 47k, that'd be well fine at 15.6v giving 4.98v. Plenty of safety room.
ADC steps would measure 0.015v over the 15.6v range.

What is the max voltage etc. on a Arduino pin?

If it's a 5v arduino, then it's 5v.
The datasheet says Absolute Maximum of Vcc + 0.5v Just don't go there.

Do not, ever, even consider using the internal protection diodes to limit voltage into a pin. They are not fully characterised, it is really bad practice and in industry if you suggested such a thing, the other guy would get the job.

I know Atmel did publish a horrid app.note (which seems to have been unlinked?) using the prot.diodes to limit voltage from MAINS thru a 1M resistor... I think it was some engineer's bad joke.

Yours,
TonyWilk