Brownout Detection on WiFi start... sometimes

lloydrichards
Posts: 6
Joined: Sun Sep 20, 2020 1:12 pm

Brownout Detection on WiFi start... sometimes

Postby lloydrichards » Fri Sep 25, 2020 8:35 am

I've been developing an IoT sensor around an ESP32 WROOM-32D and with the latest PCB design I've started to get a brownout detection sometimes when the WiFi is started up. I've got a link to the full OSH project in my git repo bellow but I'll include some pictures below for reference.

https://github.com/lloydrichards/mimirOpen

The pseudo code looks like:

Code: Select all

RTC_DATA_ATTR int bootCount = 0;

void setup{
mimir.initSensors();
mimir.readSensors();

if(bootCount % 3 == 0){
mimir.logData();
mimir.WiFiON(); //Connects to wifi using saves creds
mimir.sendData();  //http send of data to server
mimir.WiFiOFF(); //Disconnects from wifi to save power
}
bootCount++;
mimir.Sleep(); //turns off everything and goes to deep sleep for 5min
}


Not always, but usually within a couple of hours of the device successfully going through this loop does the brownout detection trigger and the device crashes. Sometimes this results in the device resetting and then it starts back up again, but other times it causes everything to crash or freeze resulting in the device needing to be plugged back in before it can be restored.

My hack solution has been to turn off Brownout Detection right before I turn on the wifi and this seems to work, but there is obviously something wrong with my hardware that I'm just not able to figure out.

Below I've attached the power section of my schematic and the PCB layout. The thick traces are 20mil and the thin ones are 10mil. And the two capacitors after the switch are my power filters (1uF and 100nF) before feeding into the ESP32.

If anyone has any ideas I'm all ears at the moment, as I'm a little lost on what to try next with the next hardware review.
Attachments
pcbDesign.png
pcbDesign.png (199.39 KiB) Viewed 6330 times
schematic.png
schematic.png (78.62 KiB) Viewed 6330 times

boarchuz
Posts: 559
Joined: Tue Aug 21, 2018 5:28 am

Re: Brownout Detection on WiFi start... sometimes

Postby boarchuz » Fri Sep 25, 2020 10:03 am

Couldn't hurt to use bigger caps either side of the HT7833, but most importantly, that little switch is in series with the ESP32 (and is rated for just 50mA @ 12v). This must go.

If there's nothing on the 3V3 rail that needs to remain powered when your device is "off", I'd suggest moving the switch to the HT7833 EN pin (which will also reduce the battery drain while off), otherwise move it to WROOM EN. A voltage supervisor on the latter should correct the 'stuck' startup you're seeing sometimes.

lloydrichards
Posts: 6
Joined: Sun Sep 20, 2020 1:12 pm

Re: Brownout Detection on WiFi start... sometimes

Postby lloydrichards » Fri Sep 25, 2020 12:54 pm

Makes sense to move the switch to EN on the LDO. I'm a little unsure what you mean about a voltage supervisor on the WROOM EN pin though. Currently, I have a 100nF cap and 10K res before the reset button as per the design documentation but do I need something else in there too?

boarchuz
Posts: 559
Joined: Tue Aug 21, 2018 5:28 am

Re: Brownout Detection on WiFi start... sometimes

Postby boarchuz » Sat Sep 26, 2020 7:35 am

It's not always necessary, depending on the nature of the power supply and the required behaviour. There's a section in the ESP32/WROOM datasheet about it.

Given that you're experiencing startup issues on battery, and want it to recover reliably and without external intervention, a supervisor is worth considering.

lloydrichards
Posts: 6
Joined: Sun Sep 20, 2020 1:12 pm

Re: Brownout Detection on WiFi start... sometimes

Postby lloydrichards » Sat Sep 26, 2020 5:16 pm

Thanks, that's helped a lot I think. After doing some research (and watching some Andreas Spiess videos) I've gone with the TPS3839K33DBZR (2.94V dropout) and reworked the layout do things are a little more clear. While I'm doing a hardware review I've also added in an i2c fuel gauge for good measure.

For the caps on either side of the LDO, I've followed the datasheet on their recommendation but have also had a look at the XC6220,
AP2112K-3.3TRG1, and TLV75533PDBVR which I'll pick up and test alongside to see if maybe the LDO is also a problem. If you see any glaring mistakes in my schematic or layout, please let me know :)
Attachments
schematic2.png
schematic2.png (96.36 KiB) Viewed 6183 times
pdbLayout2.png
pdbLayout2.png (315.22 KiB) Viewed 6183 times

boarchuz
Posts: 559
Joined: Tue Aug 21, 2018 5:28 am

Re: Brownout Detection on WiFi start... sometimes

Postby boarchuz » Sat Sep 26, 2020 5:46 pm

I think the TPS3839 should be monitoring 3V3, not VBAT.

Also you need to swap VDD/Reset.

lloydrichards
Posts: 6
Joined: Sun Sep 20, 2020 1:12 pm

Re: Brownout Detection on WiFi start... sometimes

Postby lloydrichards » Sat Sep 26, 2020 6:01 pm

good catch. Thanks a lot!

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: Brownout Detection on WiFi start... sometimes

Postby becorey » Fri Oct 09, 2020 11:35 pm

I experienced this same problem on an esp32 board I designed. 500mA LDO to power the ESP32, it would brownout sometimes when connecting to wifi. I replaced the LDO with a power module rated for 1000mA, MUN12AD01-SH. Here is my board for reference: https://easyeda.com/coreymberman/esp32-programmer

Also your power supply capacitance is pretty low. The MUN12AD01-SH datasheet suggests using 22uF on VIN (usb 5V) and 47uF on VOUT.

Who is online

Users browsing this forum: No registered users and 64 guests