ESP32 Low Voltage Behavior
-
- Posts: 9
- Joined: Fri Jul 14, 2017 4:09 pm
ESP32 Low Voltage Behavior
Hello,
I am building a remote weather instrument using an ESP32 that needs to run on a battery.
I am using a D-sized 19AH lithium cell. I was getting reliability problems because of the current spikes when the ESP32 turns on it's radio and when it connects to a server.
So I added a super capacitor (1000 mF) and that got rid of the spikes, very nicely.
Now, if I connect the battery and the super capacitor has no charge (e.g., shorting the battery terminals before connecting the battery) everything works fine. It takes about 8 seconds for the super capacitor to charge to 3v and the esp32 starts up.
If however, I remove the battery, the esp32 will rundown the super capacitor and eventually the brown out detector will trigger then there will be a couple exceptions. The super capacitor voltage will drain down to about 1.2 v and hold pretty steady there.
Now if I insert the battery the super capacitor will charge up to more than 3 volts but the ESP32 won't start. If I do a reset at this point everything starts running fine.
So it seams when the voltage runs down the ESP32 is left in a state where just recovering the voltage won't start it up.
Do you have any suggestions on how to handle this?
I'd rather not have to tell my customers to short the battery terminals together before installing it. Or adding a reset switch and telling them to use that.
Thanks
I am building a remote weather instrument using an ESP32 that needs to run on a battery.
I am using a D-sized 19AH lithium cell. I was getting reliability problems because of the current spikes when the ESP32 turns on it's radio and when it connects to a server.
So I added a super capacitor (1000 mF) and that got rid of the spikes, very nicely.
Now, if I connect the battery and the super capacitor has no charge (e.g., shorting the battery terminals before connecting the battery) everything works fine. It takes about 8 seconds for the super capacitor to charge to 3v and the esp32 starts up.
If however, I remove the battery, the esp32 will rundown the super capacitor and eventually the brown out detector will trigger then there will be a couple exceptions. The super capacitor voltage will drain down to about 1.2 v and hold pretty steady there.
Now if I insert the battery the super capacitor will charge up to more than 3 volts but the ESP32 won't start. If I do a reset at this point everything starts running fine.
So it seams when the voltage runs down the ESP32 is left in a state where just recovering the voltage won't start it up.
Do you have any suggestions on how to handle this?
I'd rather not have to tell my customers to short the battery terminals together before installing it. Or adding a reset switch and telling them to use that.
Thanks
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: ESP32 Low Voltage Behavior
Wifive: I specifically look for your supporting posts each day, to learn something new, and this day is no different
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 Low Voltage Behavior
Erm, why would you use a super-capacitor for that? Those usually have a pretty high ESR and as such are rubbish at filtering out peaks. Why not put a few nice 22uF/16V ceramic caps (16V because ceramics usually derate with voltage close to their limit) in parallel instead, nice and close to the esp32?
I'm not entirely understanding why you need that supercap anyway, by the way: a LiIon by itself usually is pretty good at giving you all the current you need. Maybe the wiring you have is high-impedance (too thin/long) in some way?
I'm not entirely understanding why you need that supercap anyway, by the way: a LiIon by itself usually is pretty good at giving you all the current you need. Maybe the wiring you have is high-impedance (too thin/long) in some way?
Re: ESP32 Low Voltage Behavior
Hi jerry,
The very best thing you can do is use a "protected" Lithium battery (or add a lithium cell protection chip to the circuit you have). This will cut the battery off from the circuit when it reaches a low voltage threshold (usually 3.0V), and reintroduce it to the circuit when it charges back above this threshold.[*]
Over-discharging a lithium battery has two problems - one is that it takes the ESP32 below its minimum specified voltage range (2.2V), so unexpected things can happen (as you're seeing).
More importantly, though, recharging a lithium battery which has been over-discharged is dangerous - lithium batteries are damaged by over-discharge and can swell up or even explode on recharging.
(Also, I second Sprite's comment that a regular capacitor should be OK for smoothing out the voltage coming from the lithium battery. If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering. It's also possible the lithium battery is underperforming because it's been internally damaged, as per the comment above.)
Angus
[*] Using cell protection does some other nice things as well: protects a short circuit from starting a fire, protects against overcharging which will also damage the battery.
EDIT: Re-read the post and realised you only mentioned going below 3.0V when running from the supercap only, so apologies for overreacting if you're already handling the battery safely or using a protected cell.
The very best thing you can do is use a "protected" Lithium battery (or add a lithium cell protection chip to the circuit you have). This will cut the battery off from the circuit when it reaches a low voltage threshold (usually 3.0V), and reintroduce it to the circuit when it charges back above this threshold.[*]
Over-discharging a lithium battery has two problems - one is that it takes the ESP32 below its minimum specified voltage range (2.2V), so unexpected things can happen (as you're seeing).
More importantly, though, recharging a lithium battery which has been over-discharged is dangerous - lithium batteries are damaged by over-discharge and can swell up or even explode on recharging.
(Also, I second Sprite's comment that a regular capacitor should be OK for smoothing out the voltage coming from the lithium battery. If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering. It's also possible the lithium battery is underperforming because it's been internally damaged, as per the comment above.)
Angus
[*] Using cell protection does some other nice things as well: protects a short circuit from starting a fire, protects against overcharging which will also damage the battery.
EDIT: Re-read the post and realised you only mentioned going below 3.0V when running from the supercap only, so apologies for overreacting if you're already handling the battery safely or using a protected cell.
-
- Posts: 9
- Joined: Fri Jul 14, 2017 4:09 pm
Re: ESP32 Low Voltage Behavior
Hi ESP_Sprite,
Second is that the lithium battery I'm using delivers it's maximum capacity (19AH) drawing around 4ma. Drawing the ~100 ma needed for the ESP32 when it is running reduces it's capacity to around 9AH.
Using the super capacitor reduces the max current on the lithium to around 10 ma which should deliver a battery capacity of ~18 AH. And it smooths out the current spikes/voltage drops nicely.
I tried a variety of capacitors from 470 uF to 4700 uF but I didn't try a 22uF/16V.
Thanks for you comments,
Jerry
There are actually two issues. One I already mentioned, the current spikes and resulting voltage drops.ESP_Sprite wrote:Erm, why would you use a super-capacitor for that?
Second is that the lithium battery I'm using delivers it's maximum capacity (19AH) drawing around 4ma. Drawing the ~100 ma needed for the ESP32 when it is running reduces it's capacity to around 9AH.
Using the super capacitor reduces the max current on the lithium to around 10 ma which should deliver a battery capacity of ~18 AH. And it smooths out the current spikes/voltage drops nicely.
I tried a variety of capacitors from 470 uF to 4700 uF but I didn't try a 22uF/16V.
Thanks for you comments,
Jerry
-
- Posts: 9
- Joined: Fri Jul 14, 2017 4:09 pm
Re: ESP32 Low Voltage Behavior
ESP_Angus,
Thanks for you comments.
Jerry
I didn't mention it but the lithium battery is not a rechargeable battery.ESP_Sprite wrote:The very best thing you can do is use a "protected" Lithium battery
The traces are 20 mil wide of 1 oz copper, shouldn't that be good enough?ESP_Sprite wrote:If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering
Thanks for you comments.
Jerry
Re: ESP32 Low Voltage Behavior
Hi Jerry,jerrybarber wrote:ESP_Angus,
I didn't mention it but the lithium battery is not a rechargeable battery.ESP_Sprite wrote:The very best thing you can do is use a "protected" Lithium battery
The traces are 20 mil wide of 1 oz copper, shouldn't that be good enough?ESP_Sprite wrote:If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering
Right, I understand now. If your particular battery has very high ESR and require very smooth current draw then your choices make sense. I was not aware that you could get single-use lithium batteries with that kind of high capacity, that's very interesting!
Angus
-
- Posts: 9
- Joined: Fri Jul 14, 2017 4:09 pm
Re: ESP32 Low Voltage Behavior
Angus,
Thanks for you help,
Jerry
Yes, they are available from several vendors, the chemistry is lithium-thionyl chloride. The come in a D cell format.ESP_Angus wrote:I was not aware that you could get single-use lithium batteries with that kind of high capacity, that's very interesting!
Thanks for you help,
Jerry
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], lxkxst and 116 guests