Arduino Nano 33 IoT - DRV8833 DC Motor Driver
The Arduino Nano 33 IoT is a small 3.3V board, and it is a great brain for a light robot. To move wheels, it needs a motor driver. In this guide, we will use the tiny DRV8833 module for that job. We will go step by step:
- What the DRV8833 is, and what each of its pins does.
- How to wire one DC motor to the DRV8833 and the Arduino Nano 33 IoT, then control its speed and direction.
- How to add a second DC motor and drive both of them like a two-wheel robot car.

Hardware Preparation
Or you can buy the following kits:
| 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
The DRV8833 is a dual H-bridge chip made by Texas Instruments. "Dual" means it has two separate channels, so one module can run two brushed DC motors on its own (or one small bipolar stepper motor, but we do not cover that here). Inside, it uses MOSFET switches with a low resistance of about 360 mΩ. Because of this, it wastes much less voltage and heat than the older L298N used in the Arduino Nano 33 IoT - DC Motor tutorial. This makes it a good match for small robots that run on 3V to 9V batteries.
The best part for the Nano 33 IoT: the DRV8833 has no separate logic supply. The chip makes its own internal logic voltage, so the 3.3V signals from the Nano 33 IoT work fine without any level shifter.
Key numbers of the DRV8833:
| DRV8833 | |
|---|---|
| Motor supply (VCC pin) | 2.7V to 10.8V |
| Output current per channel | about 1.5A RMS, 2A peak (with good cooling) |
| Number of channels | 2 (can be joined in parallel for about 3A on one motor) |
| PWM frequency | up to 50 kHz |
| Protection | under-voltage lockout, over-current, thermal shutdown |
The DRV8833 Module Pinout

