1

I have a small module that charges 2S (8.4V) Li-ion batteries, by a DC 5V Input. It boosts the 5V input to the 8.4V needed for the 2S modules.

This module in particular, when no battery is attached, outputs 4.2V at the BAT+ and BAT- (GND), at it's idle state. When a battery module is attached it outputs the 8.4V and starts the charging protocol.

I want a MCU to "know" if a battery is attached or not, so I thought about using a 10k + 10k voltage divider between BAT+ and BAT-, and from the two resistors common point, add a wire to an MCU input, and sense the voltage by the MCU. If it's 4.2V, no battery attached. If it's more than that, a battery is attached.

Would this 10K + 10K voltage divider at BAT+ and BAT-(GND) interfere with the charging protocol? Is it safe to do that? Am I thinking right?

If it's possible, I read in this article below that it's possible to use two 10Mohms instead of two 10Kohms resistors in the voltage divider, adding a 0.1uF capacitor between the lower part of the divider (the input pin of the MCU and GND). The current draw would be 0.42uA if connected forever at the Bat's terminals. I don't need fast measurements. They'll be done once each 5 seconds.

Measuring battery without draining

If it's not the right way, is there another way for me to sense this voltage change without interfering with the charging process? I wanted few components, so two resistors seemed the simplest way.

Attached is a picture of the charging module and its Chinese datasheet

Charging Module

FM4256

Rodrigo
  • 467
  • 2
  • 8
  • You may also re-use the two LED pins to get further insight. Depends on the voltage there, but might give useful additional info about the charging process. – datenheim Feb 04 '23 at 18:30
  • I checked it (on the datsasheet) They only tell full charge, or charging. They don’t tell if the module is “on” but no battery is connected. – Rodrigo Feb 04 '23 at 18:32

1 Answers1

2

That's possible.

There might be one more issue. If your charger module is connected to battery for a long time with your divider resistors, the leakage current will make battery discharging quicker. You'd better to use big resistor values as much as possible.

Normally, ADC input resistance is more than 1Mohm. Thus, you can use 2 x 100Kohm resistors, to make leakage current smaller.

For production level designs, it's better to use dedicated battery gauge chips, which are quite cheap and widely available.

Some more advanced battery gauge chips use I2C communication. Not only detecting voltage, it will give remaining capacity correctly, as it accumulates charging/discharging currents over time.

Some example guage ICs:

IC LCSC PN Description
STC3100 C2969798 1s battery management IC with I2C interface
DS2781 C44627 1s or 2s battery management IC with Dallas 1-wire interface
MAX17048 C2682616 1s or 2s battery management IC with I2C interface
PCBCrew Engineer
  • 1,469
  • 1
  • 13
  • Thanks! I'll take a look at the ICs! I updated the question over using higher value resistors in the permanent voltage divider. What do you think about it? – Rodrigo Feb 04 '23 at 18:23
  • You're welcome!. Check this out: [Input impedance of Arduino Uno analog pins?](https://electronics.stackexchange.com/questions/67171/input-impedance-of-arduino-uno-analog-pins). If you use 10Mohm resistors, it may cause response time problem. – PCBCrew Engineer Feb 04 '23 at 18:29
  • @Rodrigo I recommend to use any of the internal ADC references (e.g. 2.56 V) and dimension the divider accordingly (270k / 100k). This makes the accuracy more unrelated from actual supply voltage. – datenheim Feb 04 '23 at 18:37