Stufin
Home Quick Cart Profile

TP4056 Li-ion Battery Charging Module

Buy Now

Pin Configuration

  • TP4056 Li-ion Battery Charging Module Documentation
  • Pinout Explanation:
  • The TP4056 Li-ion Battery Charging Module has 5 pins, which are labeled as follows:
  • Pin 1: IN+ (Input Positive)
  • Function: Positive input voltage to the module
  • Description: Connect to a DC power source (e.g., a USB port, wall adapter, or solar panel) that supplies the charging voltage to the battery.
  • Typical Voltage Range: 4.5V to 8V (dc)
  • Pin 2: IN- (Input Negative)
  • Function: Negative input voltage to the module
  • Description: Connect to the negative terminal of the DC power source.
  • Typical Voltage Range: 0V (dc)
  • Pin 3: B+ (Battery Positive)
  • Function: Positive terminal of the battery being charged
  • Description: Connect to the positive terminal of the Li-ion battery.
  • Typical Voltage Range: Depends on the battery type and nominal voltage (e.g., 3.7V for a standard Li-ion battery)
  • Pin 4: B- (Battery Negative)
  • Function: Negative terminal of the battery being charged
  • Description: Connect to the negative terminal of the Li-ion battery.
  • Typical Voltage Range: 0V (dc)
  • Pin 5: OUT (Charge Status Indicator)
  • Function: Output pin that indicates the charging status
  • Description: Connect to a LED, resistor, or a microcontroller to monitor the charging status.
  • Typical Voltage Range: 0V (dc) when charging, 5V (dc) when fully charged
  • Connection Structure:
  • To connect the TP4056 Li-ion Battery Charging Module:
  • 1. Connect the positive terminal of the DC power source (e.g., USB port) to IN+ (Pin 1).
  • 2. Connect the negative terminal of the DC power source to IN- (Pin 2).
  • 3. Connect the positive terminal of the Li-ion battery to B+ (Pin 3).
  • 4. Connect the negative terminal of the Li-ion battery to B- (Pin 4).
  • 5. Optionally, connect a LED and resistor in series to OUT (Pin 5) to indicate the charging status.
  • When the battery is charging, the OUT pin will be at 0V, and the LED will be off.
  • When the battery is fully charged, the OUT pin will be at 5V, and the LED will be on.
  • Important Notes:
  • The TP4056 module has a built-in overcharge protection, short-circuit protection, and over-discharge protection to ensure safe charging and discharging of the Li-ion battery.
  • Make sure to use the correct polarity when connecting the battery and power source to the module.
  • Always follow proper safety precautions when working with batteries and electrical components.

Code Examples

TP4056 Li-ion Battery Charging Module Documentation
Overview
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.
Pinout
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)
Specifications
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%
Code Examples
### 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.