Arduino UNO R4 - DRV8833 DC Motor Driver
In this guide, we will learn how to drive DC motors from an Arduino UNO R4 with the small DRV8833 motor driver board. We start with a single motor, then we add a second motor, which is the base of a two-wheel robot car. In detail, we will learn:
- What the DRV8833 module is and what each of its pins does
- How the two IN pins of a channel set the direction, the speed and the stop mode of a motor
- How to connect one DC motor to the Arduino UNO R4 through the DRV8833, and how to program it
- How to connect and program two DC motors to move forward, move backward, turn left and turn right

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables STEM V4 IoT Starter Kit (Arduino included) | |
| 1 | × | DIYables STEM V4B IoT Starter Kit (Arduino included) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of DRV8833 Motor Driver
A pin of the Arduino UNO R4 can only give a few milliamps, but a small DC motor needs hundreds. The DRV8833 board sits between them. It is built around a Texas Instruments chip with two H-bridges inside, so one board runs two brushed DC motors (it can also run one bipolar stepper motor). If you have read our Arduino UNO R4 - DC Motor tutorial with the L298N, you will see that the DRV8833 does the same job with a much smaller board.
Key facts:
| DRV8833 | |
|---|---|
| Motor voltage (VCC pin) | 2.7V to 10.8V |
| Logic signals | 3.3V and 5V both work (no separate logic power pin) |
| Output current | about 1.5A RMS per channel, 2A peak (with good cooling) |
| Output switches | MOSFETs, about 360 mΩ (high side + low side) |
| PWM frequency | up to 50 kHz |
| Protection | under-voltage lockout, over-current, thermal shutdown |
Because the outputs are MOSFETs, the voltage lost inside the driver is small. The older L298N loses a few volts as heat, but the DRV8833 passes almost all of the battery voltage to the motor. This makes it a good match for 3V to 9V battery robots. If you need more current for one big motor, the two channels can be joined in parallel for about 3A, but we do not do that in this guide.

