Sub topic 14
Battery safety: polarity, shorts, and lithium protection
This chapter assumes you know Ohm's law, can build a breadboard circuit, and have read the earlier chapters on battery chemistries, ratings, and internal resistance. Those chapters explain why a battery can deliver very large currents. This one covers what that means for safety and how to protect your project and yourself.
Why battery safety is different from other electronics safety
A 9 V battery or a single lithium cell cannot shock you through dry skin. The hazard is stored energy, not voltage. A battery has very low internal resistance, so a short circuit lets a large current flow. That current heats wires, traces, and the battery itself.
A rough example makes this concrete. A LiPo cell at 3.7 V with 50 mΩ of internal resistance, shorted with a thick wire, can in principle deliver:
I = V / R = 3.7 V / 0.05 Ω = 74 A
Real wiring, contacts, and the cell's voltage sag reduce this, but the order of magnitude explains why a shorted cell can melt insulation in seconds. The heat produced is I² × R, so doubling the current quadruples the heating.
Lithium cells add a second hazard. They contain a flammable electrolyte. When a cell is overheated, overcharged, over-discharged, or physically damaged, it can vent hot gas and catch fire. This failure is called thermal runaway: heat causes internal reactions that produce more heat.
The three common failure modes
| Failure | Cause | Typical result |
|---|---|---|
| Reverse polarity | Battery or supply connected backwards | Dead regulator or microcontroller, sometimes smoke |
| Short circuit | Low-resistance path between + and − | Hot wires, melted insulation, damaged cell |
| Cell abuse (lithium) | Overcharge, over-discharge, overcurrent, puncture | Swelling, venting, fire |
Polarity: protecting against a backwards battery
Most boards and regulators have no protection against reversed supply. Connecting a battery backwards sends current through parts in the direction they were never meant to carry. The first defense is mechanical: use keyed connectors (JST-PH, barrel jacks, battery holders with a fixed orientation) so a reversed connection is impossible. Do not use bare jumper wires on a battery that you plug and unplug often.
When you cannot guarantee orientation, add electrical protection. There are three common options.
- Series diode. Place a diode such as a 1N5817 Schottky in series with the positive line. It blocks reverse current. The cost is the forward voltage drop, roughly 0.3 V for a Schottky and 0.7 V for a silicon diode, and the power lost is Vf × I. At 500 mA, a 0.3 V drop wastes 0.15 W. This drop also eats into your dropout margin on a battery-powered design.
- Shunt diode with a fuse. Place a diode across the supply, reverse-biased in normal use, with a fuse in series. A reversed battery forward-biases the diode, which conducts heavily and blows the fuse. This has no normal-operation voltage drop but destroys the fuse each time.
- P-channel MOSFET. Place a P-channel MOSFET in the positive line with its gate to ground. When polarity is correct, the MOSFET turns on and drops only I × R_DS(on), often a few millivolts. When reversed, it stays off. This is the efficient choice for battery projects.
Short circuits: fuses and current limiting
Short circuits happen in prototypes through loose wires, metal tools, bent component leads, and conductive surfaces under a board. Three habits prevent most of them.
- Insulate exposed battery terminals and leads. Never carry loose cells in a pocket with keys or coins.
- Connect the battery last when wiring, and disconnect it first when changing the circuit.
- Fit a fuse or resettable fuse (PTC) in series with the battery.
Choose the fuse so it protects the wiring and the cell, not only the load. Pick a rating above your maximum normal current but below the cell's maximum discharge rating and below the current the wire can carry safely. A PTC fuse (polyfuse) raises its resistance as it heats and resets after it cools. It trips slowly, so it limits sustained overload but does not stop an instant dead short as fast as a glass fuse does. Also remember that a PTC adds series resistance, which causes a small voltage drop.
Wire gauge also matters. Thin jumper wires are fine for 100 mA but can heat noticeably at several amps. For a motor or high-power load, use wire rated for the current you expect to see.
Lithium cells: what protection they need
Lithium-ion and LiPo cells have a narrow safe operating window. A single cell is typically safe between about 3.0 V and 4.2 V. Outside that window, damage and risk increase.
| Condition | Threshold (single cell) | Consequence |
|---|---|---|
| Overcharge | Above 4.2 V | Heating, gas, possible fire |
| Over-discharge | Below about 2.5 to 3.0 V | Permanent capacity loss, internal damage, unsafe to recharge |
| Overcurrent | Above the cell's rated discharge | Overheating, voltage collapse |
| Overtemperature | Charging below 0 °C or above about 45 °C | Lithium plating or accelerated aging |
Protection against these conditions is built into well-made batteries or added externally.
Protection circuits
A protection circuit module (PCM or BMS for multi-cell packs) sits between the cell and the load. It typically uses a protection IC and two MOSFETs to disconnect the cell when it detects:
- Over-voltage during charging (cutoff near 4.25 V)
- Under-voltage during discharge (cutoff near 2.5 to 3.0 V)
- Overcurrent or a short circuit
Many commercial 18650 cells and most small LiPo packs for hobby boards include this circuit. Bare "unprotected" cells do not. If you buy unprotected cells, you must add a protection board yourself.
Charging
Charge lithium cells only with a charger designed for their chemistry. Lithium charging uses constant current until the cell reaches 4.2 V, then constant voltage while the current tapers. A dedicated charger IC such as the TP4056 (single cell, 1 A maximum) handles this. Set the charge current to no more than 1C, where C is the capacity in amps. For a 1000 mAh cell, that is 1 A, and lower is gentler. Never charge a lithium cell with a bench supply set to a fixed voltage and no current limit, or with an alkaline or NiMH charger.
Do not charge unattended on a flammable surface. Charge in a place where a fire would not spread, and ideally on a ceramic or metal surface.
Handling and storage
- Do not use cells that are swollen, dented, punctured, or hot to the touch. Swelling means internal gas is building up.
- Do not charge a cell that has been over-discharged below about 2.5 V unless the charger specifically supports recovery. Retire it instead.
- Store at roughly 40 to 60 percent charge (about 3.8 V per cell) for long periods, in a cool place.
- Do not solder directly to a cell body. Use cells with tabs, or a holder.
- Dispose of lithium cells at a battery recycling point. Tape the terminals first.
Watch the connector wiring
Hobby LiPo packs from different vendors use JST connectors with different polarity on the same plug shape. Always check the red and black wires against the markings on your board, not the plug shape alone. A reversed LiPo into a board is a very common way to damage a project.
Other chemistries
Alkaline cells can leak corrosive potassium hydroxide when fully discharged or when mixed with different cells. Replace all cells in a pack together and remove them from equipment you will store. Never try to recharge standard alkaline cells. NiMH cells are tolerant but still short-circuit hard, so they need the same fuse and insulation practices. Do not mix old and new cells, or different chemistries, in one series pack, because the weakest cell can be driven into reverse polarity as the pack discharges.
A practical protection layout
The diagram shows a typical protected supply for a single-cell lithium project.
Not every project needs every stage. A protected cell, a keyed connector, and a fuse cover most hobby builds. Add the MOSFET when users or you will swap batteries often.
A firmware cutoff for lithium
Protection circuits cut power abruptly. A software cutoff lets your project shut down cleanly first. The Python snippet below shows the decision logic you would port to your sketch. It uses a hysteresis band so the project does not bounce on and off as voltage recovers after load is removed.
LOW_CUTOFF_V = 3.3 # stop work and sleep below this
RESUME_V = 3.6 # do not resume until above this (hysteresis)
def next_state(state, v_battery):
"""Return 'run' or 'sleep' given the current state and battery voltage."""
if state == "run" and v_battery < LOW_CUTOFF_V:
return "sleep"
if state == "sleep" and v_battery > RESUME_V:
return "run"
return state
state = "run"
for v in [3.9, 3.5, 3.29, 3.4, 3.55, 3.65]:
state = next_state(state, v)
print(v, state)Running it prints run for 3.9 and 3.5, sleep for 3.29, 3.4, and 3.55, and run again at 3.65. The gap between 3.3 V and 3.6 V is deliberate. Under load a cell sags, and when you stop drawing current it rises again, so a single threshold would cause rapid toggling.
Practical checklist
- Use keyed connectors and verify polarity with a multimeter before first connection.
- Add a fuse or PTC sized between normal peak current and the cell or wire limit.
- Use protected lithium cells, or add a protection board to bare cells.
- Use a charger designed for the chemistry and set to 1C or less.
- Cut off in firmware well above the protection IC's threshold.
- Inspect cells for swelling or damage before each use, and retire damaged ones.
Exercise
A 3.7 V LiPo cell with 80 mΩ of internal resistance is accidentally shorted with a wire of negligible resistance. Estimate the peak current, then explain why a 500 mA PTC fuse alone may not prevent damage in the first instant, and name a better option for stopping an instantaneous short.
Show answer
The peak current is about 3.7 V / 0.08 Ω = 46 A. A PTC fuse needs time to heat up before its resistance rises, so it does not react to the first moments of a dead short, and the cell and wires can overheat before it trips. A better option is a protected cell whose protection IC and MOSFETs disconnect on overcurrent within milliseconds, or a fast-acting fuse sized for the circuit, ideally both.
Exercise
You add a 1N4007 silicon diode (0.7 V drop) in series with a 2-cell alkaline pack (3.0 V nominal) feeding a 3.3 V regulator with a 3.3 V output. Why is this a poor choice, and what would you use instead?
Show answer
After the diode, only about 2.3 V reaches the regulator, which is below the 3.3 V it must output, so it cannot regulate. Even with fresh cells the design fails. Use a P-channel MOSFET reverse-polarity protector, which drops only millivolts, or a keyed connector that makes reversal impossible. A Schottky diode (about 0.3 V) would be better than silicon but still wastes voltage.
Exercise
Why should firmware shut down at about 3.3 V when a lithium protection circuit already cuts off at around 2.5 to 3.0 V?
Show answer
The protection circuit is meant for emergencies and abrupt cutoff can corrupt data, leave outputs in unsafe states, and push the cell close to damaging depths of discharge. A firmware cutoff above the protection threshold gives a controlled shutdown and keeps the cell in its healthy range, and the protection IC remains as a backstop.