Close

Battery Under voltage Corner cases

A project log for Ember

A small battery-driven portable "bench" power supply

simen-sollihgdaSimen Sollihøgda 07/07/2023 at 07:060 Comments

Ember's battery, a li-ion batteries doesn't like to be completely drained. At least not below 2.5V; so the datasheet says. The software in the mcu, a RP2040, stops the battery from being drained by monitoring an ADC and disconnecting when the battery voltage gets below 2.85V. I do trust the mcu, but  I also really don't want the battery to be explosively mad. That's why I decided to run a few tests to see what happens when the undervoltage shutoff code is disabled. 

One Ember laying naked(no enclosure) on my desk with two other Embers trying to keep it alive. One connected to the battery terminal gradually decreasing the voltage, the other connected to the USB port, simulating a charger. It sure is nice to have a loot of power supplies around when working on a power supply.   

At around 2.7V bad things started to happen. The display suddenly darkened and the power draw from the battery(simulated) tripled. I also noticed, the hard way, that the 4.2V booster was hot. Not hot enough to instantly cause blisters, but hot. The 4.2V booster powers the backlight for the display and that why when it stopped working, the display darkened. The MCU is also powered by the 4.2V booster, and this is how I found the second bug of the day. 

When the booster stops working, and the voltage to the mcu drops everything freezes. The display stops updating and input is not registered, not even from the power off button. This is bad, the device should power off when the battery is low. RP2040 has a feature, it stops the code execution and gives an  error message. This is great for debugging when you want to know what just happened, not so great when you are battery powered and the mcu just sitting there waiting for someone to read the error message, slowly is destroying the battery. 

"Woff! Woff!" The watch dog timer does still work when the processor stops execution. When enabled the watchdog can be used to reset the mcu and power off the device. Enabling the watchdog timer took only a few lines of code and I think it may save me from other unexpected bugs as well. 

As for the 4.2V booster issue, I was using a inductor with a too small current rating and I think it go saturated. Replacing the inductor with one a higher current rating did at least fix the problem. 

Discussions