TP4056 Li-ion Battery Charging Module Documentation
The TP4056 Li-ion Battery Charging Module is a compact and efficient charging solution for Li-ion batteries. It is a linear charging module that can charge a single-cell Li-ion battery with a maximum current of 1A. The module features overcharge protection, over-discharge protection, and short-circuit protection, ensuring safe and reliable charging.
The TP4056 Li-ion Battery Charging Module has the following pinout:
Vin: Input voltage (4.5V to 6V)
Vout: Output voltage (regulated to battery voltage)
Bat+: Positive terminal of the Li-ion battery
Bat-: Negative terminal of the Li-ion battery
Stat: Charging status indicator (High when charging, Low when charged)
Input voltage: 4.5V to 6V
Output voltage: Regulated to battery voltage (e.g., 3.7V for a 3.7V Li-ion battery)
Charging current: 1A maximum
Overcharge protection: 4.2V 1%
Over-discharge protection: 2.5V 1%
### Example 1: Basic Charging with Arduino
In this example, we will use an Arduino board to monitor the charging status of the Li-ion battery using the TP4056 charging module.
```cpp
const int statPin = 2; // Charging status indicator pin
void setup() {
pinMode(statPin, INPUT);
Serial.begin(9600);
}
void loop() {
int chargingStatus = digitalRead(statPin);
if (chargingStatus == HIGH) {
Serial.println("Charging...");
} else {
Serial.println("Fully Charged!");
}
delay(1000);
}
```
### Example 2: Charging with MicroPython (Raspberry Pi Pico)
In this example, we will use a Raspberry Pi Pico board with MicroPython to charge a Li-ion battery using the TP4056 charging module.
```python
import machine
import utime
stat_pin = machine.Pin(2, machine.Pin.IN)
while True:
if stat_pin.value():
print("Charging...")
else:
print("Fully Charged!")
utime.sleep(1)
```
Note: In both examples, ensure that the Vin pin of the TP4056 module is connected to a suitable power source (e.g., a USB port or a wall adapter), and the Bat+ and Bat- pins are connected to the Li-ion battery.