Build Your Own 18V NiMH Li-ion Battery Charger Step-by-Step Schematic

For optimal performance, use a switching converter with a 24V DC input and a constant-current/constant-voltage (CC/CV) output stage. A 5A LM2596 module paired with a current-sense resistor (0.1Ω, 2W) ensures safe charging without overheating. Add a Schottky diode (1N5822) on the output to prevent backflow when disconnected. For monitoring, integrate an LM393 comparator with a 10kΩ trimpot to cut off charging at 20.4V (4.2V per cell for a 5S Li-ion pack).
Avoid linear regulators like LM317–they waste power as heat. Instead, implement a buck topology with an IRFZ44N MOSFET driven by a TL494 PWM controller. Use a 47µF electrolytic capacitor at the input and a 1000µF low-ESR capacitor at the output to smooth ripple. For protection, fuse the input at 6A and include a PTC resettable fuse (6V, 5A) on the output. Calibrate the CV threshold using a multimeter–misalignment risks overcharging.
If noise is a concern, add a π-filter with two 10µF ceramic caps and a 1mH ferrite choke. For adaptability, incorporate a jump-selector to toggle between 16.8V (4S) and 20.4V (5S) outputs. Test the design with a dummy load–20Ω resistors–before connecting a live pack. Never skip thermal relief; a TO-220 heatsink extends component life, especially in enclosed housings.
Building a Power Supply for High-Capacity Lithium Cells
Start with a LM317T adjustable voltage regulator–cheap, widely available, and capable of handling currents up to 1.5A. Connect its input to a 24V DC source (like a desktop PSU or stepped-down AC adapter) with a minimum 2A rating. The regulator’s output should bypass the ADJ pin through a 240Ω resistor, then ground via a 5kΩ potentiometer for fine-tuning. This setup ensures the output settles at 21.2V, ideal for balancing efficiency and thermal safety when charging 5-cell packs.
Add a Schottky diode (1N5822) between the regulator’s output and the terminal clamp to prevent reverse discharge. This component drops ~0.3V, so tweak the potentiometer to compensate, targeting 20.9V at the clamp. For current limiting, solder a 0.1Ω 2W resistor in series with the positive line; monitor voltage across it with a multimeter–100mV equals 1A. Replace the resistor with a lower resistance (e.g., 0.05Ω) if you need higher throughput (up to 2A), but upgrade the regulator to a LM350 for better heat dissipation.
Key Safety Modifications
- Insert a PTC resettable fuse (5A rating) on the input line to cut power during short circuits.
- Mount a 100µF 35V capacitor across the output to smooth voltage ripple below 50mV.
- Use a heatsink (10°C/W or better) on the regulator; thermal paste is mandatory.
- Add a red LED with 330Ω series resistor to indicate power-on state–place it on the output side for live-circuit feedback.
For lithium-specific protection, integrate a TP4056 module between the regulator and clamp. This IC handles constant-current/constant-voltage phases, stopping at 4.2V per cell (21V for a 5S pack). Wire its input to the regulator’s output and its B+ pin directly to the clamp. The TP4056’s onboard DW01 battery protection IC halts output if voltage dips below 2.4V per cell, preventing deep discharge damage.
Optimizing for Specific Loads
- For power tools: Add a 2200µF 25V capacitor parallel to the output–this suppresses voltage sag during motor startup.
- For RC packs: Replace the potentiometer with fixed resistors (240Ω + 2.2kΩ) to eliminate drift from vibration.
- For solar applications: Swap the LM317 for a MP2307 buck converter (efficiency >90%), paired with a 12V solar panel.
Test every build with a dummy load (e.g., 10Ω 20W resistor) before connecting a live pack. Monitor input current, output voltage, and regulator temperature for 30 minutes–stable readings at indicate proper heat dissipation. If voltage fluctuates under load, double-check the ground connections and capacitor ESR values. For higher currents (>3A), migrate to a synchronous buck converter (LM2596) or external MOSFET array.
Critical Parts for a Voltage-Specific Power Supply Framework

