Lithium-ion batteries (such as standard 18650 cells) require precise charge termination at 4.2V to maintain safety and lifespan. Overcharging Li-ion cells can lead to reduced cycle life or dangerous thermal issues. This DIY project demonstrates how to build an automatic charging cut-off circuit utilizing the LM358 operational amplifier as a voltage comparator, a 3V Zener diode reference, and a BD140 PNP transistor acting as a high-side electronic switch.
When charging, a red LED illuminates. Once the battery reaches 4.2V, the comparator flips, switching off the BD140 transistor to cut off current immediately, while turning on a green LED to signify charging completion.
Bill of Materials (BOM) & ToolsBelow is the detailed plain text hardware listing for this project:
- Integrated Circuit: LM358 Dual Operational Amplifier DIP-8 (1x)
- Transistor: BD140PNP Power Transistor (1x)
- Zener Diode: 3.0V Zener Diode (with black ring marking negative/cathode) (1x)
- Potentiometer: 10kΩ Blue Precision Multi-turn Potentiometer / Trimmer (1x)
- Resistors (1/4W Through-Hole):
- - 100kΩ Resistor (1x) - Hysteresis feedback loop
- - 1kΩ Resistors (4x) - Zener current limiting, voltage divider sampling, transistor base limit, green LED limit
- - 470Ω Resistor (1x) - Indicator branch current setting
- - 100Ω Resistor (1x) - Red LED current limiting
- LED Indicators: 5mm Red LED (Charging) (1x), 5mm Green LED (Full/Complete) (1x)
- Connectors & Holders: Single 18650 3.7V Battery Holder (1x), 2-Pin Screw Terminal Block (5V Power Input) (1x)
- Prototyping & Tools: Pref-board / PCB, Soldering Iron & Solder, 5V DC Power Supply, Digital Multimeter
Place the LM358 IC onto the prototyping board. The LM358 serves as the core voltage comparator monitoring the battery level in real time.
Note the orientation notch on the chip body before soldering; reversing the IC will cause circuit failure.
Solder a 100kΩ resistor across the feedback network of the operational amplifier.
This resistor provides a weak hysteresis loop, eliminating jitter caused by battery voltage fluctuations during state transitions and ensuring clean on/off switching.
Mount the blue 10kΩ multi-turn potentiometer onto the board.
This component acts as the precision reference voltage tuner. Adjusting this potentiometer sets the exact threshold at which charging stops (4.2V max battery voltage).
Solder three 1kΩ resistors alongside the 3.0V Zener diode.
The first 1kΩ resistor provides biasing current for the Zener diode; the second forms a voltage divider network for battery sampling; the third limits base control current to the PNP transistor. Ensure the black cathode ring on the 3V Zener diode is aligned correctly.
Solder the fourth 1kΩ resistor and a 470Ω resistor for LED current management.
The 1kΩ resistor connects to the main power indicator branch, while the 470Ω resistor configures current for the state indicator LEDs to create clear visual differentiation.
Install the BD140 PNP transistor to serve as the master electronic switch.
When LM358 outputs a low signal, BD140 conducts current into the battery. When the battery reaches 4.2V, the LM358 output flips high, turning off BD140 and immediately cutting off the charging current.
Solder a 5mm Green LED (with 470Ω resistor) and a 5mm Red LED (with 100Ω resistor).
The Red LED stays lit during active charging. When charging finishes and automatic cutoff triggers, the Red LED turns off and the Green LED turns on.
Solder the 3.7V 18650 battery holder and the 2-pin screw terminal block.
The terminal block acts as the 5V DC input port (compatible with standard phone charger adapters). Ensure correct positive (+5V) and GND connection polarity.
1. No-Load Calibration: Connect a 5V DC power supply to the screw terminal block without inserting a battery. Use a digital multimeter to measure the voltage across the battery output terminals. Rotate the blue 10kΩ precision potentiometer until the multimeter reads exactly 4.20V.
2. Active Charging Test: Insert a discharged 18650 Li-ion battery into the holder. The Red LED should light up immediately, indicating active charging.
3. Cutoff Verification: As charging progresses, the battery voltage rises. Upon reaching 4.20V, the circuit automatically switches off: the Red LED goes off, and the Green LED turns on. Power flow to the battery is completely cut off.




Comments