DC Motor Direction and PWM Control
Control a brushed DC motor through an H-bridge while measuring stall risk, current and PWM behaviour.
Learning objective
Control a brushed DC motor through an H-bridge while measuring stall risk, current and PWM behaviour.
Components and tools
- Development board
- Current-limited low-voltage supply
- Digital multimeter
- Oscilloscope or logic analyser
- Emergency power disconnect
Safety before motion
- Motor must never be powered from a GPIO.nSelect driver for stall current, not only no-load current.nKeep hands, wires and clothing away from rotating shafts.
Pin and power connections
| Controller pin | Driver / device pin | Purpose | Voltage / notes |
|---|---|---|---|
| PWM pin | Driver EN/PWM | Speed command | MCU logicnGPIO A |
Practical procedure
- Disconnect power and verify motor/logic rails.nConnect driver inputs and common signal ground.nSet current limit below safe driver/motor value.nTest direction at low duty cycle with wheel/load lifted.nMeasure current at no-load and brief controlled startup.
Measurement checkpoints
| Checkpoint | Expected | Instrument | Safety limit |
|---|---|---|---|
| PWM waveform | Correct frequency/duty | Oscilloscope | Driver input limitnNo-load current |
Troubleshooting
| Symptom | Check | Corrective action |
|---|---|---|
| Motor does not turn | Check standby, enable and supply | Enable driver and test low dutynBoard resets |
Engineering sizing tools
Calculate before powering
Mandatory pre-start gate
Machine safety checklist
The simulated enable button remains locked until every item is confirmed.
