One problem with this circuit is that you must disconnect the load
when charging the battery (although a lot of circuits don't do this). The reason is that the charging circuit detects when the
charge rate falls below C/10 (Constant current charge mode near the
end of the charging cycle). C is the battery capacity in mAh.
If you have a load connected to the battery then this will change the
current detected so the TP4056 may never terminate the charging
process!
For circuits that don't disconnect the load - they probably work
because the charging load is low enough not to pull down the voltage at
the battery.
For high loads it will definitely stop the charge cut off as C/10 will never be reached.
Using 3 Components to achieve safe charging
A way around this problem is to use a switching circuit employing a
P Channel MOSFET - this is sometimes called load sharing or automatic
power path control. it is a controlled switch that automatically disconnects the
battery when external power is applied.
The idea is that when a power source is connected to the
Battery charger chip, the PMOSFET disconnects the battery from the load.
The TP4056 still charges the battery but without a load (the PMOSFET isolates the load from the power source). Power to the
load is supplied from the power source directly through a diode.
When the power source is disconnected, the PMOSFET is turned on connecting the load to the battery.
With this configuration the TP4056 can safely charge the battery with
the load connected, as the battery is isolated from the load during
external power application.
PMOSFET power Sharing
The following diagrams show how the PMOSFET is used for power sharing.
To turn ON the PMOSFET, the Gate must be negative (<VGS(th)) w.r.t the Source.
To turn OFF the PMOSFET, the Gate must higher than VGS(th) w.r.t the Source.
Note: VGS(th) is the threshold voltage of the MOSFET.
PMOSFET ON (Just the battery)
There is no input voltage to the charger circuit or the MOSFET. Here the gate of Q1 is low (pulled down by RPULL) and the PMOSFET is on, so current flows from the battery to the load.
[Source: Microchip application note AN1149]
To see what is going on here start with the battery with no external power supplied:
State of D1 No Input Power
When the battery is connected to the circuit, the parasitic diode (of
Q1) is forward biased and Vbat-0.6V appears at the negative side of D1.
Since the other side of D1 is pulled to ground D1 is reversed biased so
no current flows through it. So it can be ignored (except for leakage
current = small so ignore anyway - but some Schottky diodes may leak a lot requiring lower RPULL).
State of Q1 No Input Power
The cathode of D1 is also connected to the Source of Q1. The gate of Q1 is also pulled to Ground by Rpull. So VGS is "0 - (Vbat-0.4V)" = -(Vbat-0.4V). Vbat is between 2.9V and 4.2V.
As long as VGS
is more negative than the Gate Threshold voltage of Q1 (VGS(TH)), Q1 is on and
conducts current between the Drain and the Source.
So the Gate to Source threshold
voltage of Q1 (VGS(TH)) must be better than:
-(2.9-0.4) = - 2.5V
Where 2.9V is the lowest Vbatt voltage, and 0.4V is the Schottky diode
drop The voltage -2.5V is the lowest to turn Q1 on. You can select a
higher voltage threshold (VGS(TH)) by choosing the right
PMOSFET.
So choose a PMOSFET with VGS(TH) bigger than -2.5V
i.e. any VGS(TH) betwen -2.4V and 0V. Typically -1.3V is good. (See the table below of suitable PMOSFETS).
Note: The TP4056 will trickle charge a very deeply discharged battery
where Vbat is< 2.9V until it reaches that 2.9V so you will want a
threshold voltage better than -2.3V. e.g. -1.0 ~ -1.5 would be good.
Once Q1 is on the parasitic diode is bypassed and Vbat is connected to the load via the internal resistance of Q1 (RDS).
Note: RDS is an
important parameter here - it's the internal resistance of the PMOSFET
from Drain to source i.e. the internal resistance of the MOSFET.
As more current is drawn by the load, more voltage is dropped across RDS.
So the output voltage at the load is dependent on the current drawn by the load.
Lower RDS gives higher output voltage.
PMOSFET OFF (Power source connected)
[Source: Microchip application note AN1149]
Here the gate of Q1is high and the PMOSFET is off. so the
battery is isolated from the load. The power source drives current
through the Schottky diode (D1) to the load. At the same time, the battery is charged but in isolation from the load.
VG = VIN
VGS = VPOWER - VD1FV
Conditions for the PMOSFET to be OFF are:
The Gate is higher voltage than the Source : Vgs > VGS(TH) i.e. more positive.
Since the Gate is equal to Vin (~5V) and the diode drops 0.4V, Vgs is positive by 0.4V, therefore the MOSFET is off.
You would probably want to avoid the higher RDS(ON) device as
you loose volts when drawing more current and it dissipates power
(Pdiss in the table is the maximum it can dissipate).
However the MOSFET dissipation will be low e.g for the worst case
resistance of 270e-3Ohms. Power dissipated, assuming 1A is Pfet =
sqr(i)*R = 1x270e-3 = 270mW i.e. very small. The voltage will drop by
270mV so the smaller Rds gives a better output (higher voltage).
Example of a Schottky Diode
MBRS130LT3: Forward voltage drop of 0.395V (max for 1A and @ 25°C).
Note: The Schottky diode will heat up when the charger is externally
powered. The Power used depends on the load attached to the output - current through it and voltage drop across it.
An alternative to the Schottky diode is to use the 2nd PMOSFET in the IRF7329 above to
replace the diode. This would need controlling using a microcontroller
or using the status outputs of the TP4056 (see the LTC4056 datasheet -
which is a different chip but provides a design reference).
How to use the TP4056 TEMP control Input
Although the TEMP input is not used on most breakout boards, it can be
used to disable charging of a battery when it reaches low or high
internal temperatures. This is an important safety feature when the
ambient temperature is below 10°C or above 45°C.
The diagram below (from the datasheet) shows use of the TEMP input with a
battery that includes a NTC (Negative Temperature Coefficient)
Thermistor:
The TEMP input is used to disable charging if the internal battery
temperature becomes too high or too low. It is usually grounded at the
chip pin on breakout board.
Using this input in your own designs ensures safer charging but you need
a battery with an internal thermistor. The TP4056 can then shut down
charging if the temperature inside the battery becomes too high or too
low.
Working out R1 and R2 for the TP4056
R1 and R2 are not specified in the datasheet so you have to work these
out based on the thermistor specification in your specific battery. From
the datasheet:
" If TEMP pin's voltage is below 45% or above 80% of supply voltage VIN for more than 0.15S, this means that battery's temperature is too high or too low, charging is suspended. " [ source TP4056 Datasheet ]
Note: Use these calculations at your own risk. Also you must use the
battery manufacturer's data on the thermistor for operational use. Also
other standards suggest charging at even tighter temperature limits.
Temperature Limit Design Calculations
Assumption:
The battery's internal NTC thermistor reads 10k at 25°C and
has a Beta value of 3950 (this is for a type MF52 thermistor).
Note: You can charge outside
these temperatures ( 5°C ~ 45°C ) but with a more complex chip than the
TP4056, one that reduces charge/voltage at outside these temperatures
but never charge below 0°C.
For 45°C the thermistor resistance is about 4k2.
For 5°C the thermistor resistance is about 26k.
Warning: This is just an example calculation. Always use the battery
manufacturer data sheet for the thermistor inside the battery to ensure correct operation.
If Vtemp is below 45% of the supply (hotter) or above 80% of the supply
(colder), this indicates an out of temperature condition. For an NTC
thermistor, its resistance falls with increased temperature.
You can see that R1 is pulled high and R2 is pulled low and and they connect to one side of RNTC. The other side of RNTC is attached to ground.
So R2 is in parallel with RNTC. This parallel resistance forms the lower half of a voltage divider with R1. As temperature increases so RNTC falls pulling the TEMP input voltage down.
The trick is to select resistors that give you the correct %output when RNTC changes resistance at specific temperatures.
It can be a bit tricky selecting the correct resistors but remember the
battery will heat up as current is drawn so the most important
parameter is the high temperature cut off. You want to stop charging
above 45°C (low NTC thermistor value).
You can scratch your head trying to figure out algorithms for a while as
there are three variables to change and with two set points to get
right. But an easier way is to write a program for a brute force method.
Using the above equations in the program and stepping through resistance
values from 100 to 250e3 with 100R steps and using the following input
values gives quite a few output results. This one seems quite good.
Found 4900 86200 Ratio1 0.450 Ratio2 0.803
The closest Standard resistors (E48) are:
(E48) R2 = 86600
(E48) R1 = 4870
These standard values result in the following ratios:
These will stop the TP4056 charging below 5°C and above 45°C (approx).
Note: Remember to account for resistor tolerance and thermistor accuracy.
Program to calculate Ratios
This is a tcl program. You can download (the completely free) tcl language at Activestate.com.
# Inputs for MF52 (B=3950)
set vratio1 0.45
set vratio2 0.80
set ratio_tol1 0.01
set ratio_tol2 0.05
set Rntc_min 4.2e3
set Rntc_max 26e3
# Stepping controls
set tpPriv(step) 100 ;# Step size
set tpPriv(startR) 100 ;#Step start
set tpPriv(maxR1R2) 250e3 ;# Step end
set tpPriv(stop) 0
console show
################################################################
proc get_ratio { Rntc r1 r2 } {
set Rpara [expr { ( 1.0* $Rntc * $r2 )/( $Rntc + $r2)} ]
set Vratio [expr { ( 1.0* $Rpara )/( $Rpara + $r1)} ]
return $Vratio
}
################################################################
proc within_tol {num val tol} {
if {$num >= ($val-$tol) && $num <= ($val+$tol)} {return 1}
return 0
}
################################################################
proc testTP4056Temp {Rntc1 Rntc2 Ratio1 Ratio2 tol1 tol2} {
global tpPriv
set op {}
set tpPriv(found) 0
for {set r1 $tpPriv(startR)} {$r1<$tpPriv(maxR1R2)} {incr r1 $tpPriv(step)} {
puts "$r1" ; update
for {set r2 $tpPriv(startR)} {$r2<$tpPriv(maxR1R2)} {incr r2 $tpPriv(step)} {
set VratioCalc1 [ get_ratio $Rntc1 $r1 $r2]
if { [within_tol $VratioCalc1 $Ratio1 $tol1] } { ;# if this is ok check the other ratio
set VratioCalc2 [ get_ratio $Rntc2 $r1 $r2]
if { [within_tol $VratioCalc2 $Ratio2 $tol2] } {
set frat1 [format "%2.3f" $VratioCalc1]
set frat2 [format "%2.3f" $VratioCalc2]
puts "Found $r1 $r2 Ratio1 $frat1 Ratio2 $frat2" ; update
lappend op "Found $r1 $r2 Ratio1 $frat1 Ratio2 $frat2\n"
incr tpPriv(found)
}
}
if {$tpPriv(stop)} {break}
}
if {$tpPriv(stop)} {break}
}
set fh [open op.txt w]
puts $fh [ join $op ]
close $fh
}
proc stop {} {set ::tpPriv(stop) 1}
pack [ button .b -text Stop -command stop ]
testTP4056Temp $Rntc_min $Rntc_max $vratio1 $vratio2 $ratio_tol1 $ratio_tol2
puts "\nFound: $tpPriv(found)\n\n"
Conclusions
The TP4056 is designed for charging control of a Lithium Ion/Poly
battery pack that you charge at home, and take out with you, just in case
you run out of charge when you are out.
Note: The DW01A only provides current limit protection (when the TP4056 is powered using 5V at the VCC pin). See here.
When the TP4056 chip is not powered, the DW01A can
prevent deep discharge of the battery - it disconnects the ground line
from your external circuit if it detects that the battery voltage is too
low.
For this battery pack you attach a cable at home from the charger
socket (Flat USB) to the micro USB socket of the battery pack.
You then wait until it has charged and remove the charging cable. When
you are out and about, you plug in the Flat USB cable to the battery
pack and from there to your phone's micro-USB socket (or whatever your
phone uses) to charge the phone.
Notice that you never both charge the battery pack and charge the
phone from the battery pack. You always charge the phone directly from
the charger socket at home and you can't charge the battery pack when
you are out.
This is the exact problem the TP4056 was designed to solve and it
should not both charge a battery AND power
a load (phone or circuit) at the same time. That is why adding the PMOSFET, Schottky diode, and
resistor makes it safe to use.
However, I have never heard of any problems in using the breakout
board as it is commonly used - as a charger and power source at the same
time. But it is far safer to tack on three components as discussed in
this page.
Update on this
Actually here is a link that shows the problem - at high loads the TP4056 charger can not complete charging as discussed in this page.
P.S. If I was designing this in a commercial setting, I would
definitely add these components - Would not want to be blamed for the
consequences!
How to get accurate DHT22 digital humidity sensor readings with an Arduino. Did you know it also measures temperature as Well? Find out why, in this page...
A PIR sensor lets your Arduino sense movement without contact. This tutorial covers PIR sensor basics, connecting one to an Arduino board and coding a motion detector.
Arduino Hall Effect Sensor: Add magnetic sensing superpowers to your Arduino projects with an easy-to-use hall effect sensor. With full code and layout...
Comments
Have your say about what you just read! Leave me a comment in the box below.
Don’t see the comments box? Log in to your Facebook account, give Facebook consent, then return to this page and refresh it.