Improved low-battery shutoff for my DIY Ego-powered 12V supply
Part of the Project Logs series.
My DIY Ego-powered 12 volt power supply was generally a success. There was one bug: under load, when the battery voltage dropped below 42 volts, the low-voltage shutoff circuit would dutifully shut the system down — then, a small fraction of a second later, with the load suddenly gone, the battery voltage recovered and the circuit would flip the system back on. Then, milliseconds later, the voltage would drop, and the system shut off again. This would repeat forever.
This was, in hindsight, easily predictable.
I figured I needed a circuit that would shut down the system when the battery voltage dropped too low, then latch in the power-off state until it was reset. Simply enough, but I ran into 2 problems:
- Getting the circuit into a consistent, correct state at power up was not trivial
- The BOM for discrete parts I didn’t already have on hand was starting to get relatively long and expensive
So I gave up on implementing this logic with discrete components and bought an Arduino Nano Every. I chose this due to its combination of 5V supply & GPIO (meaning it is trivially compatible with the original circuit), small physical size, low power consumption, and adequate GPIO pins. There’s also an ADC, should I want to use that to sense battery level in the future.
I was able to retrofit it into the comparator-based system, using the following logic:
- Check the battery level comparator 5 times at start to be sure the battery is not too low before powering on the main relay
- Check the battery level comparator every second and shut off the main relay if the battery’s voltage is low 5 seconds in a row
- Illuminate a LED when the battery is low
- Once in the “low battery” state, put the Arduino into low power mode and stay there; the main relay and Arduino remain off until power is reset
The (very simple!) code for this is on GitHub.
While working on this retrofit, I also found that the relay I’d been using was probably undersized to handle the inrush current on the 12v buck converter1. I replaced that relay by a bulkier solid-state2 relay. A final schematic diagram follows:
(The pull-up resistor marked *
indicates I don’t remember what value I used here; just pick something appropriate, maybe around 20 kΩ, based on your relay’s datasheet and the desire to minimize power consumption.)