Minimize “Brownout detector was triggered” ESP32

Hello,

I developed a custom board for a ESP32 and I'm getting problems with the brownout detector when I try to work with the WIFI.

I know it's a matter of hardware but I can't get rid of the problem, so in the meanwhile I find the solution with different capacitors and so on, I'd like to know if there is any way to minimize the problem by coding in some specific way or if there are any tips I should take into consideration (i.e. changing speed of the processor or whatever)

What I try to do is to start the WIFI in WIFI_MODE_APSTA both AP and WIFI comnnected device.

The part of my code related to WIFI is as follows:

class CaptiveRequestHandler : public AsyncWebHandler {
public:
  CaptiveRequestHandler() {}
  virtual ~CaptiveRequestHandler() {}

  bool canHandle(AsyncWebServerRequest *request){
    //request->addInterestingHeader("ANY");
    return true;
  }
  void handleRequest(AsyncWebServerRequest *request) {
    request->send(SPIFFS, "/index.html", "text/html", false, processor);
  }
};


begin_wifi()
{
WiFi.mode(WIFI_MODE_APSTA);

  // Access Point
  WiFi.softAP("XXXX", "12345678");
  dnsServer.start(53, "*", WiFi.softAPIP());
  server.addHandler(new CaptiveRequestHandler()).setFilter(ON_AP_FILTER);//only when requested from AP
  Serial.println("Building up Access Point...");
  IPAddress IP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(IP); 
  
  // WiFi
  
  if(_ssid=="")
  {
    Serial.println("Undefined SSID. Not possible to connect to WIFI");
    return false;
  }
  else
  {
   
    WiFi.begin(_ssid.c_str(), _pass.c_str());
    Serial.println("Connecting to WiFi...");

    unsigned long current_time = millis();
    previous_time = current_time;

    while(WiFi.status() != WL_CONNECTED) 
    {
     current_time = millis();
      if (current_time - previous_time >= Delay) 
      {
        Serial.println("Failed to connect.");
        return false;
      }
    }
  }
}

Get a better power supply.

disable brown out detection.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/index.html

Disabling the brownout detector won't solve the voltage drop.

Is there a way to minimize the voltage drop by coding in a specific way?

power supply issue. I'd get a better power supply.

Perhaps sharing the schematic and power supply things might move things along.

Thanks for trying to help. I'll post another question in the hardware section with the schematic and will wait if anybody answers my question here.

Don't. You'll likely be reproved by the mods for creating a separate, but related, thread - which will then be merged into this one. Just keep everything here.

1 Like

A good power supply + serious electrical connections + good decoupling = no brownout

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.