Oliver Mattos Offers a Simple Circuit for Lithium Battery Control in Arduino and Other Projects

Driving a particular pin high allows the DW01, usually used simply to protect the battery, to act as a switch for battery-powered projects.

Gareth Halfacree
4 years agoHW101
The DW01 battery protection IC can be used as a switch, with a minor modification. (📷: Oliver Mattos)

Oliver Mattos has published a brief guide to making the common DW01 lithium battery protection IC act as an on-off switch for an Arduino or similar microcontroller project, by pushing a particular pin high.

"Battery powered things with a lithium battery are always a little complex. You have to handle not draining the battery when your device isn’t in use, not over-discharging the battery, and still being able to do whatever you wanted to do," Mattos writes. "A lot of use-cases can be handled by a sensor turning the circuit on, and the circuit turning itself off again when it’s done doing whatever needs doing. Here’s a trick to make that simpler and cheaper."

The trick works by exploiting a feature of the DW01 battery protection IC, found built into many batteries and power banks or available as a low-cost separate circuit. "You can trick the DW01 into turning your circuit off by raising it’s CS pin to high (specifically above 0.15 volts for 30 milliseconds)," Mattos explains.

"It will then turn your whole circuit off till either you disconnect your circuit, start charging the battery, or the CS pin goes low again. To make sure you don’t loose the overload protection of the DW01, you should drive the pin through a resistor between 3k and 20k.

"To turn things back on," Mattos continues, "either disconnect your circuit momentarily (for example through a push-to-break button), or pull the CS pin low (to the battery- pin, not to the ground of the rest of the circuit — they aren’t connected!) Bear in mind, if you want to pull the CS pin low, whatever circuitry you use to do that will not be protected by the DW01 - that means you won’t get the over-discharge protection , so things like switches are probably okay, but devices that use real power are probably a no-no."

Mattos' full write-up can be found on his website.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles