0
\$\begingroup\$

I've soldered a small PCB around an ESP32 with following components:

The circuit does the following:

Measure soil moisture and turn on the water pump accordingly. When the soil is too dry, the ESP32 pulls the gate of the MOSFET high, which shorts the drain over source, source is connected to GND. The gate is normally pulled to GND with a 1k pull-down resistor.

The circuit was working fine with 5V power supply over PSU USB or laptop USB.

However, when I plugged in the 12V rated PSU, the ESP32 literally burnt to death.

Please check my hand-drawn schematic here:

enter image description here

Soldering was fine (since it worked for 5V as well):

enter image description here

enter image description here

I've previously powered an ESP32 using a 12V PSU since the on-board AMS1117 linear regulator tolerates this voltage.

I've also checked the polarity of the PSU before plugging it in. The linear regulator still seems to work since it outputs 3.3V, however the ESP32 vaporated.

I can not see any major flaws in my design. I just think it is a bad practice to switch GND instead of 12V with the MOSFET but I just did that out of convenience because I had N-MOSFETs lying around here.

\$\endgroup\$
1
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – Voltage Spike
    Feb 14, 2021 at 21:43

1 Answer 1

2
\$\begingroup\$

I crudely overlaid the two photos you showed to get a better picture of the overall wiring.

Circuit overlay

The transistor appears to be wired correctly. You've got the gate being pulled to ground, driven by a GPIO pin. The drain goes out to your load. The source goes to ground.

The most likely cause of failure is that you mixed up the red wires and connected the red wire at the top of the photo to 12V instead of the one at the bottom. The one at the top is connected to the 3.3V pin of the board. This bypasses the AMS1117-3.3 regulator, so you'd have fed 12V directly into the MCU. When you fed it with 5V you probably just about got away with overvolting the ESP32, without it catching fire. 12V is far too much, though.

Another potential issue is that your path to ground for the load is through the dev board. If your pump pulls quite a high current this may be excessive for the board's pins. A header pin is only rated for about 4A, so if your pump pulls more than that you're likely to cause overheating problems. You'd be better of directly wiring the source pin to ground on the terminal block.

Additionally, looking at the schematic of the NodeMCU-32S, the USB to TTL converter IC is powered directly from VDDUSB. There is a schottky diode from VDDUSB to VDD5V, so that the board will power on from USB power:

Power schematic

If the schottky diode that was used on your board was not in fact a 1N5819, but instead a diode with a lower reverse breakdown voltage, it is possible that feeding 12V to VDD5V caused VDDUSB to be raised to 12V, frying the TTL chip. This could then have shorted 12V into the U0TX/U0RX pins of the ESP32.

\$\endgroup\$
4
  • \$\begingroup\$ thank you a lot. I have just measured that the voltage in the 3.3V pin is 12V, same as the 5V pin where I feed the 12V. I can exclude that I mixed up the 3V3 and 5V wires in the first place since the 3V3 was always connected to the soil moisture sensor but I have never verified that I had a proper 3V3 voltage. I will screen the check the board for your explanation with the breakdown diode. The ESP32 was purchased by some German brand (azdelivery). \$\endgroup\$ Feb 12, 2021 at 20:34
  • \$\begingroup\$ Those generic NodeMCU-32S style boards are made by hundreds of random companies and resold by thousands more, so it's pretty much impossible to tell the exact part selection that any individual one used. \$\endgroup\$
    – Polynomial
    Feb 12, 2021 at 20:57
  • 1
    \$\begingroup\$ provided by far the best answer. I will check a bit further about the Error source since I used ESP32 previously with 12V and didn't do any obvious Error in this simple PCBy will keep you posted. do you have any best practice recommendations for me after looking at the PCB? \$\endgroup\$ Feb 13, 2021 at 6:38
  • \$\begingroup\$ @MarcoBobinger Measure voltages on your wiring before connecting the board. Use different wire colours for different functions, where practical, to avoid confusion. Consider using an external 5V or 3.3V buck regulator so that you don't need to worry about frying the ESP32 with 12V. A big bonus here is that NodeMCU-32S clones (and other ESP8266/ESP32 dev boards) are so incredibly cheap on places like AliExpress, especially if you buy 10 or more at once. Never hurts to have some spare for prototyping and projects. \$\endgroup\$
    – Polynomial
    Feb 13, 2021 at 21:44

Your Answer

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

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