To build a robust, adjustable lithium ion charger circuit from discrete components, use the dual-op-amp diode-OR topology. This configuration independently regulates constant current (CC) and constant voltage (CV), seamlessly transitioning between them without relying on black-box dedicated ICs. By using an LM358 dual op-amp, a TL431 precision reference, and a P-channel MOSFET, you gain complete control over the charge profile, thermal management, and failure transparency.
The Dual-Op-Amp Diode-OR Topology (Node Map)
The core principle of this lithium ion charger circuit is that the battery demands either a specific current (CC phase) or a specific voltage (CV phase), whichever requires less energy at any given moment. We use two op-amps to monitor these states and a diode-OR gate to let the most restrictive signal control the pass transistor.
- V_IN: Raw DC input (6V to 12V). Must be at least 1.5V above the target battery voltage to account for MOSFET dropout and sense resistor voltage.
- V_SENSE_HI: Top of the current sense resistor, connected to the MOSFET source.
- V_SENSE_LO: Bottom of the current sense resistor, connected to the Battery (+) terminal.
- V_BATT: Battery positive terminal.
- V_REF_CV: 2.500V precision reference generated by the TL431 shunt regulator.
- V_FB_CV: Voltage divider tap from
V_BATTfeeding the CV op-amp. - V_GATE: The diode-OR junction (cathodes of two 1N4148 diodes) driving the P-Channel MOSFET gate.
Why This Topology Beats the Alternatives
Why choose a discrete diode-OR design over a simple series resistor or a dedicated IC like the TP4056? It comes down to adjustability and thermal scaling.
| Criteria | Discrete Diode-OR (This Circuit) | Dedicated IC (e.g., TP4056) | Simple Series Resistor |
|---|---|---|---|
| Current Adjustability | High (Change one sense resistor or trimpot) | Low (Requires swapping a specific SMD PROG resistor) | None (Fixed by Ohm's law and battery state) |
| Thermal Management | Excellent (Heat dissipated in external MOSFET) | Poor (Heat trapped in SOT-23/MSOP silicon die) | Poor (Heat trapped in resistor or supply) |
| Failure Transparency | High (Node-by-node troubleshooting with DMM) | Low (Black box; if it fails, you replace the board) | High (But lacks active regulation) |
| Component Count | ~12 components | ~4 components (IC + passives) | 1 component |
Design Walkthrough: Sizing Real Components for 1A / 4.2V
Let’s size the components for a standard 18650 cell charging at 1.0A with a 4.20V CV threshold.
1. The Pass Element: Use an FQP27P06 P-Channel MOSFET. It handles up to -60V and -18A. At 1A, its R_DS(on) is negligible, and it can be mounted to a heatsink if your input voltage is high.
2. Current Sense Resistor (R_SENSE): We need to measure 1A. The LM358 op-amp has a typical input offset voltage (V_os) of 2mV, and a max of 7mV. If our sense voltage is too low, V_os will cause massive current errors. We target a 100mV drop at 1A. Therefore, R = V / I = 0.1V / 1A = 0.1Ω. Use a 0.1Ω, 1%, 1W metal film resistor. The CC reference voltage must be set to exactly 100mV.
3. CV Precision Reference: The TL431 provides a rock-solid 2.500V reference. Bias it with a 1kΩ resistor from a 5V LDO to its cathode.
4. CV Voltage Divider: We need to scale the 4.2V battery down to 2.5V for the op-amp's inverting input. Using the formula V_ref = V_batt * (R_bot / (R_top + R_bot)), if we set R_bot = 10kΩ, then R_top must be 6.8kΩ. To allow exact calibration, use a 4.7kΩ fixed resistor in series with a 5kΩ trimpot for R_top.
5. The Diode-OR Gate: Use two 1N4148 signal diodes. Connect the anodes to the outputs of the two LM358 op-amps, and tie the cathodes together to form V_GATE. Add a 10kΩ pull-up resistor from V_GATE to V_IN to ensure the MOSFET turns off when both op-amps are outputting low.
Behavior Matrix & Failure Extremes
Understanding how the circuit reacts to component drift and catastrophic failure is critical for safe lithium ion charger circuit design.
| Element Changed | Condition | Circuit Behavior & Result |
|---|---|---|
| R_SENSE | Drifts +5% (0.105Ω) | CC current drops to ~0.95A. Charge takes slightly longer, but perfectly safe. |
| V_IN | Drops to 4.5V | MOSFET enters linear/triode region trying to maintain current. CV phase fails to reach 4.2V. Charge stalls. |
| R_bot (CV) | Drifts +2% | CV threshold drops to ~4.12V. Battery undercharges slightly; increases cycle life but reduces capacity. |
What Breaks at the Extremes?
- Short across R_SENSE: The CC op-amp sees 0V across the sense resistor, assumes current is zero, and drives the MOSFET gate fully on. The battery charges at the maximum current your power supply can deliver. Hazard: Severe thermal runaway and cell venting if the supply lacks its own overcurrent protection.
- Open in CV feedback divider (R_top breaks): The CV op-amp sees 0V at its input, assumes the battery is dead, and commands maximum voltage. The CC loop takes over, but when the battery hits 4.2V, the CV cutoff never triggers. The CC loop forces 1A into a full cell, rapidly driving the voltage past 4.5V. Hazard: Lithium plating, separator meltdown, and fire.
Step-by-Step Breadboard Testing Protocol
Never plug a lithium cell into an untested breadboard. Follow this sequence to verify the regulation loops independently.
- Power the Logic Only: Connect 5V to the LM358 VCC and the TL431 bias network. Leave the MOSFET gate (
V_GATE) floating. Measure the TL431 REF pin with your DMM; it must read exactly 2.500V (±5mV). - Calibrate the CV Loop: Use a bench power supply to inject exactly 4.200V into the
V_BATTnode. Connect your DMM to the CV op-amp output. Slowly adjust the CV trimpot until the op-amp output abruptly switches from high (~3.5V) to low (~0.2V). Lock the trimpot with a dab of nail polish. - Calibrate the CC Loop: Remove the 4.2V injection. Short the
V_BATTnode to GND through a high-wattage dummy load (or your DMM in 10A mode). Measure the voltage acrossR_SENSE. Adjust the CC reference trimpot until the voltage acrossR_SENSEreads exactly 100mV (indicating 1.00A). - Live Cell Test: Connect the MOSFET gate. Insert a partially depleted 18650 cell (around 3.6V). Monitor the voltage across
R_SENSE(should be 100mV) andV_BATT. AsV_BATTapproaches 4.2V, watch the sense voltage drop smoothly from 100mV toward 0mV, confirming the CV handover.
Frequently Asked Questions
Can I use an N-channel MOSFET instead of a P-channel in this lithium ion charger circuit?
Yes, but it complicates the gate drive. An N-channel MOSFET (like the IRFZ44N) placed in the low-side (between the battery negative and ground) requires the current sense resistor and feedback networks to be referenced to the high side, which is dangerous and difficult to breadboard. If you place the N-channel on the high side, you need a gate voltage higher than V_IN to turn it on, requiring a charge pump or bootstrap circuit. Stick to the P-channel MOSFET for high-side switching in linear discrete designs; it keeps the ground reference common and stable.
Why does my lithium ion charger circuit oscillate or ring during the CC-to-CV transition?
Oscillation occurs because the MOSFET gate has significant parasitic capacitance (often >1000pF for power FETs like the FQP27P06). When the op-amp tries to rapidly adjust the gate voltage to balance the feedback loop, the phase shift introduced by this capacitance turns negative feedback into positive feedback at high frequencies. To fix this, isolate the op-amp output from the gate with a 100Ω series resistor, and add a 10nF to 100nF capacitor from the MOSFET gate to ground to filter the high-frequency ringing.
How do I add an automatic charge termination cutoff to a lithium ion charger circuit?
The basic CC/CV topology tapers the current but doesn't shut off completely when the battery is full, which can cause micro-cycling and degradation. To add auto-termination, introduce a third op-amp stage (using an LM393 comparator). Monitor the voltage across R_SENSE. When the tapering current drops below your termination threshold (typically C/10, or 100mA for a 1000mAh cell, equating to 10mV across a 0.1Ω resistor), the comparator trips a silicon-controlled rectifier (SCR) or a latching relay that physically disconnects the V_IN supply from the circuit.






