How to disable brownout detector in ESP32 in Arduino

If you power your ESP32, open your Serial Monitor, and see the ESP32 rebooting continuously, with the following message:

'Brownout detector was triggered'

Then you are probably providing insufficient power to the ESP32. It is generally observed in applications requiring higher power, like WiFi or BLE. The dictionary meaning of the term ‘brownout’ is

‘a reduction in or restriction on the availability of electrical power in a particular area’

Now, in some cases, your laptop may not be able to supply the required current. In some cases, your micro-USB cable may be the bottleneck. It can also be caused due to bad solder joints, or some power track issues. If possible, you can try with different hardware alternatives, and see if a particular combination works for you. However, if you don’t have that kind of flexibility, here’s what you can do to disable brownout detector in ESP32.

Include the following files:

#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"

Add the following line in the setup():

void setup() {
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable   detector
  //Your code
}

The soc.h file contains the WRITE_PERI_REG() function, and the rtc_cntl_reg.h contains the RTC_CNTL_BROWN_OUT_REG register.

This is essentially you telling the ESP32 to stop checking for insufficient power, and work with whatever power it got. Please note that this may not stop other errors like ‘Guru Mediation…’, etc. However, this hack has been proven to work in some cases.


Since you are here, you may find this course on Udemy, which explains how to link ESP32 with AWS IoT, to be quite interesting.

Also, please check out other posts on ESP32 on check out further posts on iotespresso.com.

3 comments

  1. many thanks, this solved my problem, Tried adding decoupling capacitors etc but this worked, thanks for the advice!

    1. Thanks for this…. this solved a long standing intermittent issue with a PWM motor controller, apparently the brown-out detection is too sensitive in this particular case…

Leave a comment

Your email address will not be published.