🔋 12V Lead-Acid Battery Charger with LM350: Temperature-Compensated DIY Charger (2026 Guide)
Hey makers! Electro here. A lead-acid battery doesn't want "just voltage" — it wants a controlled voltage that backs off as temperature rises, otherwise you cook it slowly with overcharging. Today we're building a proper 12V lead-acid charger around the LM350 (3 A adjustable regulator): adjustable output from 13 to 15 V, negative temperature compensation, and reverse-discharge protection. I've built this exact topology for my backup batteries — let's wire it right.
🔄 Updated for 2026: corrected regulator theory, input supply design, thermal calculations, calibration procedure, BOM, and an ESP32 charge-monitor upgrade.
Constant-voltage charging with temperature compensation — the right way to treat lead-acid.
🧠 Why Constant Voltage + Temperature Compensation?
A 12 V lead-acid battery charges at roughly 14.4 V (bulk/absorption) and floats around 13.6 V. Push higher — or keep the same voltage on a hot day — and you get gassing, water loss and thermal runaway. That's why a serious charger reduces its output voltage as temperature rises (negative temperature coefficient), and exactly what this LM350 design does.
🔧 Key Components & Their Roles
- LM350 regulator: 3 A adjustable regulator holding a 1.25 V reference between OUT and ADJ — the heart of the constant-voltage loop.
- Q1 (BD140): mounted close to the battery, it acts as a temperature sensor; its VBE drop (~-8 mV/°C in this network) pulls the output voltage down as the battery warms.
- Q2: blocks the battery from discharging back through the regulator's resistor network when mains power is off.
- R6 (potentiometer): sets the output anywhere between 13 V and 15 V.
- Input supply: 20–30 V DC at 3 A.
- LED indicator: shows the charger is live.
⚙️ How the Circuit Works
- The LM350 forces a fixed 1.25 V between OUT and ADJ, which sets a stable charging voltage across the battery.
- The R6/R3/R4 network biases Q1; as battery temperature rises, Q1 conducts more and lowers the output voltage.
- This negative temperature coefficient prevents overcharging and thermal runaway on hot days.
- Q2 isolates the battery when the supply is off — no parasitic drain.
- The LED confirms charging is active.
🔌 Building the 20–30 V Input Supply
- Transformer: 15–18 V AC, 3–4 A (≈ 60–80 VA).
- Bridge rectifier: 5 A type (e.g., KBL405).
- Filter capacitor: 4700 µF / 35 V minimum.
- Fuse: 3 A on the DC side, 1 A slow-blow on the AC side.
🛒 Bill of Materials (BOM)
| Component | Model / Value | Role |
|---|---|---|
| Regulator | LM350 (TO-220) | Constant-voltage core, 3 A |
| Q1 temp sensor | BD140 (mounted on battery) | Temperature compensation |
| Q2 protection | 2N2222 / BC547 | Reverse-discharge blocking |
| R6 | 5 kΩ multiturn pot | Output adjust 13–15 V |
| Filter cap | 4700 µF / 35 V | Input smoothing |
| Bridge | KBL405 (5 A) | Rectification |
| Transformer | 15–18 V AC / 3–4 A | Mains isolation |
| Heatsink | ≤ 2 °C/W + paste | LM350 cooling |
| Fuses | 3 A DC + 1 A AC slow-blow | Protection |
🛠️ Assembly & Calibration
- Mount the LM350 on the heatsink with paste; bolt the BD140 (Q1) near the battery case, not on the PCB.
- Power up without battery and set R6 until the meter reads 14.4 V (flooded) — never exceed your battery maker's spec.
- Connect the battery through the fuse; the LED lights and charging begins.
- Verify current tapers down as voltage approaches setpoint — that's healthy constant-voltage behavior.
🤖 The Modern Twist: ESP32 Charge Monitor
Add a smart cutoff alarm with an ESP32 and a voltage divider — it warns you the moment the battery hits full charge:
// Smart charge monitor - Electro (TechFix Hub)
// Divider: R1=100k (bat→GPIO), R2=27k (GPIO→GND) => ratio ~4.7
const int PIN_BAT = 34;
void setup() { Serial.begin(115200); }
void loop() {
float v = analogRead(PIN_BAT) * 3.3 / 4095.0 * 4.7;
Serial.print("Battery: "); Serial.print(v, 2); Serial.println(" V");
if (v > 14.6) Serial.println("FULL - cut the charger!");
else if (v < 12.0) Serial.println("LOW - start charging");
delay(2000);
}
❓ FAQ
Can I charge AGM or gel batteries with it?
AGM: yes, if you set the absorption voltage to ~14.4-14.7 V per the datasheet. Gel: not recommended with this simple charger — set ≤ 14.1 V and monitor closely, or use a dedicated gel profile.
What transformer should I use?
15–18 V AC at 3–4 A. After rectification and filtering you land inside the required 20–30 V DC window while keeping LM350 dissipation sane.
How do I set the output voltage?
No battery connected, multimeter on the output, turn R6 until you read 14.4 V. Use a multiturn pot for a stable, vibration-proof setting.
Why does the charger get hot even at low current?
Linear regulation wastes (VIN−VOUT)×I as heat. Lower the input voltage, improve the heatsink, or move to a switching (buck) charger for efficiency.
🎯 Conclusion
This LM350 charger proves that "simple" doesn't mean "dumb": constant voltage, temperature compensation and reverse-discharge protection are exactly what a lead-acid battery asks for to live a long life. Build it, calibrate it at 14.4 V, bolt Q1 to the battery — and your batteries will thank you for years.
Built this charger or added the ESP32 monitor? Share your voltage logs in the comments — I read every single one!

