Lesson 11 - Motor Control With DRV8833 Pupil Notes
Today We Are Learning
Today we will make a motor spin safely using the DRV8833 motor driver.
What You Will Be Able To Do
- Name the important DRV8833 pins.
- Make a motor go forward and backward.
- Change motor speed with a slider/PWM value.
- Explain brake and coast in simple words.
Why We Need DRV8833
A Bluepill pin is like a small helper. A motor needs a stronger helper. DRV8833 takes commands from Bluepill and sends enough power to the motor.
DRV8833 Pins To Remember
- Control pins:
IN1,IN2,IN3,IN4 - Motor outputs:
OUT1,OUT2,OUT3,OUT4 - Power and support pins:
GND,VCC,EEP,ULT
Channel mapping:
IN1+IN2controlOUT1+OUT2IN3+IN4controlOUT3+OUT4
Easy Direction Rules (Motor A)
- Forward:
IN1=1,IN2=0 - Backward:
IN1=0,IN2=1 - Coast (slow down naturally):
IN1=0,IN2=0 - Brake (stop quickly):
IN1=1,IN2=1
Speed Rule
Use PWM on the channel drive control (IN control in this setup):
- 0 means stop
- Bigger number means faster
- Start low, then increase
Build Checklist
- Bluepill GND connected to DRV8833 GND
- Motor power connected to DRV8833 power input
- Motor wires connected to output terminals
IN1,IN2connected to Bluepill for first motor channel control
Try This
- Set low speed.
- Run forward.
- Stop.
- Run backward.
- Test coast and brake.
Think And Explain
- Which pin controls speed?
- Which pins control direction?
- What is the difference between coast and brake?
Challenge
Make a mini routine:
- forward 2 seconds
- stop 1 second
- reverse 2 seconds
Success Check
You pass if:
- Motor changes direction when commanded.
- Speed changes when PWM changes.
- You can explain what
IN1..IN4,OUT1..OUT4,EEP, andULTare for.
