I've recently had my first pcb made, to my surprise, everything was working, at least it did at first.

It's a simple board that lets me control some ledstrips with an ESP32 through wifi. Everything worked great, including the transistor circuit. However, after a couple hours, the mcu became unresponsive, and after replugging the power supply, it seems as though the mcu is completely dead (no uart output on boot, not programmable with jtag). I know that the board did not short, I also measured the correct voltages on the MCU itself, as well as on the chip_enable pin (which is required for the ESP32 to boot) so I am quite confident that the only thing broken on the boards, is the MCU itself. I soldered together a second board, which had the exact same result.

In my initial design I did not have resistors on the data lines of the ledstrip and I did not have a resistor on the gate of the transistor. Because the GPIOs of the ESP32 can only provide 12mAmps (according to the datasheet), I suspect that the lack of resistor on the gate of the transistor might be the cause.

Included I have the original schematic that was failing, and the new schematic with precautions in place.

Is there anything else that could cause the MCU to die?

  • 1
    \$\begingroup\$ You are missing a connection on your latest diagram on the drain of the MOSFET. Plenty of things could have caused it to die but adding series resistors in IO lines to off-board stuff is usually a good idea. \$\endgroup\$
    – Andy aka
    Dec 6, 2020 at 15:58
  • 3
    \$\begingroup\$ That transistor is a FET so it does not need a gate resistor (exceptions may apply of course). However what are the IO pins to LED? You seem to be sending 12V to LEDs and some 3.3V IO pins and then using a FET to disconnect LED grounds - that's an obvious big red flag! 12V return currents may flow via GPIO pins then, sending too high current and voltage to ESP32 inputs and it gets damaged. \$\endgroup\$
    – Justme
    Dec 6, 2020 at 16:00
  • 1
    \$\begingroup\$ What Justme says: Why do you have an enable LED (switching LED ground) while ALSO feeding 3.3 V data via LED3_MAIN etc? That makes no sense. What LED strips are you using? Can you not program the LEDs to be off? If you can, then why also disconnect GND? Disconnecting GND is always tricky (=asking for trouble!!) when you also feed other signals like data signals to devices. You should simply avoid that and always leave all GNDs connected. \$\endgroup\$ Dec 6, 2020 at 16:07
  • 2
    \$\begingroup\$ Most likely the output is dead. If you devide 12V by 330 ohm you get a current of 36mA. Increase the serial resistor to some kohms and it will live for ever. \$\endgroup\$
    – Bill
    Dec 6, 2020 at 16:13
  • \$\begingroup\$ Do un-used IO pins on the ESP32 default to being inputs? Any digital input pin should not float...but should be terminated in a pull-up resistor (to VDD) or pull-down resistor to GND. Some processors have internal termination resistors attached by writing to a register. An analog input pin need no such termination. A digital output pin need no termination too. This termination rule also applies to input pins on JTAG header or COM header. \$\endgroup\$
    – glen_geek
    Dec 6, 2020 at 16:41

1 Answer 1


I agree with Bimpelrekkie's comment.

enter image description here

When the MOSFET is turned off, GND for the LEDs floats, but they are still connected to +5V. As the ESD diodes inside the LED controller chips conduct, the inputs LED_MAIN and LED_BACKUP are no longer inputs. Instead they output a voltage close to +5V, which destroys your ESP32. Besides, if the ESP32 outputs 0V, it will act as an extra ground connection for the LED chips, so they will power up somewhat through that. Enough current can flow to blow both the ESP32 and the LED controller chips.

It is always a bad idea to switch the ground of a load which communicates with a micro via other data lines. If you want to be able to turn off the LED strips completely to save power, you must do so with a high side switch in the VDD line.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.