Hi everyone,
I’m working on a small STM32-based motor control project where the MCU monitors a few sensors and drives a DC motor through a MOSFET driver stage.
The system generally works as expected, but I’m occasionally seeing random MCU resets whenever the motor starts or changes speed rapidly. The issue doesn’t happen every time, which makes it a bit difficult to track down.
Current setup:
Things I’ve already tried:
-
Added decoupling capacitors near the MCU
-
Separated motor and logic grounds on the PCB
-
Reduced PWM frequency
-
Checked power supply stability with a multimeter
A few questions:
-
Have you encountered similar reset issues when switching inductive loads?
-
Could motor noise still be coupling into the MCU despite the additional decoupling capacitors?
-
Would additional TVS diodes, ferrite beads, or filtering on the power input be worthwhile?
-
Are there any PCB layout practices you would recommend for keeping motor noise away from sensitive control circuitry?
I’m currently preparing the next PCB revision and considering PCBWay for fabrication, so I’d appreciate any suggestions before I place the order.
Thanks!
Yes, I’ve seen similar behavior with DC motors and inductive loads. Even if the average supply voltage looks stable on a multimeter, short voltage dips and noise spikes can still trigger MCU resets.
I’d check for supply droop during motor startup with an oscilloscope if possible. Adding bulk capacitance near the motor driver, a flyback diode (if applicable), and ferrite beads on the logic supply can sometimes make a significant difference.
For the PCB, try to keep the high-current motor paths physically separated from the MCU, crystal, and sensor traces, and use a solid ground plane with a well-defined return path. REad this guide: Routing Layers and Ground Planes & Power Planes - Engineering Technical - PCBway If you’re already preparing a new revision, it may also be worth reviewing the layout before fabrication to ensure the motor currents aren’t sharing return paths with sensitive logic circuitry.
I’d be interested to know whether the resets occur only during startup or also during sudden load changes while the motor is already running.
Unfortunately, I don’t currently have access to an oscilloscope, so I’ve only been checking the supply with a multimeter. Based on your comments, it’s certainly possible that I’m missing short transients or voltage dips during motor startup.
Most of the resets seem to occur either when the motor first starts or when there’s a rapid speed change, rather than during steady operation. That makes me suspect the power path or noise coupling is involved.
Thanks again for the help
Hello @mariawilliams1719,
As a quick solution, you could add a series diode to the microcontroller’s power supply along with the bulk capacitance mentioned by @jovelyngentallan02.
Together, this would allow the microcontroller to ride through the voltage dip presumably caused by the inrush of the motor.
Please let us know if this works.
Happy soldering,
APDahlen
P.S. To differentiate between noise and dips, you could temporarily power the microcontroller via a battery.