Select a transformer with a primary rating matching your mains supply (110V–240V AC) and a secondary output of 22V–24V AC for proper voltage headroom. Core size should handle at least 3A for reliable thermal stability in extended operation. Toroidal designs minimize EMI, reducing interference with adjacent components.
| Component | Specification | Purpose |
|---|---|---|
| Bridge rectifier | 35V, 5A (e.g., KBPC3510) | Converts AC to pulsed DC |
| Smoothing capacitor | 4700µF, 35V electrolytic | Reduces ripple to <0.5Vpp |
| Linear regulator | LM317 or equivalent | Maintains 19.5V output under load |
| Adjustment resistor | Precision 1% 240Ω and 1.5kΩ | Sets output voltage with ±0.5V tolerance |
Add a fast-acting fuse (4A) on the primary side and a thermistor (NTC 5Ω) for inrush current limiting. Use schottky diodes (1N5822) for post-regulation output protection to prevent reverse polarity damage. Ensure all traces handling >2A are at least 2.5mm wide for copper thickness of 2oz/ft² to avoid voltage drop.
Step-by-Step Soldering Guide for Power Supply PCB Assembly
Heat your soldering station to 350°C for leaded solder or 375°C for lead-free variants. Use a chisel tip (1.2–1.6mm) for through-hole components and a conical tip (0.5mm) for surface-mount devices. Apply flux to the pad and component lead before soldering to prevent oxidation and improve wetting. Start with the lowest-profile components, such as resistors and diodes, to avoid interference during subsequent steps.
Secure the PCB in a vice or holder with the copper side facing upward. For axial components like capacitors, bend the leads at a 45° angle 2mm from the body, insert them into the designated holes, and trim excess wire 1mm above the board. Apply solder to one pad first, reheat, and add the component while maintaining pressure. Complete the second joint without moving the part. Check continuity with a multimeter before proceeding to polarized parts like IC sockets.
Handling Heat-Sensitive Components
Position a small aluminum heatsink or clip-on dissipator on MOSFETs or voltage regulators during soldering. Limit heat exposure to 3 seconds per joint. For ICs, use a socket or pre-tin the pins before seating the chip. Align the notch on the IC with the silkscreen marking on the board. Test each pin’s resistance to ground after soldering–readings above 1MΩ indicate a cold joint.
For large electrolytic capacitors, mount them vertically with the negative stripe aligned to the board’s polarity marking. Use a heavier gauge wire (22 AWG) for ground connections to handle current draw. Apply a thin layer of thermal paste between regulators and heatsinks, securing them with M3 screws torqued to 0.5Nm. Leave 5mm clearance between heatsink fins and adjacent components to allow airflow.
Use a desoldering braid or vacuum pump for corrections. Clean flux residue with 99% isopropyl alcohol and a stiff-bristled brush, focusing on high-density areas. Inspect joints under 5x magnification–voids, bridges, or dull surfaces signal defects. Reflow problematic joints with additional flux rather than excessive heat to avoid PCB delamination.
Final Assembly Checks
Attach the input/output connectors last, ensuring screws or snap-fits are fully engaged. Verify polarity of all connectors against the schematic. Power the board with a current-limited supply (set to 200mA) and monitor voltage at key test points: output terminals, regulator outputs, and feedback nodes. Any deviation exceeding ±2% from expected values requires rework. Store assembled PCBs in anti-static bags until integration.
Voltage Regulation Techniques for Stable Power Supply Output

Implement a linear regulator like the LM317 for precise control, configuring it with a 240Ω resistor between the output and adjustment pin and a 1.5kΩ resistor from the adjustment pin to ground. This configuration delivers a consistent 18.5V with a ripple rejection of 65dB at 1kHz, reducing noise from input fluctuations by over 90%. Ensure heatsinking matches the power dissipation–calculate using P = (Vin – Vout) × Iload–where a 5°C/W heatsink is required for 2A loads with an input of 24V.
For switching regulators, employ a buck converter topology with a synchronous rectifier to minimize losses. Use an IC like the TPS54331, pairing it with a 12μH inductor (saturation current ≥ 3A) and ceramic capacitors–22μF for input and 47μF for output–to maintain stability under load transients up to 3A. Set the feedback resistors to 10kΩ and 1.69kΩ for 18.5V output; adjust the compensation network (10kΩ, 1nF) if overshoot exceeds 5% at full load step.
Add a pre-regulation stage using a Zener diode and a series pass transistor to clamp voltage spikes before the main regulator. Select a 20V Zener (1N4747) with a 500mW rating and a BC547 transistor for currents under 500mA. For higher currents, substitute with a TIP31C. This stage reduces input ripple by 70% when paired with a 470μF bulk capacitor, critical for protecting sensitive downstream components from transient surges.
Combine a TL431 programmable shunt regulator with optocoupler feedback for isolated applications. Configure the TL431 with resistors–2.2kΩ and 470Ω–to set the reference voltage to 2.5V, then scale this to 18.5V via a voltage divider. The optocoupler isolates the load from high-side noise, maintaining regulation even if input voltage varies by ±15%. Choose an optocoupler with a CTR (current transfer ratio) of 100-200% for optimal response.
Use a hysteresis-controlled comparator circuit for low-cost, precise regulation in harsh environments. Configure an LM393 with a 1% 10kΩ resistor network to trigger at 18.0V (low threshold) and 19.0V (high threshold). Add a 100nF capacitor across the reference pin to filter noise, and pair the comparator output with a MOSFET (IRFZ44N) to switch a load or auxiliary circuit. This method eliminates the need for continuous feedback loops while delivering ±0.5% accuracy under steady-state conditions.
Integrate a soft-start feature using an NTC thermistor (5Ω cold resistance) in series with the input capacitor. Replace it with a relay or MOSFET bypass after 500ms to reduce inrush current by 80%. For thermal protection, place a 100kΩ NTC thermistor near the power components, feeding its signal into an operational amplifier (LM358) configured as a comparator. Set the trip point to 80°C to cut power via a logic-level MOSFET (IRLZ44N) when overheating is detected.
For ultra-low-noise applications, cascade two linear regulators–first an LM7815, then an LM317–each with independent decoupling capacitors (10μF tantalum at input, 1μF ceramic at output). This dual-stage approach achieves ripple rejection exceeding 95dB at 120Hz, while the intermediate 15V stage reduces power dissipation in the final regulator. Ensure PCB traces carrying high currents are at least 2mm wide per ampere, and use star grounding to prevent coupling between input and output circuits.