This is my first post here and I'm new to electronics. I am trying to control a motor using an ESP32 Cam. See attached image for a rather crude schematic. The power supply is rated for 2.4A. I am using a 12v DC 5rpm worm gear motor like this DC 12V Worm Gear Motor .
When the motor starts, the ESP32 resets (I figured this out by making the ESP blink on startup). Meanwhile the motor continues spinning without interrupt (I have ESPHome on the ESP32 and treat 2 GPIO pins as interlocking switches [only one can be on at a time]).
From reading online, it seems like the surge on motor startup may be causing a voltage drop on the ESP32 (potentially called "brownout") causing a reset. How can I prevent this in a simple way?
I found that if I put the motor on a different power supply, the issue is fixed, but I'd rather not use two power supplies.
References of similar issues:
- How to prevent a battery powered microcontroller(ESP32) from reseting when motors start running?
- Arduino restarts when DC motors are turned on
- Fast DC motor resets Arduino?!
Possible solutions
- Different PSU for motor. I've tried this and it works, but I'd rather not have to use a second PSU. I think the ESP32 draws ~250mA and the motor ~100mA, so I think I'm well within spec of the 2.4A PSU.
- Schottky diode - I don't have one of these and don't want to wait for an order
- "Decoupling capacitors". I have a bag of assorted electrolytic capacitors. Which should I use and where do I put them?
- PWM - gradually apply pwm to bring motor up to speed. Would this work with my circuit, with pwm before the boost converter? Will the boost converter just boost it to 12v anyways, either just using capacitors or using PWM?
Note
- The DRV8833 is rated to 10v, which is why I set boost converter to 10v and not 12v. The motor still seems to run fine on 10v.
Edit
Many thanks to the people who have posted here, @winny, @vir, @bobflux, and @thebusybee. I've implemented the PWM acceleration method, which works. There's a loud high pitched whining sound, at the mid-range PWM values that goes away once the motor comes up to speed. Audio available here: https://streamable.com/3xgxy0