
12V Lead-Acid Battery Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new 12V Lead-Acid Battery Library for Proteus Simulation, the next library of our renewable energy series. If you have searched for a Proteus simulation of a lead-acid battery, the heavy 12 V block that has started cars and kept alarm systems alive for generations, this library brings the sealed 12 V 7 Ah version of it into Proteus, with the behaviour that makes this old chemistry both easy and unforgiving.
12V Lead-Acid Battery Library for Proteus Simulation
Latest version: V1.0 (November 2026, this tutorial)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The battery is drawn at its true size, and at run time it writes what it is doing and the charge it has left above itself, and its volts, amps and watts under itself on your sheet. The simulation model gives a rest voltage that tells the charge, a capacity that shrinks when you discharge fast, and a charge that turns to gas when the voltage goes too high. And it has no protection at all, exactly like the real battery: in the demo a small load drains it flat while nothing stops it, a sketch raises the alarm, and our hand crank generator charges it back.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the Motor Driver board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the 12V Lead-Acid Battery Library for Proteus Simulation:
What is a Sealed Lead-Acid Battery?
The lead-acid battery is the oldest rechargeable battery still in daily use. Each cell has plates of lead and lead dioxide in dilute sulphuric acid and gives about 2 V; six cells in series make a 12 V battery. In the sealed version, also called VRLA or AGM, the acid is soaked up in glass-fibre mats between the plates and the case is closed, with a small valve for each cell that opens only if the pressure inside gets too high. Such a battery cannot spill, needs no water and works in any position.
The battery of this library is the most common size of all, 12 V with about 7 Ah, in a case of 151 x 65 x 94 mm. You will find it in alarm panels, gate motors, emergency lights, small UPS units and garden solar lights. It is cheap, it is tolerant of a simple charger, and it is heavy: about 2.4 kg. In a small solar or wind system it is still the first battery many people buy, so it has its place in our renewable energy series beside the lithium battery of the last tutorial.
| 12 V 7.2 Ah sealed lead-acid battery (a maker's sheet) | |
|---|---|
| Nominal voltage | 12 V (six cells in series) |
| Capacity at 0.36 A (20 hours) | 7.2 Ah, down to 10.5 V |
| Capacity at 0.684 A (10 hours) | 6.84 Ah |
| Capacity at 1.224 A (5 hours) | 6.12 Ah |
| Capacity at 7.2 A | 4.08 Ah, down to 9.6 V |
| Internal resistance | about 22 milliohm |
| Charge, cycle use | 14.4 to 15.0 V, 2.16 A at most |
| Charge, standby use | 13.5 to 13.8 V |
| Temperature | charge -15 to 40 °C, discharge -15 to 50 °C |
| Size and weight | 151 x 65 x 94 mm, about 2.4 kg |
The Voltage Tells the Charge
A lead-acid battery wears its state of charge on its sleeve. As it discharges, the acid is used up and gets thinner, and the rest voltage falls with it in an almost straight line: about 12.85 V when full, 12.6 V at 75 %, 12.3 V at half and 12.0 V at a quarter. Below that comes a knee, and at 10.5 V the battery is empty. So a voltmeter is a usable fuel gauge here, as long as the battery has rested for a while or carries only a light load. The demo sketch does exactly this, and you can compare its guess with the true charge in the pop-up.
The second habit of this chemistry is less friendly. The capacity printed on the label, 7.2 Ah, is only true at the 20 hour rate, a gentle 0.36 A. Ask for the current faster and the battery gives less in total: 6.84 Ah at 0.684 A, 6.12 Ah at 1.224 A and only 4.08 Ah at 7.2 A, by the maker's own table. The simulation model follows that table, so a heavy load empties the battery sooner than its amp-hours suggest. The time left in the pop-up is worked out with it.
Charging follows its own rules as well. The battery takes most of its charge quickly, then less and less willingly over the last third, so at a fixed voltage the charge current tapers off by itself. About a tenth of what goes in is lost. And above roughly 14.7 V the extra current no longer charges anything: it splits water into gas, the valves open, and that water is gone for good.
No Protection Inside
The LiFePO4 battery of our 12V LiFePO4 Battery Library for Proteus Simulation carries a BMS that switches it off before anything bad happens. A lead-acid battery has nothing of the kind. It is six cells in a box. If a load stays connected, the battery simply goes on delivering until it is flat, and it goes on taking a charge for as long as a charger pushes.
Both hurt it. Below 10.5 V the plates start to turn into hard lead sulphate that never fully changes back, and a battery left flat for a few days may never recover its capacity. Above 14.7 V it gasses and slowly dries out. So the protection has to be outside: a low-voltage cut-off for the load and a voltage limit in the charger. The simulation shows what happens without them. It reports a DEEP DISCHARGE under 10.5 V and GASSING over 14.7 V, and it counts the amp-hours taken under 10.5 V and the amp-hours turned to gas, so you can see how much harm a design does.
Features of the 12V Lead-Acid Battery Library for Proteus Simulation
- The battery at true scale: the black case, 151 x 94 mm, with its white label, red band and two blade terminals; at run time the state and the charge left are written above it and the volts, amps and watts under it.
- A voltage that tells the charge: 12.85 V full, 12.3 V half, 12.0 V a quarter, a knee to 10.5 V at empty and a collapse below it.
- The maker's capacity table: 7.2 Ah at 0.36 A down to 4.08 Ah at 7.2 A, so a fast discharge ends sooner.
- A real charge: a taper over the last third, a tenth lost, and gassing above 14.7 V.
- No protection, as in the real battery: deep discharge and gassing are reported and counted, not prevented.
- A battery clock: the charge follows the current in real time or up to 7200 times faster.
- A pop-up: the six cells with the direction of the current, the voltage curve with its three limits and the working point, eight live values, graphs, an event log and a check page.
- A complete package: about 1.6 MB with the library, our hand crank generator, our Arduino UNO V4.0 and the demo, without the source code of the model.
The Lead-Acid Battery in Proteus
The device is LEADACIDBAT12V7TEP in TEPLEADACID.LIB, under Electromechanical > Batteries, with the prefix BAT and the analog model TEPLEADACID.DLL. Search LEADACID in Pick Devices. Its two pins are on the left, at the ends of the leads from the terminals: the red + and the black -. The properties are SOC (the charge at the start in percent), SPEED (the battery clock, 1 to 7200) and TEMP (the temperature of the battery, 25 °C; a cold battery holds less). The symbol is drawn to the battery's true size against our Arduino UNO, so it is more than twice as long as the board.
Download 12V Lead-Acid Battery Library for Proteus Simulation
Click the button below to download 12V-Lead-Acid-Battery-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):
12V Lead-Acid Battery Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPLEADACID.LIB,TEPCRANK.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPLEADACID.DLL,TEPCRANK.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch.
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install 12V Lead-Acid Battery Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPLEADACID.IDXfrom the LIBRARY folder if it is there. - The demo also uses our INA219 Current Sensor Library for Proteus: install it from its own package (it is not in this zip).
- Start Proteus, press P and search for LEADACID.
Proteus Simulation of the Lead-Acid Battery with Arduino
The demo has our Arduino UNO Library for Proteus V4.0 with its built-in monitor, the same window as our TEP Serial Monitor Advance for Proteus, on an A3 sheet. It is the same bench as in the LiFePO4 tutorial, on purpose, so that you can compare the two batteries. The battery, BAT1, starts almost empty, with 5 % of its charge, and its SPEED is 3600, so one simulated second is an hour for the battery. Its + goes through the 0.1 ohm shunt of our INA219 (U1, its pop-up version) to a net called BUS. On that bus sit a 22 ohm resistor (R1), which stands for a 12 V lamp of about 7 W, and our hand crank generator (HC1) from the Hand Crank Generator Library for Proteus Simulation, which is the charger. The crank follows its own demo: 30 turns a minute from 0.3 s, 60 from 2.3 s, 90 asked from 4.3 s, 60 again from 6.3 s, and the hand lets go at 8.3 s. Open Lead-Acid-Battery-Crank-INA219-ArduinoUnoV4.pdsprj.
The Sketch
The INA219 sits between the battery and the bus, so it sees the battery's current in both directions. The sketch reads its two voltage registers straight over I2C, with no library; a current out of the battery comes out positive and a current into it negative:
amps = shuntV / SHUNT_OHM; // + out of the battery, - into it
volts = busV + shuntV; // the battery's own terminals
Because the battery has no protection, the sketch is its guard. Under 10.5 V the LED on pin 13 lights as an alarm, and the monitor says so in plain words:
digitalWrite(LED, volts < LOW_VOLTS); // the alarm: nothing inside the battery will stop the load
While the battery is discharging, the sketch also reads the charge left from the voltage alone. The function holds the rest voltages of a 12 V lead-acid battery and draws straight lines between them:
static const float V[5] = {11.75, 12.00, 12.30, 12.60, 12.85};
static const int P[5] = {10, 25, 50, 75, 100};
Beside that it counts the amp-hours, twenty times a second. The constant CLOCK is 3600, the same as the battery's SPEED; with a real battery it would be 1:
if (lastAt) ampHours -= (amps + lastAmps) / 2 * (now - lastAt) / 1000.0 * CLOCK / 3600.0; // the coulomb counter
You can type reset to forget the amp-hours or rate 1000 to report once a second.
Lead-Acid Battery Simulation Results
Open the project and press Run. The demo runs about 10 simulated seconds, which are ten hours for the battery; with the pop-ups open and the pictures being taken it took about three minutes on our PC. Click the battery for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
An Almost Empty Battery
The run starts with the lamp on and nothing to charge the battery. At 0.25 s the pop-up shows 3 % left, 0.23 Ah, and the battery is already on the knee of its curve: 11.24 V at 0.51 A, 5.7 W into the lamp, about 26 minutes from empty. The six cells are drawn almost empty and in red. On the right the box that held the BMS in the lithium battery says NO BMS, with two lamps for the two things that harm this battery: too low a voltage, and gassing.
Flat, and Nothing Stops It
At 0.970 s the charge is used up and the voltage falls through 10.5 V. The Event log writes two warnings, FLAT and DEEP DISCHARGE, at 10.47 V. With the lithium battery this was the moment the BMS opened. Here nothing happens: the lamp stays connected and the battery goes on feeding it while its voltage collapses. At 1.95 s the terminals are at 9.13 V, each cell at 1.52 V, and the battery still gives 0.03 A beside the slowly turning hand crank. It has delivered 0.43 Ah, and 0.08 Ah of that were taken under 10.5 V, which the last tile counts as harm. On the monitor the sketch has raised its alarm, and the UNO's LED is lit.
The Hand Crank Charges It Back
At 2.3 s the hand speeds up to 60 turns a minute and the crank's voltage rises above the battery's. Current flows in at once, 0.77 A at 11.31 V at 2.75 s, and the voltage climbs back up the knee. At 3.7 s the battery holds 11 % and takes 0.69 A at 11.98 V. In a simulation the battery comes back as if nothing had happened. A real one that has been driven flat may have lost some capacity for good, which is why the model keeps the count of that harm on the Check page until the end of the run.
Charging from the Hand Crank
At 4.3 s the demo asks the hand for 90 turns a minute. The hand reaches its limit at 67 turns a minute, where the generator gives 12.39 V at 1.46 A, 18.1 W, for 49.1 W of work from the hand. The lamp takes its share and the battery gets the rest: 0.90 A in at 12.30 V, 11.0 W, at 5.2 s. The charge has risen to 26 %, each cell is at 2.05 V, and the banner says about 6 h 37 min to full. The dot of the terminals sits above the ring of the rest voltage: a charging battery shows more than its rest voltage, a discharging one less.
The INA219 measures the same current with its sign. Its pop-up shows 12.388 V on the bus, -89.57 mV across the shunt and -895.7 mA: negative, because the current flows from the bus into the battery. Its Power register still shows a positive 11.094 W. The pop-up of the hand crank generator, taken at the same moment, shows the other end of the same wire.
Half Full, Then the Hand Lets Go
At 6.3 s the hand eases off to 60 turns a minute and the charge current falls to 0.64 A at 12.44 V, with 45 % in the battery at 7.2 s. The Event log marks 25 % charged at 5.170 s and 50 % at 7.823 s. At 8.3 s the hand lets go, with 52 % in the battery, and the battery takes over the lamp. At 9.45 s it gives 0.55 A at 12.20 V with 45 % left, 3.23 Ah. Now look at the monitor's last line: from the voltage alone the sketch says about 43 %. That is the gift of this chemistry. A voltmeter and a small table are enough for a fuel gauge, a little low under load and a little high while charging.
A Full Battery and a Charger Without a Limit
The demo never fills the battery, so we made a second simulation run with one change: SOC set to 99. The hand crank is a charger without a voltage limit. As the battery fills, it takes the current less and less willingly and the voltage at its terminals climbs. The Event log writes GASSING at 4.392 s and OVERCHARGE at 5.127 s, at 15.05 V. At 5.2 s the pop-up shows 15.06 V, 2.51 V a cell, and of the 0.77 A that flow in, 0.60 A only make gas; 0.35 Ah have been turned to gas by then. At 6.229 s the battery is full and the current still flows in, at 15.13 V. Nothing inside stops it. A lithium battery's BMS would have opened; this battery just vents. That is why a charge controller with a voltage limit belongs between a generator and a lead-acid battery.
The Graphs, the Event Log and the Check Page
The Graphs page plots the charge left, the voltage at the terminals, the current and the power over the last 2, 6 or 15 simulated seconds; a charge shows as a negative current and a negative power. The Event log keeps every change between charging, discharging and resting with the time left, a mark at every quarter of the charge, and the warnings. The Check page sums up the run: 1.07 Ah (12.5 Wh) out and 4.41 Ah (53.6 Wh) in, 9.02 V as the lowest voltage at the terminals and 12.54 V as the highest, no gassing, and in red the 0.09 Ah that were taken under 10.5 V.
The monitor tells the same story from the Arduino's side. It prints the low-voltage alarm while the battery is flat, with the counter at -0.33 Ah, and ends at +3.60 Ah. When the battery takes over the lamp, at 12.27 V, the sketch reads about 48 % from the voltage; the battery's own count at that moment was 52 %.
Try It Yourself
- Set SOC to 99 and run the demo again: the crank overcharges the battery and it gasses, as in our second run.
- Change R1 to 4.7 ohm with SOC at 100 and watch the time left in the pop-up: at about 2.6 A the battery promises about two hours, not the 2 h 46 min that 7.2 Ah divided by the current suggests.
- Set TEMP to -10 and compare the time to empty: a cold lead-acid battery holds clearly less.
- Click 50 % in the pop-up and read the voltage at the terminals with a light load: about 12.3 V, as the table says.
- Click Clock x 1 to see the battery in real time: a 7.2 Ah battery hardly moves in ten seconds.
Ideas to Extend the Demo
- Let the sketch switch the load off with a relay or a MOSFET at 10.5 V, and on again at 12.0 V: a low-voltage disconnect, the protection this battery lacks.
- Add a charge controller with a 14.4 V limit between the crank and the battery, and watch the gassing disappear.
- Show the voltage, the guessed charge and the counted amp-hours side by side on an LCD.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real Lead-Acid Battery
- Recharge it straight after use: never store it discharged; a flat lead-acid battery sulphates within days.
- Charge at the right voltage: 14.4 to 15.0 V for daily cycling, 13.5 to 13.8 V on standby, with the current limited to 2.16 A.
- Use half of it: a discharge to 50 % gives several times as many cycles as a discharge to empty.
- Add a low-voltage cut-off: nothing inside the battery will switch the load off at 10.5 V.
- Give it air: an overcharged battery vents hydrogen; never charge it in a gas-tight box.
Troubleshooting
- DEEP DISCHARGE: the terminals are under 10.5 V and the load is still on. Switch the load off and recharge.
- FLAT, a few volts only: the charge is used up. A charger brings the model back; a real battery may be harmed for good.
- GASSING: the charge voltage is over 14.7 V; the charger has no voltage limit. Use 14.4 to 15.0 V, or 13.5 to 13.8 V on standby.
- Less running time than 7.2 Ah suggests: 7.2 Ah holds at 0.36 A only; at 7.2 A the same battery gives 4.08 Ah.
- The charge hardly moves: at SPEED 1 a 7.2 Ah battery needs hours, as a real one does. Raise SPEED to 60 or 3600.
- The part is not simulated:
TEPLEADACID.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The capacities at five discharge currents, the internal resistance and the charge voltages are from a maker's sheet of a 12 V 7.2 Ah battery; the rest voltages follow the sellers' charts.
- Our own figures: the knee to 10.5 V and the collapse below empty, the rise of the resistance, the polarisation, the charge path and its taper, the gassing path above 14.7 V, the 90 % charge efficiency and the effect of the cold.
- Not modelled: the lasting harm of deep discharges and of gassing (they are reported and counted, but the battery does not age), the recovery of the voltage at rest after a fast discharge, the shift of the charge voltage with temperature, and the heat.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or any battery maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the 12V Lead-Acid Battery Library for Proteus Simulation. I hope it helps you try a battery project in a simulation before you wire a real battery: a voltage you can read the charge from, a capacity that depends on how fast you take it, and no protection at all, so that your own circuit has to provide it. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!























Comments
0