If you’ve got a 12V 7Ah lead-acid battery sitting around, maybe from a UPS system or a small solar setup, and you need a reliable way to charge it without overdoing things, this circuit is worth a look. It’s built around the LM317, a versatile voltage regulator that’s been a staple in DIY electronics for years. The design includes some basic current limiting to keep things safe, and it’s straightforward to put together if you have a soldering iron handy. I’ll walk you through what the circuit does, the parts involved, and how it all comes together, like I’m explaining it over coffee.
Lead-acid batteries like this one need a charging voltage around 13.8V to 14.4V for safe, effective charging—too low and it takes forever, too high and you risk damaging the cells. The current should start at about 0.7A to 1A for a 7Ah battery (roughly 10% of its capacity) and taper off as it fills up. This circuit aims for that, with an output marked at about 14.2V and built-in protection to avoid dumping too much current at once.
Understanding the Circuit
The diagram shows a classic LM317 setup for voltage regulation, with added bits for filtering and current control. The LM317 takes an input voltage higher than what you need (here, 18V at 1A) and steps it down to a stable output. It uses a pair of resistors to set the exact voltage, and there’s a transistor to monitor and limit the charging current if it spikes.
Here’s a breakdown of the key parts and connections:
- Input Section: Starts with an 18V DC supply at 1A, filtered by C1 (1000µF, 25V) for smoothing out ripples and C2 (0.22µF, 25V) for high-frequency noise.
- LM317 Regulator: The core of the circuit. Vin goes to the input pin, Vout to the output, and Adj (adjust pin) connects through resistors to set the voltage. R1 (120Ω) sits between Vout and Adj, while the lower part of the divider seems to combine R2 (100Ω) and R3 (830Ω) for fine-tuning. This setup gives an output close to 14.2V—let’s crunch the numbers quickly. The LM317 formula is Vout = 1.25V × (1 + R_lower / R_upper). If we take R_upper as 120Ω and R_lower effectively around 1300Ω (perhaps by series combo or adjustment), you get roughly 14.8V, which is in the ballpark for bulk charging (the “~” suggests it’s approximate).
- Output Filtering: C3 (0.22µF, 25V) smooths the output to the battery.
- Current Limiting: This is where the BC140 NPN transistor and the 0.51Ω (5W) resistor come in. The resistor acts as a current sensor in the ground path. If the charging current exceeds about 1.2A (calculated as roughly 0.6V drop across 0.51Ω to turn on the transistor), the BC140 activates. It pulls the Adj pin low, forcing the LM317 to drop its output voltage and reduce the current. This prevents overheating or stressing the battery, especially when it’s deeply discharged. R2 (100Ω) limits the base current to the transistor for safe operation.
- Output: Delivers around 14.2V DC to your battery, tapering to trickle mode as it nears full charge.
The whole thing is compact and low-cost, with no fancy microcontrollers—just analog basics doing the heavy lifting.

Components You’ll Need
Gather these parts to build it. Most are cheap and available at any electronics store or online.
- LM317 voltage regulator (TO-220 package, needs a small heatsink)
- BC140 NPN transistor
- Resistors: 120Ω (R1), 100Ω (R2), 830Ω (R3), 0.51Ω 5W
- Capacitors: 1000µF 25V (C1), 0.22µF 25V (C2 and C3)
- 18V 1A DC power supply (a wall adapter or transformer with rectifier works)
- Wires, protoboard or PCB, alligator clips for battery connection
- Optional: Ammeter to monitor current, heatsink for LM317
Total cost? Probably under $10 if you have some scraps lying around.
How It Works Step by Step
To charge a lead-acid battery safely, you want constant voltage with current limiting. Here’s how this circuit handles it:
- Power Up: Plug in your 18V supply. The LM317 sees about 18V at its input and regulates it down based on the resistors. Without a battery, the output sits at around 14.2V.
- Connect the Battery: Hook up your 12V 7Ah battery (positive to positive, negative to negative—double-check polarity to avoid sparks or damage). If the battery is low (say, under 12V), it’ll draw more current initially.
- Voltage Regulation: The LM317 keeps the output steady at ~14.2V, which is ideal for absorption charging. As the battery fills, its internal voltage rises, and the current naturally drops.
- Current Limiting in Action: If the initial draw exceeds 1.2A (common with a drained battery), the voltage across the 0.51Ω resistor rises above 0.6V. This biases the BC140 on, which adjusts the LM317’s Adj pin to lower the output voltage temporarily. Current drops back to a safe level, and as the battery charges, the transistor eases off, letting full voltage resume.
- Full Charge: When the current falls to a trickle (around 0.1A or less), the battery is full. Disconnect it to avoid overcharging, though this design’s limitations help prevent issues if you forget for a bit.
For math fans, the voltage setup: If R_upper = 120Ω and R_lower = 930Ω (100Ω + 830Ω in series, perhaps), Vout = 1.25 × (1 + 930/120) ≈ 11V, but tweaking shows the effective combo hits closer to 14V—real-world testing with a multimeter is key. Current limit: I_max ≈ 0.6V / 0.51Ω ≈ 1.18A, perfect for a 7Ah battery (charge time around 7-10 hours from empty).
Building and Testing Tips
Start on a breadboard to test. Solder the LM317 with a heatsink—it can get warm at 1A. Use thick wires for the output to handle current without a voltage drop. Test without the battery first: measure ~14.2V at the output. Then connect a discharged battery and watch the current (use a multimeter in series). It should start high but limit itself, dropping as the battery charges.
Safety first: Lead-acid batteries can vent gas, so charge in a ventilated area. Don’t short terminals, and use fuses if possible. If your battery is sulfated or damaged, this charger might not revive it—test with a known good one.
Why This Circuit Rocks for DIYers
It’s simple, effective, and teaches you about regulation and limiting without complexity. Compared to commercial chargers, it’s cheaper and customizable—if you want to adjust voltage, swap resistors. For bigger batteries, scale up the current sense resistor or use a beefier transistor.
If you build this and tweak it, let me know how it goes. Electronics is all about experimenting, and this is a solid starting point for keeping your batteries happy. Happy charging!