Motor Driving and Power-Rail Splitting
Motor Driving and Power-Rail Splitting
Overview
Section titled “Overview”Motors are the load most likely to make an ESP32 project “start and reset the MCU too”: high inrush, back-EMF spikes, and noise coupling into supply and ground. The fix is not “add a bigger capacitor” but power-rail splitting, return-path planning, and isolated driving. This section covers the supply architecture under motor loads: how to separate MCU and motor supplies, how to share ground without sharing current, driver selection and protection. By the end you will be able to:
- Design a supply split that stops motor and logic from dragging each other down
- Match a motor driver (H-bridge/driver board/ESC) and handle enable, brake, and freewheeling
- Plan high-current returns and single-point grounding to keep noise out of ADC/sensors
- Use software measures (soft start, current limit, watchdog) to raise reliability
Prerequisites
Section titled “Prerequisites”- Completed the Chapter 13 project basics and Chapter 25 actuator selection
- Motor type and duty clear: brushed DC / brushless / servo, stall/start current, supply voltage
- Scope or current observability (to catch inrush and brownout)
Key Concepts
Section titled “Key Concepts”Power-rail splitting principles
Section titled “Power-rail splitting principles”- Separate rails: motor on its own high-current rail (or battery/power BEC), logic 3.3 V on its own regulator, joined at a single point so motor return does not cross logic ground
- Share ground, not current: all grounds eventually tie (or signal references drift), but the high-current path must not share thin copper/thin wire with sensitive logic
- Local energy storage: bulk capacitance at the motor (to hold inrush), separate decoupling for logic; one big cap cannot feed both
- Measure the sag: at motor start, check whether the MCU supply drops to the reset threshold (ESP32 brownout); if so, strengthen supply or reduce inrush
Driving and protection
Section titled “Driving and protection”| Motor | Driver | Points |
|---|---|---|
| Brushed DC | H-bridge (driver/discrete MOS) | Freewheeling, brake, current sense, dead time |
| Brushless | Three-phase ESC/FOC | Gate drives, bus capacitance, stall protection |
| Servo | PWM direct/dedicated | Large inrush, supply must hold it, never feed servos from MCU 3.3 V |
Protection: back-EMF absorbed by freewheel paths; TVS/filtration on supply lines; on critical projects add opto/digital isolation between motor and logic supplies.
Software reliability
Section titled “Software reliability”- Soft start / current limit: avoid full-PWM inrush under load
- Stall detection: cut on abnormal current to prevent burn and supply collapse
- Watchdog: reset when the control loop runs away, avoiding a “runaway motor” hazard
[Photos pending] Supply-split wiring/PCB partitioning, inrush current, and measured brownout waveform are needed as evidence.
Verification
Section titled “Verification”| Check | Expected result | Verified |
|---|---|---|
| No MCU reset on motor start | Inrush and minimum voltage recorded, no brownout | |
| Rail split and single-point ground | Return path does not cross logic area | |
| Freewheel/brake/stall protection works | Spikes absorbed, stall cuts power | |
| Soft start lowers inrush | Start peak controlled | |
| Watchdog reset works | Control fault recovers |
Troubleshooting
Section titled “Troubleshooting”Issue 1: the MCU restarts whenever the motor moves
Section titled “Issue 1: the MCU restarts whenever the motor moves”Cause: shared supply/return causing start-sag past the reset threshold.
Action: split rails, single-point ground, add motor-side bulk capacitance, soft-start to cut inrush.
Issue 2: analogue readings are noisy while the motor runs
Section titled “Issue 2: analogue readings are noisy while the motor runs”Cause: ground-return and supply-noise coupling.
Action: separate motor from analogue/logic returns and decoupling; filter or difference sensitive signals (Chapter 25 analogue).
Best Practices
Section titled “Best Practices”- Do: split motor and logic supplies and join at a single ground point
- Do: match an H-bridge/ESC and add freewheel/brake/stall protection
- Do: add soft start, current limit, stall detection, and a watchdog in software
- Don’t: power servos or drive loads from the MCU’s 3.3 V
- Don’t: run motor high current across sensitive logic ground
Summary
Section titled “Summary”Key points of this section:
- Rail splitting is the first cause of motor-project stability: separate rails, single-point ground, local bulk capacitance
- Measure start sag; if it browns out, strengthen supply or soft-start
- Driver with protection: freewheel, brake, stall, isolation where needed
- Software backstop: soft start, current limit, stall detection, watchdog
We provide ESP32 ODM design-to-manufacturing services. From prototype to production — the team behind this tutorial can build it with you.
💡 Mention tutorial.imagrove.com in your Alibaba chat with us — get 10% off your custom project quote.
First published attutorial.imagrove.com/project-auto-dosing/15-motor-driving-and-power-rail-splitting/Please credit Imagrove and link back to this page when quoting or republishing.
Questions or issues with this tutorial?
Sign in with GitHub to leave a comment. If a step fails for you, tell us — we verify it and update the tutorial.
© Imagrove · ESP32 IoT Tutorial