12V Lead-Acid Battery Charger Circuit with LM350 (DIY Guide)

Advertisement

A lead-acid battery does not just need voltage. It needs a controlled voltage that backs off as the temperature rises, otherwise it is slowly overcharged and damaged. This guide builds a simple 12 V lead-acid charger around the LM350 (a 3 A adjustable linear regulator) with an output adjustable from 13 to 15 V, negative temperature compensation and protection against discharge back into the circuit. It also covers the parts of the design that are easy to get wrong: the input supply, heat, current limiting and calibration.

12V lead-acid battery charger built around an LM350 regulator on a heatsink
Illustration: constant-voltage charging with temperature compensation.

Safety First

  • Mains voltage is dangerous. Build the AC side in an insulated enclosure, fuse the primary, and never touch the transformer or rectifier while it is plugged in.
  • Lead-acid batteries release explosive hydrogen while charging. Charge in a ventilated place, away from sparks, and never leave a new build running unattended.
  • Always observe polarity when connecting the battery, and keep a fuse in the battery lead.

Why Constant Voltage with Temperature Compensation?

A 12 V lead-acid battery is typically charged at about 14.4 V (absorption) and held at about 13.6 V (float). Higher voltages, or the same voltage on a hot day, cause gassing, water loss and heat that can lead to thermal runaway. A good charger therefore lowers its output as the battery warms up. Typical compensation is about −3 mV per °C per cell, which is roughly −18 mV/°C for a 6-cell 12 V battery, so always check the datasheet of your battery.

Battery typeAbsorption voltage (about 20–25 °C)Float voltage
Flooded lead-acidabout 14.4 Vabout 13.6 V
AGM14.4–14.7 V (per datasheet)about 13.6 V
Gelabout 14.1 V (per datasheet). Not recommended for this simple chargerabout 13.5 V

Key Components and Their Roles

  • LM350 regulator: a 3 A adjustable regulator that keeps 1.25 V between its OUT and ADJ pins. This is the core of the constant-voltage loop.
  • Q1 (BD140): mounted against the battery case, it works as the temperature sensor. Its base-emitter voltage falls as it warms, which pulls the output voltage down. In the network as drawn, the compensation is roughly −8 mV/°C, gentler than the typical −18 mV/°C. That is acceptable for a garage charger, but it means you should set the voltage at normal room temperature.
  • Q2: stops the battery from discharging through the resistor network when the mains is off.
  • R6 (potentiometer): sets the output between 13 V and 15 V.
  • LED indicator: shows that the charger is powered.

How the Circuit Works

  1. The LM350 keeps a fixed 1.25 V between OUT and ADJ, which sets a stable charging voltage across the battery.
  2. The R6/R3/R4 network biases Q1. As the battery temperature rises, Q1 conducts more and lowers the output voltage.
  3. This negative temperature coefficient reduces overcharging on hot days.
  4. Q2 isolates the resistor network from the battery when the supply is off.
  5. The LED confirms that the charger is powered.
Schematic of a temperature-compensated 12V lead-acid battery charger using the LM350
Figure 1: Schematic of the temperature-compensated LM350 charger (click to enlarge).

Building the Input Supply

  • Transformer: 18 V AC, 3–4 A (about 60–80 VA).
  • Bridge rectifier: 5 A type (for example KBL405).
  • Filter capacitor: 10,000 µF / 35 V for 3 A (see the calculation below).
  • Fuses: 3 A on the DC side, and a slow-blow fuse on the AC side sized for the transformer (about 0.5 A for 60–80 VA on 230 V, or 1 A on 115 V).

Why the transformer and capacitor matter

The LM350 needs about 2 to 3 V of headroom, so for a 14.4 V output the input must never drop below roughly 17.5 V, even at the bottom of the ripple. The ripple of a filter capacitor is about ΔV = I / (2 × f × C).

  • At 3 A with 4700 µF (50 Hz), the ripple is about 6.4 V peak-to-peak. A 15 V AC transformer would drop below the required headroom.
  • With 10,000 µF, the ripple at 3 A is about 3 V, and an 18 V AC transformer stays above the minimum.

Heat Is the Real Limit

A linear regulator dissipates (VIN − VOUT) × I as heat. At 30 V in, 14 V out and 3 A, that is 48 W, which a small heatsink cannot handle. At about 20 V in, it falls to roughly 18 W. Keep the input as low as the headroom rule allows, mount the LM350 with thermal paste on a heatsink rated 2 °C/W or better, and check its temperature during the first test.

Bill of Materials

ComponentModel / ValueRole
RegulatorLM350 (TO-220)Constant-voltage core, 3 A
Q1 temperature sensorBD140 (mounted on the battery)Temperature compensation
Q22N2222 / BC547Isolates the resistor network when off
R65 kΩ multiturn potentiometer (as in the schematic)Output adjustment, 13–15 V
Filter capacitor10,000 µF / 35 VInput smoothing
Bridge rectifierKBL405 (5 A)Rectification
Transformer18 V AC / 3–4 AMains isolation
Series blocking diodeSchottky 5–10 AStops back-feed into the regulator when off
Heatsink2 °C/W or better, with thermal pasteLM350 cooling
Fuses3 A DC + slow-blow on the AC sideProtection

