Arduino - DRV8833 DC Motor Driver
In this tutorial, we are going to learn:
- What the DRV8833 motor driver is and what each of its pins does
- How to control the speed and direction of one DC motor with Arduino and DRV8833
- How to control two DC motors at the same time, like the two wheels of a small robot car

If you have not used a DC motor before, the Arduino - DC Motor tutorial explains how speed and direction work with the bigger L298N driver.
Hardware Required
Or you can buy the following kits:
| 1 | × | DIYables STEM V3 Starter Kit (Arduino included) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some links direct to products from our own brand, DIYables .
For PART 1, one DC motor is enough. The second motor is only needed for PART 2.
About DRV8833 Motor Driver
The DRV8833 is a small chip from Texas Instruments with two H-bridges inside. One H-bridge can turn one brushed DC motor in both directions, so the module drives two DC motors (or one small bipolar stepper motor, but that is not covered here). Its outputs are MOSFETs with a very low resistance, about 360 mΩ. Because of this, the motor gets almost the full battery voltage and the chip stays cool. The old L298N loses about 2V inside itself, so the DRV8833 is a better choice for robots that run on 3V to 9V batteries.

| DRV8833 | |
|---|---|
| Motor Supply Voltage (VCC) | 2.7V to 10.8V |
| Logic Input Voltage | 3.3V or 5V (no separate logic supply) |
| Output Current | 1.5A RMS per channel, 2A peak |
| Number of Channels | 2 (motor A and motor B) |
| PWM Frequency | up to 50 kHz |
| Protection | under-voltage, over-current, over-temperature |
The common DRV8833 module has these pins:
- VCC pin: needs to be connected to the positive wire of the motor power supply (2.7V to 10.8V)
- GND pin: needs to be connected to GND of the power supply and GND of Arduino
- IN1, IN2 pins: control motor A. They need to be connected to two PWM pins of Arduino
- IN3, IN4 pins: control motor B. They need to be connected to two other PWM pins of Arduino
- OUT1, OUT2 pins: connect to the two wires of motor A
- OUT3, OUT4 pins: connect to the two wires of motor B
- EEP pin: the sleep pin (nSLEEP). It needs to be HIGH to turn the driver on. We connect it to 5V of Arduino. If it is LOW, the chip sleeps and the motors do not move.
- ULT pin: the fault pin (nFAULT). It goes LOW when there is a problem like too much current or heat. We can leave it unconnected.
The labels are not the same on every module. Some boards print AIN1, AIN2, BIN1, BIN2, AOUT1, AOUT2... for the inputs and outputs, and SLP and FLT for the sleep and fault pins. The functions are the same.
Unlike the L298N, the DRV8833 does not need a 5V logic supply from Arduino. The chip makes its own logic voltage from VCC. Arduino only needs to share the same GND.
How To Control a Motor With Two Pins
There is no ENA or ENB speed pin on the DRV8833. Each motor is controlled by just two input pins. The table below shows what happens for motor A (motor B works the same with IN3 and IN4):
| IN1 | IN2 | Motor A |
|---|---|---|
| LOW | LOW | Coast (motor spins freely and slows down by itself) |
| HIGH | LOW | Forward |
| LOW | HIGH | Reverse |
| HIGH | HIGH | Brake (motor stops quickly) |
To set the speed, we send a PWM signal to one input and keep the other input LOW:
- Forward with speed: PWM on IN1, IN2 is LOW
- Reverse with speed: IN1 is LOW, PWM on IN2
This is why both pins of a motor must be PWM pins. On Arduino Uno, the PWM pins are 3, 5, 6, 9, 10 and 11.
※ NOTE THAT:
- Never power the motors from the 5V pin of Arduino. Motors need much more current than Arduino can give. Use an external power supply.
- The GND of the power supply, the DRV8833 and Arduino must be connected together.
- If a motor spins in the wrong direction, just swap its two wires on the OUT pins.
PART 1: Arduino Controls One DC Motor With DRV8833
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
Wiring table of DRV8833 Module and Arduino Uno
| DRV8833 Module | Arduino Uno / Other |
|---|---|
| IN1 | → Pin 10 |
| IN2 | → Pin 9 |
| EEP | → 5V |
| GND | → GND (and GND of the 5V power adapter) |
| VCC | → positive (+) of the 5V power adapter via the DC power jack |
| OUT1, OUT2 | → the two wires of the DC motor |
How To Program For DRV8833
- Define the Arduino pins connected to IN1 and IN2:
- Set the pins as outputs:
- Run the motor forward with a speed from 0 to 255:
- Run the motor in reverse:
- Let the motor coast to a stop:
- Brake the motor:
Arduino Code - DRV8833 One DC Motor
The below code does:
- Speed the motor up slowly in the forward direction
- Run at full speed for 2 seconds
- Coast to a stop
- Run in reverse at a medium speed
- Brake to a fast stop
- Repeat again and again
Quick Steps
- Do the wiring as shown in the diagram above. Plug in the 5V power adapter last.
- Connect Arduino to PC via USB cable
- Open Arduino IDE, select the right board and port
- Copy the above code and open with Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino
- Watch the motor: it speeds up, runs, coasts, turns back and brakes
- Open the Serial Monitor to see what the motor is doing at each moment
Look at the difference between the two stops. After "Coast", the motor keeps turning for a short time. After "Brake", it stops almost at once.
PART 2: Arduino Controls Two DC Motors With DRV8833
With two motors, we can build the base of a small robot car: motor A is the left wheel and motor B is the right wheel.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
Wiring table of DRV8833 Module and Arduino Uno
| DRV8833 Module | Arduino Uno / Other |
|---|---|
| IN1 | → Pin 10 |
| IN2 | → Pin 9 |
| IN3 | → Pin 6 |
| IN4 | → Pin 5 |
| EEP | → 5V |
| GND | → GND (and GND of the 5V power adapter) |
| VCC | → positive (+) of the 5V power adapter via the DC power jack |
| OUT1, OUT2 | → motor A (left) |
| OUT3, OUT4 | → motor B (right) |
How To Program For Two DC Motors
To keep the code short, we use one helper function for each motor. It takes a signed speed:
- A positive value (1 to 255) runs the motor forward
- A negative value (-1 to -255) runs the motor in reverse
- 0 lets the motor coast
To turn the car, the two wheels spin in opposite directions:
- Turn left: motor A reverse, motor B forward
- Turn right: motor A forward, motor B reverse
Arduino Code - DRV8833 Two DC Motors
The below code moves the car forward, backward, turns left, turns right and then stops.
Quick Steps
- Do the wiring for two motors as shown in the diagram above
- Connect Arduino to PC via USB cable
- Copy the above code and open with Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino
- Lift the wheels off the table (or put the car on the floor with enough space)
- See the result on Serial Monitor
※ NOTE THAT:
If the car turns right when it should turn left, swap the two wires of one motor on its OUT pins, or swap motor A and motor B in the code.
Video Tutorial
We are considering to make the video tutorials. If you think the video tutorials are essential, please subscribe to our YouTube channel to give us motivation for making the videos.