BatteryUndervoltageProtect.ino

Sketch containing the code that runs on the Arduino Pro Mini in this build. This code sleeps 99% of the time, waking up about every 4 milliseconds to check the voltage on the battery. If the voltage is high enough, then the MCU toggles the pins connected to the charge pump to keep the MOSFET turned on. If the voltage is below the set threshold, then the MCU goes to sleep forever, the charge pump discharges after a second or two, and the MOSFET stops conducting. The Arduino will not turn on again until either the battery is replaced or the reset button is pushed.

ino - 1.99 kB - 04/21/2018 at 18:27

Download

BabySwing.sch

EAGLE schematic file for the final circuit used in the project. Notes: I used a 3.3V Arduino Pro Mini, not an Arduino Uno R3 like in the schematic. Capacitor values were random values I had on hand. I think 0.1uF caps could replace all 4 of these capacitors with no change in functionality.

sch - 677.75 kB - 04/17/2018 at 14:13

Download