The common breakout board has the following pins:
- IN1, IN2 pins: control inputs for motor A. They must be connected to two PWM pins of the Arduino Nano 33 IoT.
- IN3, IN4 pins: control inputs for motor B. They also must be connected to PWM pins.
- OUT1, OUT2 pins: outputs that go to the two wires of motor A.
- OUT3, OUT4 pins: outputs that go to the two wires of motor B.
- VCC pin: motor power input, 2.7V to 10.8V. It must be connected to an external power supply, never to the Nano 33 IoT's pins.
- GND pin: must be connected to the GND of the power supply AND the GND of the Arduino Nano 33 IoT.
- EEP pin: the sleep pin (nSLEEP). It must be HIGH to turn the driver on. If it is LOW, the chip sleeps and the motors do not move. In this tutorial, we tie it to the 3.3V pin of the Nano 33 IoT.
- ULT pin: the fault pin (nFAULT). It goes LOW when the chip detects a problem, such as overheating. It is optional, and we leave it unconnected.
※ NOTE THAT:
Pin labels vary from one maker to another. Some boards print AIN1, AIN2, BIN1, BIN2, AOUT1, AOUT2... and SLP / FLT instead of EEP / ULT. The job of each pin is the same. Always read the labels on your own module.
How the DRV8833 Controls a Motor
Unlike the L298N, the DRV8833 has no ENA / ENB enable pins. Both direction and speed come from the two IN pins of each channel. The table below shows the four states of motor A (motor B works the same way with IN3 and IN4):
| IN1 | IN2 | Motor A |
|---|---|---|
| LOW | LOW | Coast - the power is cut, the motor rolls slowly to a stop |
| HIGH | LOW | Spins forward |
| LOW | HIGH | Spins in reverse |
| HIGH | HIGH | Brake - the motor stops quickly |
To change the speed, we send a PWM signal to one IN pin and keep the other one LOW:
- Forward at a chosen speed: PWM on IN1, IN2 LOW.
- Reverse at a chosen speed: IN1 LOW, PWM on IN2.
This is why all four IN pins must be PWM-capable. On the Arduino Nano 33 IoT, we use pins D10, D9, D6 and D5. They are all PWM pins on the same timer (TCC0), but each one has its own channel (CC3, CC2, CC0 and CC1), so every pin gets its own duty cycle.
PART 1: Control One DC Motor With the DRV8833
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
| DRV8833 Module | Arduino Nano 33 IoT / Other |
|---|---|
| IN1 | D10 |
| IN2 | D9 |
| EEP | 3.3V |
| GND | GND (also GND of the 5V adapter) |
| VCC | + of the 5V adapter (via DC power jack) |
| OUT1, OUT2 | the two wires of the DC motor |
※ NOTE THAT:
Do not power the motor from the 3.3V or VUSB pin of the Arduino Nano 33 IoT. Motors pull big current spikes that can reset or damage the board. Use the 5V power adapter, and make sure all the grounds are connected together.
How To Program For One DC Motor
- The first step is to define the two Arduino Nano 33 IoT pins that are connected to IN1 and IN2:
- Set both pins as outputs in setup():
- To run forward at a speed from 0 to 255, write PWM on IN1 and 0 on IN2:
- To run in reverse, swap the roles of the two pins:
- To brake, set both pins to full (255). To coast, set both pins to 0.
※ NOTE THAT:
On the Arduino Nano 33 IoT, once a pin has been used with analogWrite(), a later digitalWrite() on that pin does not change it. That is why the code uses analogWrite(pin, 0) for LOW and analogWrite(pin, 255) for HIGH everywhere, instead of mixing the two functions.
In the full code, these lines are packed into a small motorA(speed) function. It takes a signed speed: a positive value spins forward, a negative value spins in reverse, and 0 lets the motor coast.
Arduino Nano 33 IoT Code for One DC Motor
The code below repeats this sequence:
- Speed up forward from 0 to full speed.
- Hold full speed for 2 seconds.
- Coast to a stop.
- Spin in reverse at about 70% speed.
- Brake hard.
Detailed Instructions
If you are new to the Arduino Nano 33 IoT, be sure to check out our Getting Started with Arduino Nano 33 IoT tutorial. Then, follow these steps:
- Wire the DRV8833, the motor and the power adapter as shown in the diagram. Keep the adapter unplugged for now.
- Connect the Arduino Nano 33 IoT board to your computer using a USB cable.
- Open Arduino IDE on your computer.
- Select the Arduino Nano 33 IoT board and its COM port.
- Copy the code above and paste it into the Arduino IDE.
- Click the Upload button to compile and send the code to the board.
- Plug in the 5V power adapter to power the motor.
- Open the Serial Monitor and watch the motor:
- It slowly speeds up, then runs at full speed.
- It rolls freely to a stop.
- It turns the other way for 2 seconds.
- It stops sharply when the brake is applied.
If the motor turns the "wrong" way, swap its two wires on OUT1 and OUT2. No code change is needed.
PART 2: Control Two DC Motors With the DRV8833
Now let's use both channels of the module. With one motor on each side, the Arduino Nano 33 IoT can drive a simple two-wheel robot car. To turn, one wheel goes forward while the other goes backward.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
| DRV8833 Module | Arduino Nano 33 IoT / Other |
|---|---|
| IN1 | D10 |
| IN2 | D9 |
| IN3 | D6 |
| IN4 | D5 |
| EEP | 3.3V |
| GND | GND (also GND of the 5V adapter) |
| VCC | + of the 5V adapter (via DC power jack) |
| OUT1, OUT2 | left motor (motor A) |
| OUT3, OUT4 | right motor (motor B) |
Two motors draw about twice the current of one. A 5V adapter of 2A or more is a safe choice. For a car that runs without a cable, a 4 x AA battery pack (about 6V) also works, since it stays inside the 2.7V to 10.8V range.
Arduino Nano 33 IoT Code for Two DC Motors
The code uses a helper for each channel, motorA(speed) and motorB(speed), with a signed speed from -255 to 255. On top of them, the drive() function sets both wheels, prints the action, and waits. The car goes forward, stops, goes backward, turns left, turns right, and stops again.
Detailed Instructions
- Wire the second motor to OUT3 and OUT4, and connect IN3 and IN4 to D6 and D5, as shown in the diagram.
- Connect the Arduino Nano 33 IoT to your computer with the USB cable.
- Copy the code above into the Arduino IDE and click Upload.
- Plug in the motor power supply.
- Lift the wheels off the table for the first test, then open the Serial Monitor.
If one wheel turns the opposite way during "Car: forward", just swap the wires of that motor on its OUT pins.
Additional Knowledge
How is the DRV8833 different from the L298N? Here is a short comparison:
| DRV8833 | L298N | |
|---|---|---|
| Motor voltage | 2.7V to 10.8V | about 5V to 35V |
| Switch type | MOSFET (low loss) | bipolar transistor (about 2V or more lost) |
| Speed control | PWM on the IN pins | PWM on the ENA / ENB pins |
| Size | very small | large, with a heat sink |
It is evident that the DRV8833 is the better pick for small, low-voltage robots, while the L298N is still useful when the motors need 12V or more.