1

There are of course a lot of different battery charging boards, which can be used with the Arduino, most being TP4056 based. There are also a few battery charged boards with an on-board display showing the charge status and there are of course also a lot of programmable battery charger controllers (ICs) with status and control interfaces.

But is there any board available, not just the 'raw' IC, using a charging controller with a status interface, which allows access to the status interface from pins on the board? I can't seem to find anything.

For a battery powered Arduino project I am planning, it could at least be very convenient if I could query the battery charging status from software.

2
  • You could probably solder some wires to the status leds.
    – Gerben
    May 11, 2019 at 14:56
  • @Gerben Most of the charger boards don't even have status leds. I do however need more precision than just something like 'full' and 'almost empty'.
    – jarnbjo
    May 11, 2019 at 15:20

2 Answers 2

2

I know it's been asked quite long time ago, but still. This is how would have I done the same, with the existing TP4056:

  1. use an electric key in a form of mosfet transistor, controlled by digital output pin to disconnect your battery from the charging board once in a while (like every 5-10 minutes or so, depending on your project power drain) for a very short period of time to do the measurement below.

  2. while the battery is disconnected, use an analog input pin of arduino with resistor-based voltage divider to see what's your battery voltage. Google for "measure voltage with arduino alone" for schemas and code, it's pretty straightforward.

For obvious reasons, you cannot do this measurement while having your charging board connected to battery, because you'll be getting voltage from the charger, and not from your battery. This is why we disconnected battery from the charging circuit in step 1.

  1. Knowing
  • current voltage you just get from your battery
  • what is the voltage should be on your battery when it's fully charged
  • the voltage you allow it to discharge to ... you can calculate percentages
  1. digitalWrite to that pin to enable mosfet to connect your battery back to charging circuit
0

You might consider a coulomb counter IC, it is designed to give you the state of charge of the battery. There is a module labeled "LTC4150 Coulomb Counter" that will do exactly what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.