4

I have a arduino pro micro 5V that I want to power with a 3.7V lipo. I also have a charging module to charge the lipo. (https://www.banggood.com/nl/TP4056-1A-Lipo-Battery-Charging-Board-Charger-Module-Mini-USB-Interface-p-1027027.html?rmmds=myorder&cur_warehouse=CN).

Battery without step up converter

I want to measure the battery level of the lipo.

  • Should I use a step up module to 5V? Battery with step up converter

  • How can I measure it? I read that you can't just use analogRead because the lipo itself is the reference.

Thanks in advance!

Robbe
  • 109
  • 1
  • 1
  • 7
  • Pro Micro uses the '32U4 processor? http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf Maximum Frequency – 8MHz at 2.7V - Industrial range – 16MHz at 4.5V - Industrial range - so you are operating out of spec with 16 MHz crysta;/resonator and 3.7V-4.2V LiPo battery. The '32U4 has a Selectable 2.56V ADC Reference Voltage, so you can use the Internal Aref voltage (vs the default External setting), divide down the battery voltage to be less than 2.56V max, and measure that way. Results may not be accurate if Vcc is < 5V with 16 Mhz clock. – CrossRoads Jan 02 '20 at 14:03
  • 1
    But if I use a step up converter and a voltage divider I should be able to measure it? How do I have to wire it? – Robbe Jan 02 '20 at 14:07

1 Answers1

1

The reference voltage for analogRead should be from the regulated 5V line, not from the unregulated input to the Arduino.

The real problem is that the voltage out of the battery will drop with current load. You're supposed to measure either the unloaded battery, or under a known, controlled load.

You ask "Should I use a step up module to 5V?" The answer is yes, but that's unrelated to your voltage measurement question. An Arduino requires a source of regulated 5V. The internal voltage regulator is a linear regulator that requires somewhat more than 5V as input (7.5V is about right.) You can't power the internal voltage regulator with a single 3.7V lipo battery. You'd need a step-up regulator, and with that, you could bypass the internal regulator on the Arduino (assuming your step-up regulator puts out 5V.)

Duncan C
  • 5,562
  • 3
  • 16
  • 28
  • But better is a step up to 7.5V then? – Robbe Jan 02 '20 at 13:46
  • No, there's no need for that. Step up to 5V, and then feed that into the 5V input of the Arduino. If you step up to 7.5V and feed that into the Arduino's VIN, it will just regulate the already-regulated 7.5V back down to 5V, turning 2.5v to heat. – Duncan C Jan 02 '20 at 14:59
  • On one of my projects I cut a USB cable and fed my regulated 5V into the USB input. That way you take advantage of the input switching circuitry on the Arduino. – Duncan C Jan 02 '20 at 15:01
  • 1
    So I step it up and feed it into the Vcc pin or the raw pin? – Robbe Jan 02 '20 at 15:16
  • Step up your lipo voltage to 5V, cut a USB cable (One with the square end that plugs into an Arduino), and feed the 5V into the red and black wires of the USB cable. Then plug that USB cable into your Arduino. When you do that it feeds the 5V into the Vcc pin, through a switching circuit that intelligently selects between power sources. – Duncan C Jan 02 '20 at 22:48
  • 1
    Why wouldn't I just feed it to the Vcc? I'm only using one power source. – Robbe Jan 02 '20 at 23:03
  • That's OK, until you forget to disconnect the power supply and hook up a USB cable to update your code and possibly fry the Arduino. – Duncan C Jan 02 '20 at 23:24
  • 1
    And then I connect the positive wire of the battery with a voltage divider to an analog input and I can measure it? – Robbe Jan 03 '20 at 10:21
  • Yes, although the variable load on the battery will cause the voltage to drop, throwing off your measurements. – Duncan C Jan 03 '20 at 13:01