Go Down

Topic: ESP32 works powered by USB but reboots from power supply (Read 12243 times) previous topic - next topic


I have an ESP32 project up and running.  If I power it via the microUSB on the Heltec ESP32 DEVKIT board that I'm using, all is well.

If, however, I run 5V to the VIN pin on the Heltec, it boots up and then goes into a loop of continuously rebooting every 3 seconds, almost like a watchdog.

Could the absence of a serial port matter?  Does that block if there's no serial cable?

I have made sure each ground pin is grounded.  I even tried feeding 3.3v to the 3V3 pin, but that didn't make a difference of course.

What could be the difference? I'm using a benchtop power suppy with more then enough power.


BTW, I dug a little further.  It's rebooting in WiFi.begin(), and I'm guessing the watchdog but don't know for sure.

However, when powered by a little apple power brick it works fine.  Only when powered via the board pins does it reboot in WiFi.begin() which is a little odd!

Thanks in advance for any advice!  Here's the code - it doesn't make it to STEP3.

If I remove the USB cable -AFTER- it's connected to WiFi, it will CONTINUE to run from being powered by the VIN pin.

void ConnectToWiFi(const char * pszSSID, const char * pszPassword)
   lcdTop.setCursor(0, 0); lcdTop.print("STEP1");
   // attempt to connect to Wifi network:
   unsigned long start = millis();
   int status = WL_DISCONNECTED;
   while (false == WiFi.isConnected())
      lcdTop.setCursor(0, 0); lcdTop.print("STEP2");
      Serial.print("Attempting to connect to SSID: ");

      // Connect to WPA/WPA2 network.

      char * psz = const_cast<char *>(pszSSID);
      status = WiFi.begin(psz, pszPassword);

      for (int i = 0; i < 20; i++)
         lcdTop.setCursor(0, 0); lcdTop.print("STEP3");
         sprintf(szStatus, "%s: %s-%d", pszSSID, FriendlyTimeSpan(start, millis()).c_str(), status);
         if (WiFi.isConnected())
         lcdTop.setCursor(0, 0); lcdTop.print("STEP4");



Hard to imagine the watchdog would only come into play when powered from the VIN pin.

What is the power supply you are using when powering via the VIN pin?  I would suspect that first of all as being noisy or out of spec.  At WiFi.Begin there is going to be a large power draw to fire up the Wi-Fi part.  If you find any 5 volt supply on the VIN is causing a problem try adding say a 100uf cap solder on VIN and Gnd pins. 

Hope that helps.


The ESP32s are (very) sensitive to the type of the incoming supply.

ESP32s seem stable when WiFi is turned on and you have;

Min 470uF in the regulator input.
Min 470uF on the regulator output.
A low drop out regulator capable of circa 500mA.

Even when you do this when supplied with say a Lithium battery thats not at full charge you will still get the brownout when the WiFi turns on. 

The cause of the reset (watchdog) in this case is sent to the serial monitor on restart.

Its possible that in the future expressif might find a way of turning on the WiFi without generating such a large current pulse, 250mA or so, but for the moment I think they see it as a hardware issue caused by less than adequate power supplies and they do have a point I guess.
No PMs please, they dont get answered.



I think I've just hit the same issue with the ESP32 not working when powered from the V5 pin. I was wondering if you'd settled on a solution at all?

Many thanks



You can tell I'm just a user and not a moderator because I'm going to help you with knowledge rather than yelling at you for not posting source code.

I found most of these cases are power draw.  Starting the WiFi puts a large brief load on the power demands, and if you are marginal (running LEDs off USB power and then start WiFi) it will brownout.

The chip will sometimes, but rarely, detect it and warn.

Could be anything of course but that's my guess!  If your power is a big, ample, supply, it's likely not that.


Related to the original post, is this power supply sufficient to power an ESP-32 with a few peripherals?  When hooking it up, do I use the 5v or 3.3v pins?  From the other posts in this thread it appears that I should supply 5v to that pin and let the ESP-32 provide 3.3v to the rest of the circuit.


