Battery Charger with Load Sharing + Current Sensor

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
Newbie friendly on the house?

I want to create a project where I can charge my Li-Po Battery (3.7v 1000mah) with a Load Sharing and detect when its low energy measuring its voltage with a current sensor INA219 in a ESP32 microcontroller.

I'm using a step down of 3.3v (LM2596) to power the ESP32, but also in doubt if should connect it directly in the 5v pin.

I'm really new and create this schematic and want to know how I should pass the battery to the sensor and measure its voltage level, its correct this way?

Sensor Schematic.png
 

bertus

Joined Apr 5, 2008
22,264
Hello,

I assume you want the current through Q1. Then you need a current sense resistor between pin 7 and 8 of the ina219.

Bertus
 

Irving

Joined Jan 30, 2016
3,794
If you're not using the current sensing, just voltage monitoring, then you need to connect both supply and load to V- only. Also your INA219 pinout is odd... ah, that's not the chip, that's a module... in which case the sense resistor is already present between V- and V+ and that will work as drawn.

You shouldn't use the chip part no. for a higher level module (similarly with your buck converter and charger) or add the word 'module' to avoid confusion.

Oh, and welcome to AAC!
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
Hello,

I assume you want the current through Q1. Then you need a current sense resistor between pin 7 and 8 of the ina219.

Bertus
Thank you.
The INA219 have a R100 shunt in the negative pin, I'm using this as reference:
INA219.png


If you're not using the current sensing, just voltage monitoring, then you need to connect both supply and load to V- only. Also your INA219 pinout is odd... ah, that's not the chip, that's a module... in which case the sense resistor is already present between V- and V+ and that will work as drawn.
Thank you, yes its the INA219 module.
Sorry, I dont have mencionted.
The shunt R100 is okay for 4.2v I assume.
 

Irving

Joined Jan 30, 2016
3,794
Thank you, yes its the INA219 module.
Sorry, I dont have mencionted.
The shunt R100 is okay for 4.2v I assume.
Yes, if all you're powering is the ESP32, you'll only lose about 0.05V across the shunt.

BTW 4.2v is the open circuit volts of a fully charged LIPO cell.. as soon as you start using it it'll be nearer 3.7V.
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
Hello,

Looking at the datasheet, there is no current sensing resistor inside the chip:
https://pdf1.alldatasheet.com/datasheet-pdf/view/540178/TI1/INA219.html

Have a look at fig 13 at page 9.

Bertus
Sorry, I forgot to mention its on the INA219 module.
My bad, new to this.

Yes, if all you're powering is the ESP32, you'll only lose about 0.05V across the shunt.

BTW 4.2v is the open circuit volts of a fully charged LIPO cell.. as soon as you start using it it'll be nearer 3.7V.
Thank you again for your time.
I have been told this step down converter (LM2596) have 1v drop out, so its not recomended to my 3.7 Battery, this information is correct?
If so, can I just plug it on the ESP32 5v pin with the load sharing (USB and the Li-po Battery)?
 
Last edited:

Irving

Joined Jan 30, 2016
3,794
I wouldn't use a LM2596 module for this, its spec'd minimum input volts is 4.5v. There are better 3-pin low-dropout 3.3v switching regulators that will work down to 3.6v or lower.
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
I wouldn't use a LM2596 module for this, its spec'd minimum input volts is 4.5v. There are better 3-pin low-dropout 3.3v switching regulators that will work down to 3.6v or lower.
All good, you guys are great, I know its not fun to deal with the new ones, so thanks again.
 

Irving

Joined Jan 30, 2016
3,794
If so, can I just plug it on the ESP32 5v pin with the load sharing (USB and the Li-po Battery)?
You could, but the 5v input goes through diode (0.3-0.5v drop) joins the USB 5v line on board then goes to the 3.3v reg onboard. Its only 4.5v into the reg, 3.7v in would only give 3.3v into the regulator.

The usual way to do this is to use a TP4056 charging module with built-in 3.7 -> 5v boost converter, then everything can run off 5v and you then can run the battery down to 3v if desired.
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
You could, but the 5v input goes through diode (0.3-0.5v drop) joins the USB 5v line on board then goes to the 3.3v reg onboard. Its only 4.5v into the reg, 3.7v in would only give 3.3v into the regulator.

The usual way to do this is to use a TP4056 charging module with built-in 3.7 -> 5v boost converter, then everything can run off 5v and you then can run the battery down to 3v if desired.
Thank you, Irving.

Only two more questions:
The MT3608 its good to 3.7 -> 5v conversion in this case?
I would replace it with the step down converter (LM2596) as in my schematic ou before the p-chan diode?
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
I would replace it with the step down converter (LM2596) as in my schematic ou before the p-chan diode?

Sorry dumb question, it would not trigger the diode gate if put it before.
 

Irving

Joined Jan 30, 2016
3,794
The MT3608 will do to boost from 3.x to 5v, then feed the Vin pin on the ESP32 board

Hmmm... are you using an ESP32 board or the bare SMD VROOM module? If the latter, then you need an external 3.3v regulator as the module only has 3.3v in.
 

Thread Starter

iptvbrazar

Joined Dec 2, 2023
8
The MT3608 will do to boost from 3.x to 5v, then feed the Vin pin on the ESP32 board

Hmmm... are you using an ESP32 board or the bare SMD VROOM module? If the latter, then you need an external 3.3v regulator as the module only has 3.3v in.
Thanks, I'm using a WROOM 32, have a microusb so it also has a 3.3v converter.

This is her schematic:
https://files.waveshare.com/upload/8/80/E-Paper_ESP32_Driver_Board_Schematic.pdf

You are the best human, have made this thread in other forums and not so good people like you, so thanks for your time.
 

Matt Traven

Joined Apr 17, 2018
12
I wouldn't use a LM2596 module for this, its spec'd minimum input volts is 4.5v. There are better 3-pin low-dropout 3.3v switching regulators that will work down to 3.6v or lower.
I'm working on a similar project, found your words in this thread helpful.

Any LDO's you recommend? My current selection is an mcp1700, but it might be a little low on power for my system. its been suggested I run 2 in parallel because higher current LDO's have higher drop out rates. That jive with you?

later in this thread, you suggested a different approach: bucking up to 5V & using the internal regulator on the MC to regulate back to 3.3v. In my mind, that approach seems more flexible & simpler to adapt to an existing plug in power supply system, but it also seems like it would be inherently less efficient ? having to buck up only to burn it off in a linear regulator?

you have any guidelines for when the LDO approach is better than the buck up or visa-versa?
 

Irving

Joined Jan 30, 2016
3,794
@Matt Traven At the risk of hijacking the thread I often run my ESP32s off a single 3.2v LFP cell using a TI TPS63001 boost/buck converter. This gives 800mA min output @ 3.3v from 2.4v - 5.5v input so works with all Lithium technologies (I only use LFP for safety reasons). Solar charging is handled separately, over-current discharge is not relevant for my usage as battery on-board PCB and under-voltage discharge is handled by ESP32 going into deep sleep if battery volts < 2.8v for general use. I did have some PCBs made to resemble a 3-pin 78xx regulator but I can't find them so I probably used them up as most of my designs now have this, or something very similar - like the even simpler to use Renesas ISL9120i (below) - on-board.

1705072224135.png1705072733984.png
 
Top