MOSFET causing ESP32 to not boot - Page 1
Forum section: electronics / projects

author: DonnieBrodan
author_rank: Contributor
timestamp: January 09, 2021, 12:25:25 pm
content: I have a MOSFET configured as below:When I power this circuit it will not run any code, if I remove F1, it will boot normally. Is there a reason this may happen?EDIT: ESP32 is a dev board with a AMS1117 3.3v onboard regulator. 5v LDO is an ebay DC-DC converter (linked below).

author: NivagSwerdna
author_rank: Super Contributor
timestamp: January 09, 2021, 12:54:14 pm
content: Depends on which pins on the ESP32 are connected

author: Peabody
author_rank: Super Contributor
timestamp: January 09, 2021, 02:21:53 pm
content: Have you measured the voltages of the 12V input and LDO output when it fails to boot? Also voltages at points in the motor/mosfet circuit to see if they are what you expect them to be. Are you sure the mosfet is oriented correctly?

author: Twoflower
author_rank: Frequent Contributor
timestamp: January 09, 2021, 03:49:43 pm
content: Is by chance the motor actually running in case the fuse is set? If yes, the processor might have problems with electrical noise. Can you test this by replacing the motor with an LED+resistor (about 680 Ohm). Does the problem still appear?Also I don't see any caps in your diagram. Check the datasheet of the LDO you're using (by the way a LM78xx is not a low droput regulator, it's just a regulator). In case of a LM7805 series regulator: On the input pin a cap (e.g. 0.33µF or lager) very close to the input pin is required. They usually they recommend also a cap close to the output pin (usually 0.1µF).You should also provide at least the values of the resistors and the part number of the FET. This might give some additional clues. Also the type of motor you're using (e.g. current rating). Maybe a decent photo of your setup helps as well.

author: bson
author_rank: Unknown
timestamp: January 09, 2021, 06:10:05 pm
content: Which ESP32, and how is your reset held? Also, are there any 5V ESP32, I thought they were all 1.8-3.3V devices? Either way, reset must be held at least until 50µs past 3.3V is stable. Check the RST# and supply pins to make sure reset isn't released before the supply is stable.

author: Dennis Frie
author_rank: Contributor
timestamp: January 09, 2021, 06:29:42 pm
content: Looking at the schematic, everything should work just fine (except for the 5V supply to ESP32 as pointed out by bson). If you do power it by a 3.3V LDO, I guess you might be using one of the ESP32 pins that outputs PWM during start-up. As a DC-motor draws a significant amount of current when starting, even a few pulses might be enough to cause supply-drops, causing boot-problems.However, that's all guesses. An oscilloscope on the gate should tell you what's going on.

author: Siwastaja
author_rank: Super Contributor
timestamp: January 10, 2021, 08:13:24 am
content: Schematic is lacking capacitors. Show layout (pictures of the setup, for example).

author: DonnieBrodan
author_rank: Contributor
timestamp: January 10, 2021, 11:51:50 am
content: Should have explained ESP32 is a dev board with anAMS11173.3v onboard regulator. I have removed all IO and just have the 5.2v and Gnd connected, noticed this is still happening intermittently. 5v LDO is an ebay DC-DC converter ashere, which should be rated for max current easily. I noticed this never happened on USB power. bson mentioned holding reset during power up. I guess this is likely the issue..Found it has been discussedhere.. Seems the issue may be fixed as here:"a 10µF capacitor with (-) at GND and (+) at EN did the job for me ... : 100% autoboot after coldstart."Seems to be quite a bit of confusion, but this is a great step in the right direction.. Seems to come back to the mystery of the ESP32 operation.. (thereprobably is a capin a similar configuration to this, likely just too small..)Also, I noticed yes, one of these Gate pins is connected to IO14, which hasPWM out on boot... I'll change that..

author: Twoflower
author_rank: Frequent Contributor
timestamp: January 10, 2021, 02:20:03 pm
content: You probably should use the right names for the stuff you use: A DC-DC converter is for sure not an LDO, it is a DC-DC converter or a SMPS. While the AMS on the ESP board is an LDO.Why do you want to use another PGIO pin? As long as you don't setup the Pin to actually generate PWM that pin is silent. And actually it is configured after reset as an input pin (seeESP32 Datasheet, page 15; oe = 0; ie = 1). Or is the Arduino stuff doing funny things there? I'm confused here.

author: DonnieBrodan
author_rank: Contributor
timestamp: January 12, 2021, 02:07:46 pm
content: hmm I understood it outputted PWM on boot, not much effort to change. I have solved this with a 10uF Cap as described