Chris Dzombak

sharing preview • dzombak.com

Improved low-battery shutoff for my DIY Ego-powered 12V supply

I fixed an issue with the low-battery shutoff circuit in my DIY Ego 12v power supply by replacing discrete logic with latching logic in an Arduino.

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:

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:

  1. Check the battery level comparator 5 times at start to be sure the battery is not too low before powering on the main relay
  2. 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
  3. Illuminate a LED when the battery is low
  4. 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:

ego-12v-supply-ssr

(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.)

  1. This discovery was made after two relays welded themselves in the “on” state. 

  2. I chose a solid-state relay not because it was necessary for this application, but because Amazon could have a suitably-sized SSR at my house the next day for pretty cheap, and I just wanted to get this project done.