ESP32 Low Voltage Behavior

jerrybarber
Posts: 9
Joined: Fri Jul 14, 2017 4:09 pm

ESP32 Low Voltage Behavior

Postby jerrybarber » Thu Apr 05, 2018 11:16 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 Low Voltage Behavior

Postby WiFive » Fri Apr 06, 2018 12:10 am


User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: ESP32 Low Voltage Behavior

Postby Vader_Mester » Sat Apr 07, 2018 8:00 am

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);
}

ESP_Sprite
Posts: 9836
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Low Voltage Behavior

Postby ESP_Sprite » Sun Apr 08, 2018 2:09 am

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 Low Voltage Behavior

Postby ESP_Angus » Mon Apr 09, 2018 1:37 am

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.

jerrybarber
Posts: 9
Joined: Fri Jul 14, 2017 4:09 pm

Re: ESP32 Low Voltage Behavior

Postby jerrybarber » Mon Apr 09, 2018 5:31 pm

Hi ESP_Sprite,
ESP_Sprite wrote:Erm, why would you use a super-capacitor for that?
There are actually two issues. One I already mentioned, the current spikes and resulting voltage drops.

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

jerrybarber
Posts: 9
Joined: Fri Jul 14, 2017 4:09 pm

Re: ESP32 Low Voltage Behavior

Postby jerrybarber » Mon Apr 09, 2018 5:38 pm

ESP_Angus,
ESP_Sprite wrote:The very best thing you can do is use a "protected" Lithium battery
I didn't mention it but the lithium battery is not a rechargeable battery.
ESP_Sprite wrote:If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering
The traces are 20 mil wide of 1 oz copper, shouldn't that be good enough?

Thanks for you comments.
Jerry

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 Low Voltage Behavior

Postby ESP_Angus » Tue Apr 10, 2018 5:39 am

jerrybarber wrote:ESP_Angus,
ESP_Sprite wrote:The very best thing you can do is use a "protected" Lithium battery
I didn't mention it but the lithium battery is not a rechargeable battery.
ESP_Sprite wrote:If it's very "spikey", maybe look into using shorter/thicker wires between the battery and the circuit it's powering
The traces are 20 mil wide of 1 oz copper, shouldn't that be good enough?
Hi Jerry,

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

jerrybarber
Posts: 9
Joined: Fri Jul 14, 2017 4:09 pm

Re: ESP32 Low Voltage Behavior

Postby jerrybarber » Tue Apr 10, 2018 4:10 pm

Angus,
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!
Yes, they are available from several vendors, the chemistry is lithium-thionyl chloride. The come in a D cell format.

Thanks for you help,
Jerry

Who is online

Users browsing this forum: No registered users and 98 guests