⏱ 12 min read  ·  ✅ Updated Dec 2026

A simple automatic charger for a 12 volt car battery does not need a microcontroller. It needs three things: a power stage that can deliver charging current, an accurate way to watch the battery voltage, and a switch that stops the charge when the battery is full and restarts it when the voltage falls again. The LM311 comparator handles the watching and the switching decision in a single eight-pin chip, which is why it keeps appearing in classic auto cutoff charger designs. This guide explains how the best-known version of the circuit works, block by block, how to choose the switching voltages, and how to calibrate and test it safely on the bench.

As an Amazon Associate we earn from qualifying purchases.

This is a design guide, not a shopping list. There are no products to buy here, because the value of the LM311 circuit is that you build it yourself from standard parts: a comparator, a reference diode, a handful of resistors, a transistor, and a relay or MOSFET that does the heavy switching. Understanding what each block does matters more than copying any single schematic, because published versions differ in details such as pin connections, resistor values, and whether the relay switches the mains side or the low-voltage side of the charger.

What the LM311 Actually Does

The LM311 is a voltage comparator, not an operational amplifier, and that distinction shapes the whole design. An op-amp is built for smooth, linear output. A comparator is built for a clean yes-or-no answer: is the voltage on one input higher than the voltage on the other input? Inside the charger, one input receives a fixed reference voltage and the other receives a sample of the battery voltage, reduced by a resistor divider. The moment the battery sample crosses the reference, the output flips state.

That flip is the entire automatic cutoff. While the battery is below full charge, the comparator output keeps the switching stage on and current flows into the battery. When the terminal voltage rises to the chosen cutoff point, the output changes state, the switch opens, and charging stops. When the battery later settles and its voltage falls to the restart point, the comparator flips back and charging resumes. No timing chip, no software, and no manual supervision are involved.

Two features of the LM311 make it especially suitable. First, its output is an open-collector transistor, which means it can pull a relay driver or indicator circuit down to ground but needs a pull-up or a driven transistor stage to do real work. That sounds like a limitation, yet it makes the chip flexible: the same output can drive a small transistor that energises a relay coil, light an indicator LED, or gate a MOSFET stage. Second, the chip runs from a wide range of supply voltages and its inputs can sense voltages close to the negative rail, which suits a circuit that lives on the same roughly 12 to 18 volt supply as the charger itself. Always confirm pin numbers and limits against the datasheet for the exact package in hand, because the design depends on connecting the inputs, the output transistor, and the strobe and ground pins correctly.

The Five Blocks of the Charger

Every published LM311 auto charger circuit, whatever its drawing style, contains the same five functional blocks. Reading any schematic becomes easy once you can spot them.

1. The Power Stage

A transformer steps the mains down to a low AC voltage, a bridge rectifier converts it to DC, and a large electrolytic capacitor smooths it. The unregulated DC that results sits several volts above the battery voltage, which is what allows current to flow into the battery. A series element — in the simplest designs the resistance of the transformer winding itself, in better designs a proper current-limiting stage — keeps the initial charge current within what the transformer, rectifier, and battery can handle. This block is deliberately dumb. All of the intelligence lives in the control block, and the power stage only has to deliver current safely when it is told to.

2. The Reference

The comparator needs something stable to compare against, and in the classic circuit a zener diode provides it. A common arrangement holds one comparator input at a fixed voltage set by a low-voltage zener fed through a resistor from the supply. The reference must not drift as the charger warms up or as the unregulated supply rises and falls with the charging current, which is why the zener gets its own feed resistor and why some builders regulate the control supply separately from the raw charging rail. If the reference moves, the cutoff voltage moves with it, and the battery is overcharged or undercharged by exactly that error.

3. The Battery Sense Divider

The battery voltage itself is too high and too variable to feed a comparator input directly in most layouts, so two resistors divide it down to a fraction that crosses the reference at the desired cutoff. One of those resistors is usually a preset potentiometer, which is the calibration adjustment for the whole charger. The ratio of the divider decides which battery voltage corresponds to the switching point. A divider that reduces the battery voltage by a factor of three, for example, makes a full-charge voltage in the mid-fourteen volt range appear at the comparator input as a voltage a little under five volts, ready to be compared with a reference in that region. Keep the divider resistors at the battery terminals end of the wiring, or sense the voltage as close to the battery as practical, so that voltage dropped in the charging leads does not fool the control circuit into cutting off early.

4. Hysteresis, the Restart Gap

A comparator with no hysteresis would chatter at the switching point. The instant charging stops, the battery voltage sags slightly because the charging current is no longer pushing it up, so a bare comparator would switch straight back on, then off, then on, several times a second, wearing the relay and confusing anyone watching. The cure is positive feedback: a high-value resistor from the comparator output back to the sensing input, which shifts the threshold a little depending on the output state. The result is two distinct switching points instead of one. Charging stops at the upper threshold and does not restart until the battery falls to a lower threshold. That gap, often around a volt at the battery in simple designs, is what makes the charger behave like a calm automatic cutoff instead of a buzzer. Choosing the feedback resistor is a trade-off: too little feedback and the relay still chatters near the top of charge; too much and the charger waits so long between cycles that the battery spends unnecessary time partly discharged.

5. The Switching Stage

The LM311 output cannot carry charging current or even a relay coil on its own, so it drives a small transistor, and the transistor drives the switch. In the classic circuit that switch is a relay. Some versions place the relay contacts in the transformer primary, so the whole power stage shuts down at cutoff. Others switch the low-voltage DC side, which is gentler on the contacts and avoids routing mains wiring near the control board, but leaves the transformer energised. A freewheeling diode across the relay coil is essential either way, because the coil produces a voltage spike when it releases, and that spike will damage the driver transistor and can upset the comparator. A modern variation replaces the relay with a power MOSFET on the low-voltage side. That removes contact wear and clicking, but adds gate-drive and heat considerations the relay version does not have. For a first build, the relay version is easier to understand and to debug, because you can hear and see it change state.