When I power the ESP32 with batteries (2X 188650 Li batteries wired in series), I supply the power to a small 5V regulator and apply the 5V to the ESP32 5V pin. I have a 10uF 50V electrolytic cap on both the input output of the regulator.


To avoid confusion an 'ESP32' would normally refer to an ESP32 bare module. An ESP32 bare module is a 3.3V device, it has no 5V pin.

I suspect that when some people say 'ESP32' they mean one of the various ESP32 breakout boards that have an ESP32 bare module and various other components such as a regulator, capacitors, switches etc. Most of these breakout boards accept a 5V input or can operate from a lithium battery. 
No PMs please, they dont get answered.


The cause of this problem appears that some ESP32 boards the USB chip is not powered from the Vin (VDD5V) pin (19) but from the VDDUSB with a diode between.  This is unlike the ESP8266 boards which are the opposite and is correct to enable the USB chip to be powered at 5v whether plugged into the USB or powered solely by the 5v input pin.  It would then cause DTR and RTS to be in an indeterminate voltage affecting EN and IO0 throwing the ESP into a reboot when the higher current surge happens during WIFI communication pulls the rail down. IT happens on an older Makerfocus ESP32 but I will try another ESP32 board to see if occurs there.  Maybe its been fixed in newer boards, nevertheless, I use 8266s powered from the Vin pin all the time with no problems.


The cause of this problem appears that some ESP32 boards the USB chip is not powered from the Vin (VDD5V) pin (19) but from the VDDUSB with a diode between. 
That maybe one cause, but you will get the problem on ESP32 boards without USB if the power supply is not good. 
No PMs please, they dont get answered.


I have not had a problem with any boards for months, and the Heltec boards I've been using I power off 5V with impunity and they drive LEDs while connecting and no problem.


Once I had a similar problem and it was due to not petting the watchdog. ESP32 internals automatically does this, but you need to give time for it. So, basically you need to use a delay on any continuous looping task you have, which will allow ESP to pet the dog. 20ms should do it, but you may need to try other periods.


I just had the same problem when using some of the esp32 boards. All of them show the same behavior as in post #1 and after a while I found out that I can run them with 5V connected to the 5V pin only (without usb connected). BUT I have to use some capacitors of ~470µF (see also post #3). Where to put them depends a lot on the circuit and the way I connected the 0V cables (I still use a breadboard for my tests). My conclusion is that the esp32 boards are very sensitive to ground loops and to how you design the power supply especially if you use WiFi which can create some current peaks.


In having the same issue and it's driving me nuts  :smiley-confuse:  :smiley-confuse:  :smiley-confuse:  Project works perfectly on USB, but connect a 5v/1A power supply to VIN and GND and I'm getting resets at WiFi initiation.

I would have thought providing the same power as what comes via USB would be a no brainer.. I'm really stuck as to what to do now.. I did try a 100uF cap across VIN and GND to no avail..

I also tried disabling brown out detection and while I could get past WiFi bootup, things got really unstable.

I should say I am pushing things a bit as I have a backlit 5V LCD, MFRC522, AND HX711 connected so there's a fair bit of draw.

My power setup is as follows.
1. - 5V bus connected to 5V supply POS
       Devices connected: Esp32 VIN, LCD VCC, HX711 VCC
2. - GND bus connected to 5V supply GND
       Devices connected: Esp32 GND, LCD GND, HX711 GND,
       MFRC522 GND.
3. - 3.3V bus connected to Esp32 3.3V
       Devices connected: HX711 LogLvL pin, MFRC522 VCC.

Would it help to use higher voltage input like 9V and use a step down converter to 5V just before vin? Or alternatively use a higher Amp 5V supply? Larger caps to buffer significant draw?

Commercial power supplies?

Any advice would be warmly welcomed as I'd hate to have to switch to another microcontroller half way through boxing up the project.

Would supplying 5V to the USB port overcome all these problems?

Go Up