The pins of the common red or blue DRV8833 module:
- VCC pin: connect to the motor power supply (2.7V to 10.8V). The chip makes its own logic voltage from this pin.
- GND pin: connect to the ground of the motor power supply and to GND of the Arduino UNO R4.
- IN1, IN2 pins: control motor A. Connect to two PWM pins of the Arduino UNO R4.
- IN3, IN4 pins: control motor B. Connect to two more PWM pins.
- OUT1, OUT2 pins: connect to the two wires of motor A.
- OUT3, OUT4 pins: connect to the two wires of motor B.
- EEP pin (sleep pin, nSLEEP): must be HIGH to turn the driver on. Connect it to the 5V pin of the Arduino UNO R4. If it is LOW, the chip sleeps and the motors do not move.
- ULT pin (fault pin, nFAULT): goes LOW when the chip detects a problem such as over-current or overheating. It is optional, and you can leave it unconnected.
※ NOTE THAT:
Pin labels vary between sellers. Some boards print AIN1/AIN2/BIN1/BIN2, AOUT1/AOUT2/BOUT1/BOUT2, SLP and FLT instead. The job of each pin stays the same.
How the IN pins control a motor
The L298N has ENA/ENB pins for speed. The DRV8833 has no such pin. Each channel uses only its two IN pins, and they set both the direction and the speed. Here is the table for motor A (motor B works the same with IN3 and IN4):
| IN1 | IN2 | Motor A |
|---|---|---|
| LOW | LOW | Coast (power off, the motor rolls to a stop) |
| HIGH | LOW | Spins forward |
| LOW | HIGH | Spins in reverse |
| HIGH | HIGH | Brake (the motor stops quickly) |
To change the speed, send a PWM signal instead of a steady HIGH:
- Forward at a chosen speed: PWM on IN1, IN2 LOW.
- Reverse at a chosen speed: IN1 LOW, PWM on IN2.
So both IN pins of a channel must be PWM pins. On the Arduino UNO R4 WiFi and Minima, the PWM pins are marked with a "~" sign. In this guide we use D10 and D9 for motor A, and D6 and D5 for motor B.
Powering the motors
Never run the motors from the 5V or 3.3V pin of the Arduino UNO R4. Power the VCC pin of the DRV8833 from a separate supply, such as a 5V adapter through a DC power jack, or a pack of 4 x AA batteries (about 6V). Then join the GND of that supply, the GND of the DRV8833 and the GND of the Arduino UNO R4 together. Without this common ground, the IN signals have no reference and the motors act strangely.
Part 1 - Control One DC Motor
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
| DRV8833 Module | Arduino UNO R4 / other |
|---|---|
| IN1 | D10 |
| IN2 | D9 |
| EEP | 5V |
| GND | GND (and the negative of the 5V adapter) |
| VCC | positive of the 5V adapter |
| OUT1, OUT2 | the two wires of the DC motor |
How To Program For DRV8833
- Set the two pins that go to IN1 and IN2:
- Make them outputs in setup():
- Spin forward at a speed from 0 to 255:
- Spin in reverse:
- Coast (both LOW) or brake (both HIGH):
In the full code, these lines are wrapped in a small function motorA(speed). A positive speed means forward, a negative speed means reverse, and 0 means coast. We use analogWrite() with 0 and 255 for LOW and HIGH, so the same pins never switch between PWM mode and digital mode.
Arduino UNO R4 Code - One DC Motor
The code below:
- Speeds up the motor slowly in the forward direction
- Keeps full speed for 2 seconds
- Lets the motor coast to a stop
- Runs it in reverse at about 70% speed
- Brakes it hard, then repeats
Detailed Instructions
Follow these instructions step by step:
- If this is your first time using the Arduino Uno R4 WiFi/Minima, refer to the tutorial on setting up the environment for Arduino Uno R4 WiFi/Minima in the Arduino IDE.
- Wire the DRV8833 module, the DC motor and the 5V adapter according to the provided diagram. Check that EEP goes to 5V and that all grounds are joined.
- Connect the Arduino Uno R4 board to your computer using a USB cable.
- Launch the Arduino IDE on your computer.
- Select the appropriate Arduino Uno R4 board (e.g., Arduino Uno R4 Minima) and COM port.
- Copy the code above and paste it into the Arduino IDE.
- Click the Upload button to send the code to the Arduino UNO R4.
- Plug in the 5V adapter to power the motor.
- Open the Serial Monitor and watch the motor.
Listen to the difference between the two stops: in the coast step the motor slows down softly, and in the brake step it stops almost at once.
※ NOTE THAT:
If the motor turns the wrong way, swap the two motor wires on OUT1 and OUT2. If the motor does not move at all, check the EEP pin first: when it is not HIGH, the driver sleeps.
Part 2 - Control Two DC Motors
Now we use channel B too. With one motor on the left wheel and one on the right wheel, the Arduino UNO R4 can steer a small car just by changing the direction of each wheel.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Uno R4 and other components.
| DRV8833 Module | Arduino UNO R4 / other |
|---|---|
| IN1 | D10 |
| IN2 | D9 |
| IN3 | D6 |
| IN4 | D5 |
| EEP | 5V |
| GND | GND (and the negative of the 5V adapter) |
| VCC | positive of the 5V adapter |
| OUT1, OUT2 | motor A (left wheel) |
| OUT3, OUT4 | motor B (right wheel) |
Arduino UNO R4 Code - Two DC Motors
This code adds a motorB(speed) function and a drive() helper that sets both motors and prints the action name. The car moves forward, stops, moves backward, then turns left (motor A in reverse, motor B forward) and right (the opposite).
Detailed Instructions
- Add the second motor and the IN3/IN4 wires as shown in the diagram above.
- Copy the code and open it in the Arduino IDE.
- Click the Upload button to upload the code to the Arduino UNO R4.
- Power the motors with the 5V adapter.
- Open the Serial Monitor. Lift the wheels off the table so the car does not run away while you test.
If the car turns right when the Serial Monitor says "Turn left", one motor is wired the other way round. Swap the wires of that motor on its OUT pins.
※ NOTE THAT:
Two motors take more current than one. If the Arduino UNO R4 resets when both motors start, your supply is too weak. Use a stronger adapter or fresh batteries, and keep the motor supply separate from the USB power.