Hey guys,
I have a circuit powered in 12V for my sensors, and a module that converts into 3.3V for my ESP32. I would like to integrate a super capacitor in case of any short power shut down. I think I can put it after the converter, right? Given I need 3.3V to maintain my ESP32, which super capacitor would you recommend in case of no power for let's say 5-10 sec?
Thanks
Please post a preliminary schematic showing your planned design. Be sure to include all parts, their values, and any relevant details such as times.
The supercapacitor must be At least 5 F.Voltage rating should be 5V or higher.
For a few seconds it could work. You should think in a diode in series with the supercap, to avoid that the current goes back from the capacitor when you have 0V in the power line. But depending on the regulator could be that it already has a diode. Which converter is it?
But it would be more effective to put a regulator from 12v to 5V, then a supercap of 5.5V and about 5F, and then an LDO from 5V to 3.3V.
This way the capacitor would charge to 5V and deliver its charge from 5V down to 3.0V. This will give a lot more margin than charging the capacitor only to 3.3V.
If you don't use wifi a lot, it will survive even hours with 5F.
C dV = It 5F * (5V-3V) = 10 amp seconds
so how long it will hold for depends on the current drawn; but certainly it will cover a few seconds of drop out.
As you dont need such a big value you may be able to find a less expensive option.
I have a similar system with a small solar panel, 2 cheap supercaps of 5F and an ESP32-3C, sending data via WIFI once per hour. And it survives almost 2 days sending data without any sun, even with the panels disconnected.
Two of this (5F, 5.5V) that cost about 3€ each:
It's running for a year now. It's surprising how with so little you can still do some things
I monitor the voltage of the supercaps:
Actually during the day it sends data every 15 minutes. And when the voltage level goes below 4.8V it sends every one or two hours. Never run out of power.
My program is in deepsleep for 2h and works for a few seconds to get the data from the sensor and send them by WiFi.
I don't mind spending a few $ on a supercap if I can save a few hours of drive to travel to restart them.
I'm starting in electronics so would you mind @stonemk doing a quick schematic of what you propose with the diode...? If you have time of course. If not, never mind, I will do some search.
I'm using the module XL4005 from ICQUANZX to convert 12V to 3.3V:
@stonemk Your project sound great. I didn't know it can last for so long with these supercaps. In my case, since I need to get sensors data (running at 12V), I have to use supercaps of 15V! But I could certainly add your supercaps of 5F, 5.5V in my other projects. Would you mind sharing your schematic with me?
Thanks!
In my case is different because I have a solar panel with variable voltage. But in your case I mean something like this:
D1 would prevent that the current of the supercaps goes back when you have 0V at the connector. But as said, probably you don't need it, because the regulator U1 will already block the back current. You should check or test it.
You could also need a small resistor in series with D2, to limit the charge current. Otherwise the caps will drag a lot of current when they are empty, like a short to GND. But again, could be that the regulator limits the current and you don't need to worry.
But in this case, even if the ESP32 loses the power it's not a problem. It will boot when the power is back and continue working.
You could also consider 3 or 4 small cylindrical Li-ion batteries. Even without a charger they will last years as backup power. The AAA size (10440) or AA (14500) cost about 3€ each.
Or one battery and a boost converter. I suppose that the sensors need small current.
Sorry but I don't see D2 in your schematic. Where would you put this resistor?
I'm not sure if it's doing that for me. Sometimes program stops, not sure why. When that happens, I have to manually press the RESET button. I don't think there's something I should add to my program so that it restart automatically when power is back, right?
Sensors actually need 12V. So just curions, what would you recommend for the boost converter?
Thanks a lot @stonemk
D1
Then you have to solve this first. You have something wrong, and any capacitor or battery will help with that.
The MCU should boot normally after power loss.
You're right, I will work on that too.
Concerning the resistor, would you put it before or after D1? and which value would you use?
And for D1, is this one fine?
Thanks
To save power, you might consider using an ideal diode
MAX40200
LM66100
The ESP can use alot of current when transmitting and receiving
I have noticed, WRT my own paper designs, that a lot of "backup power" designs tend to grow in complexity to the point where I wonder whether a better idea might be to simply put in a non-rechargeable battery. Something like a couple of CR2032 cells is likely to last several years if only called upon to provide power "occasionally", you can replace them from the local grocery store, and they're probably cheaper than a super-cap.
(They do have their own design issues. IIRC, a "standard" diode might have a high enough leakage current to damage such cells...)
Thanks for the info @jim-p . There's always something new to learn! Seems better indeed.
But you don't need any supercapacitor or battery, at least not now.
If you program runs only once every 2 hours, and you can have a power loss of a few seconds time to time, just fix the hang problem and it will be fine. The MCU will boot and continue working when the power is back.
If you don't fix the problem, it will not work regardless of the supercaps or batteries that you add.
Good point
If power outages and power glitches are a problem, you may need some additional circuitry to make sure the ESP is reset properly.
Again, after reading more, I think you're right @stonemk . Can you confirm the "Reset" part is not configured for automatic reset:
I think it should be more like this, right?
Thanks for your help