i’ve an Arduino pro Micro powered by 1S 3,7V Lipo Battery and I want to measure the voltage status of the battery through the pro micro and display this on serial monitor. What is the easiest way to do this measure this directly without voltage divider? Is this possible?
Sorry If this a noob question… Thanks for your help!
You can use the internal voltage reference of the ATmega328 to measure the battery voltage. The result needs to be calibrated, though, because the internal reference voltage has a fairly large manufacturing tolerance. http://jeelabs.org/2012/05/04/measuring … e-bandgap/
As your Vcc is a regulated 3.3 volt made from the raw pin, it doesn’t change as a the battery drops in voltage. Until the battery goes below 3.3 volt (plus any dropout voltage of the regulator). So no, this won’t work to get a meaning full battery state. You’ll measure a fixed voltage against another fixed voltage, so you’ll only get a static ratio (with a bit of noise). The method in the link by jremington works by measuring a fixed (internally generated) voltage against a variable ‘reference’ (equal to non-regulated battery supply voltage). So you would need to provide a fraction of the raw voltage as reference to the ADC instead. (Or bypass the linear regulator altogether if other hardware isn’t a dealbreaker, and make do with a varying Vcc) The AVR does have an external analog reference input pin. But improper connection and switching between reference settings might burn it. You must make use of a voltage divider to use this method. The RAW voltage must be reduced to be below the regulated Vcc. Make sure you read how to do it in the following Arduino page, as it explains how to select the value of an external resistor, to make a voltage divider using the already present internal resistance:
This guy (Julian Illet) has already had some experience with it and showed it in some of his youtube movies. He was quite impressed with it. (don’t forget his most recent post/mailbag episode, as he realized that he used it wrong initially)
I could recommend that you bypass the on-board regulator and put the LiPo into the Vcc pin. The 328p MCU won't mind and supposedly the caps on the regulator output are good for >5V, as the schematic indicates the same boards are used for the 5V and 3.3V versions of the Promicro. Only difference being a solder jumper. That would extend the useful battery life a bit as you won't have the regulator dropout voltage (only 0.1-0.2V) to contend with. Then you could use the scheme outlined by jremington.
OTOH maybe there’s other devices that are interfacing to the PM that won’t tolerate the LiPo’s voltage ? You haven’t given us a lot of information re: your system.
The Pro Micro uses a ATMega 32U4 not 328P. The Lipo Voltage range is from 4,2V to 3,xxV so I was afraid to attach the LIPO to VCC. Are you sure I won’t destroy my Arduino?
It would be great in if I could bypass the regulator this way…
The ATMega 32U4 has the same reference Voltage (1,1V) as ATMega 328,right?
My Setup:
-Arduino Pro Micro 3,3V ATMega 32U4
-Sharp Memory LCD from Adafruit which has an onboard regulator to 3V-> so no limitation using the LIPO on VCC pin, right?
-Ulimate GPS Breakout board or Chronodot as RTC → both run with 3-5V so no limitation using the LIPO on VCC pin, right?
You are correct sir ! And yet I still say the same thing. The schematic says the only difference is a solder jumper to bypass the 3.3V regulator. And the 32U4 datasheet says ...
While there may be parts binning to select those ICs that operate at higher speeds; low speed and a higher voltage is going to work.
Then again if you read the datasheet for the Micrel voltage regulator, there’s at most a 0.2V penalty in running the LiPo out into the PM’s raw input. LiPo’s discharge fairly rapidly below 3.3V. If you have a 3.3V peripheral talking to the PM … keep the regulator and deal with the voltage loss. If there’s no good reason to use 3.3V the run the system directly off of the LiPo.
I have similar requirements to the OP, although I’m not dismissing the idea of a voltage divider yet.
I am confused by some of the posts though.
Surely, if I connected the LiPo to RAW, and (if I understand correctly) Vcc then becomes a regulated 3.3V pin, then why can’t I use this as my reference. The Raw lipo voltage is dropping all the time, and Vcc is fixed. Seems like the basis for an ADC to me? I’d need a voltage divider to drop my fully charged lipo’s 4.2V down to my 3.3V reference, but if high resistance values are used for the voltage divider, I shouldn’t dissipate much power.
Am I missing something?
Also, from my use of Lipos in RC models, for long battery lifespan, you should try not to discharge below 3.3V anyway. (This may of course be different for low current draw applications)