Home / Learn Chip Programming / Motors, H-Bridges, Servos and Steppers
Motors, H-Bridges, Servos and Steppers
How a 3.3 V pin controls a powerful motor safely.
Theory in plain words
What it is
A pin cannot drive a motor directly. Use a transistor, MOSFET or driver chip. H-bridge reverses direction; PWM controls speed. Servos take a pulse width as position. Steppers move in fixed steps.
Why we use it
Robots, 3D printers, fans, pumps and drones all use motor drivers. Wrong wiring burns drivers and microcontrollers.
How it works
DC motor: H-bridge (L298N, TB6612, DRV8833) + PWM + flyback protection. Servo: 50 Hz signal with 1 to 2 ms pulse. Stepper: driver (A4988, DRV8825) with STEP and DIR pins.
Where it is used
- Line follower and robot car
- Motor controller project
- 3D printers, CNC
Motor control lab
This is the arithmetic you write in the motor controller project: duty to voltage, angle to pulse width, RPM to step rate.
| Motor | Driver | Control signal | Good for |
|---|---|---|---|
| Small DC (toy) | transistor / MOSFET + diode | PWM | fans, vibration |
| DC with direction | H-bridge: TB6612, DRV8833, L298N | PWM + 2 direction pins | robot wheels |
| Hobby servo (SG90) | none (needs 5 V power) | 1 to 2 ms pulse at 50 Hz | arms, steering |
| Stepper (NEMA17) | A4988, DRV8825, TMC2209 | STEP + DIR + EN | printers, CNC, precise positioning |
| Brushless (BLDC) | ESC or FOC driver | PWM / 3 phase | drones, fans |
Quick quiz
1. H-bridge input 1/0 means...
One side high, the other low drives current one way.
2. Servo signal period?
Pulse width 1 to 2 ms inside a 20 ms frame.