Choosing the Switching Voltages

The circuit does not decide what full means. You do, when you set the divider. For a conventional flooded 12 volt automotive battery, widely used charging guidance puts the absorption or cutoff region in the mid-fourteen volt range at room temperature, and float or maintenance voltage lower, in the mid-thirteen volt range. Sealed AGM and gel batteries have their own maker-specified limits, and gel in particular tolerates less voltage. Treat any single number found in a circuit article as a starting point for discussion, not as a specification: the battery manufacturer’s datasheet for the exact battery on the bench is the authority, and temperature matters, because the correct charging voltage falls as the battery gets hotter.

This is also where the simple LM311 design shows its honest limits. It is a one-threshold controller with a restart gap, not a multi-stage smart charger. It does not provide a separate absorption timer, a gentle float stage, temperature compensation, or desulfation pulses. What it provides is a dependable ceiling: the battery cannot be left connected to a raw, unregulated supply indefinitely, because the comparator will keep disconnecting it at the ceiling you set. For a workshop charger that is used under occasional supervision, and for learning how automatic cutoff works, that is a reasonable and useful bargain. For an unattended battery that must last for years on maintenance charge, a design with a true float stage, or a factory smart charger, is the better tool.

One subtle point catches many builders: the voltage at the battery terminals while charging is not the same as its rested voltage. Internal resistance means the terminal voltage sits higher while current flows, then relaxes downward within seconds or minutes after cutoff. That relaxation is exactly why the hysteresis gap exists, and why calibration must be done with the charger actually connected and running, not by calculating the divider on paper alone.

Calibration, Step by Step in Principle

Calibration means adjusting the preset potentiometer so the relay changes state at the battery voltage you have chosen. The safe way to do it uses an adjustable bench supply standing in for the battery, so no real battery is overcharged while you experiment.

First, connect the bench supply to the charger output terminals in place of the battery, with a voltmeter across it, and power the charger control circuit. Raise the bench voltage slowly from below the expected restart point. Watch for the state change that says charging would begin, and note the voltage. Continue raising it slowly until the comparator trips and the relay releases. That second reading is your cutoff point as built. Adjust the preset a small amount, then run the voltage down and back up again to find the new pair of thresholds, because the hysteresis means the trip point depends on the direction of approach. Repeat until the upper threshold matches the cutoff voltage you selected from the battery maker’s guidance. Then lower the bench voltage and confirm the restart threshold sits far enough below cutoff that the relay does not chatter, yet not so far below that a stored battery would sit discharged for long stretches.

Only after the thresholds behave on the bench supply should a real battery be connected, and the first real charge should be supervised, with terminal voltage checked against a second meter. If the two meters disagree, trust the calibration process, not the circuit: stop, find the measurement error, and repeat. Small errors matter here. A cutoff set even a few tenths of a volt too high, applied repeatedly, shortens battery life, while one set too low leaves the battery chronically undercharged, which shortens it in a different way.

Safety Rules That Are Not Optional

A battery charger combines mains electricity, high currents, and a battery that can release flammable gas while charging. The LM311 control board is the safest part of the project; everything around it deserves respect.

Build the mains side with proper insulation, a fuse, strain relief on cables, and an enclosure that keeps fingers away from live parts. If you are not confident working with mains wiring, have that side of the project checked by someone qualified before it is ever plugged in. Fuse the output as well, close to the battery, because a short across battery leads can draw currents far beyond anything the charger itself would deliver. Protect against reverse polarity: connecting the charger backwards can destroy the control circuit and damage the battery, and a series diode, a polarity-sensitive relay arrangement, or at minimum clearly marked, different-sized terminals are all better than memory. Charge in a ventilated space, keep sparks and flames away from the battery top, and remember that the relay in this very circuit makes a small spark-prone switching action, which is one more reason the charger belongs in open air rather than sealed in a box with the battery. Finally, never leave a home-built charger running unattended until it has completed several supervised cycles exactly as intended.

Troubleshooting the Common Faults

Most LM311 charger faults fall into a short list. If the relay chatters near full charge, the hysteresis feedback resistor is missing, open, or too high in value to create a wide enough gap, or the sense divider is picking up ripple because its filter capacitor is absent or dried out. If the charger never cuts off, check the reference first: a zener fitted backwards or fed through the wrong resistor value shifts every threshold with it. Then check that the sense divider is actually connected to the battery side of the switch, not to the charger side, a wiring slip that makes the comparator watch the wrong voltage entirely. If the charger never starts, suspect the driver transistor, the coil diode fitted the wrong way round, or a comparator input pair swapped relative to the schematic, which inverts the whole logic so the circuit does the opposite of what its labels say. Work through these with the bench supply, not with a battery, and change one thing at a time.

When This Circuit Is the Right Answer

The best 12 volt auto battery charger circuit using the LM311 is the right answer when the goal is a transparent, repairable automatic cutoff that you fully understand: a workshop charger for a car that sits between uses, a teaching project in comparators and hysteresis, or a control board added to an existing transformer charger that previously relied on someone remembering to switch it off. It is not the right answer when the battery is expensive, sealed, and expected to live for years on float, or when the charger must handle several battery chemistries at the touch of a button. Knowing which of those jobs you have is the real design decision. The LM311 itself is the easy part: give it a stable reference, an honest sample of the battery voltage, and enough hysteresis to make up its mind, and it will watch a battery patiently for as long as the charger stays plugged in.

Explore Our Guides & Free Tools