Two Things This Simple Design Does Not Do

  • It does not limit charging current. A discharged battery will draw whatever the LM350 can supply, up to its own limit. Keep the current to about 0.1 to 0.2 times the battery capacity (0.2C is 2.4 A for a 12 Ah battery). For small batteries, add a current limiter such as a power resistor in series or a sense-resistor-and-transistor limiter.
  • It does not step down to float voltage. If you leave it connected for weeks at 14.4 V, a flooded battery will slowly lose water. For permanent connection, set the output to float voltage (about 13.6 V) or disconnect after charging.

Also add a series blocking diode at the output unless your schematic already blocks reverse current. When the supply is off, the battery voltage on the LM350 output is higher than its input, and the regulator is not designed for that.

Assembly and Calibration

  1. Mount the LM350 on the heatsink with thermal paste. Bolt or tape the BD140 (Q1) to the battery case, not on the PCB.
  2. Power up without the battery, with a 100 Ω / 5 W resistor across the output (after the blocking diode, so the diode is conducting). Adjust R6 until the meter reads your chosen voltage, for example 14.4 V for a flooded battery at room temperature. Never exceed the battery manufacturer's specification.
  3. Connect the battery through the fuse, with the correct polarity. Charging begins.
  4. Check that the current falls as the battery voltage approaches the setpoint. That is normal constant-voltage behavior.
  5. Check the heatsink temperature after 15 minutes.

ESP32 Battery Voltage Monitor (Optional)

An ESP32 with a voltage divider can log the battery voltage and warn you about overvoltage or deep discharge. Note that in constant-voltage charging the voltage stays at the setpoint, so voltage alone cannot tell you when the battery is full. For that, measure the current taper with a current sensor such as the INA219.

// 12 V battery voltage monitor - ESP32 (Arduino core 2.x or later)
// Divider: R1 = 100k (battery to GPIO35), R2 = 22k (GPIO35 to GND),
// plus 100 nF from GPIO35 to GND. 15 V gives about 2.7 V at the pin.
const int   PIN_BAT = 35;                       // ADC1, input-only pin
const float RATIO   = (100.0 + 22.0) / 22.0;    // about 5.545

float readBatteryVolts() {
  uint32_t sum = 0;
  for (int i = 0; i < 16; i++) {
    sum += analogReadMilliVolts(PIN_BAT);       // factory-calibrated reading
    delay(2);
  }
  return (sum / 16.0) / 1000.0 * RATIO;
}

void setup() {
  Serial.begin(115200);
  analogSetPinAttenuation(PIN_BAT, ADC_11db);
}

void loop() {
  float v = readBatteryVolts();
  Serial.printf("Battery: %.2f V\n", v);
  if (v > 15.0)      Serial.println("OVERVOLTAGE - check the charger and disconnect");
  else if (v < 12.0) Serial.println("LOW - deeply discharged (resting voltage), charge it");
  delay(2000);
}

Calibrate the reading against a multimeter, since resistor tolerances and the ADC introduce small errors. The "low" threshold applies to a resting battery, because the voltage reads higher while charging.

Illustration of a DIY lead-acid battery charger layout with an LM350 on a heatsink and a BD140 sensor on the battery
Illustration: typical layout, with the LM350 on a large heatsink and Q1 attached to the battery case.

Frequently Asked Questions

Can I charge AGM or gel batteries with it?

AGM: yes, if you set the absorption voltage within the manufacturer's range (typically 14.4–14.7 V). Gel: not recommended with this simple charger. Gel cells need a lower voltage (often about 14.1 V) and tolerate overcharge poorly.

What transformer should I use?

An 18 V AC transformer rated 3–4 A, with a 10,000 µF filter capacitor. A 15 V AC transformer does not leave enough headroom for the LM350 at 3 A.

How do I set the output voltage?

Connect a small dummy load (for example 100 Ω / 5 W), put a multimeter on the output and turn R6 until you read the voltage you want. A multiturn potentiometer gives a stable, vibration-proof setting.

Why does the charger get hot even at low current?

A linear regulator turns (VIN − VOUT) × I into heat. Lower the input voltage, use a bigger heatsink, or choose a switching (buck) charger for better efficiency.

Can I leave it connected to the battery permanently?

Only if the output is set to float voltage (about 13.6 V). At 14.4 V, a flooded battery will slowly lose water over weeks.

Conclusion

This LM350 charger shows that a simple circuit can still follow good lead-acid charging practice: constant voltage, temperature compensation and a blocked reverse path. Pay attention to the transformer and capacitor sizing, keep the heat under control, add a current limit for small batteries, and set the voltage to float for long-term connection.

Read Next on TechFix Hub

Built this charger or have a question about your battery?
Leave a comment below with your battery type and capacity.

Last updated: November 2026

No comments