Introduction
Contents [show]
In this tutorial, you’ll learn how to control a DC motor’s direction using an H-bridge.
To reverse a DC motor, you need to be able to reverse the direction of the current in the motor. The easiest way to do this is using an H-bridge circuit. There are many different models and brands of H-Bridge. This tutorial uses one of the most basic, a Texas Instruments L293NE or a Texas Instruments SN754410.
If you simply want to turn a motor on and off, and don’t need to reverse it, for example if you’re controlling a fan, try the tutorial on controlling high current loads with transistors.
What You’ll Need to Know
To get the most out of this lab, you should be familiar with the following concepts. You can check how to do so in the links below:
- Electronic components
- Digital input with Arduino
- How to use transistors to control high current loads
- How to use transistors to control high current loads with Arduino
- Video: H-Bridges
Prepare the breadboard
Connect power and ground on the breadboard to power and ground from the microcontroller. On the Arduino module, use the 5V and any of the ground connections:
Find a motor
Find yourself a DC motor that runs on low DC voltage within the range of 5 – 15V. RadioShack often sells several small DC motors, the NYU Book Store on occasion has a few, the junk shelf is almost always a goldmine for discarded motors and fans. Asking classmates and second years is another good approach.
Solder leads to the motor’s terminals. With DC motors, there is no polarity regarding the motor terminals so you can connect it any way you’d like.
Optional: Consider testing your motor with a bench power supply from the equipment room. Ask a teacher or resident if you need help setting one up. Begin by adjusting the voltage on the bench power supply and observe its effects. Take note of its speed at different voltages without dipping to low or too high.
Safety Warning: Running a motor at a voltage much lower or much higher than what it’s rated for could potentially damage or permanently destroy your motor. When the motor doesn’t spin, the voltage is too low. When the motor runs hot, or sounds like it’s straining, the voltage is too high.
Set up the H-bridge

Powering Your Motor
If your motor can run on 5V (if you’re using an Uno) or 3.3V (if using a Nano 33 IoT ) and less than 500mA, you can use the Arduino’s USB voltage. Most motors require a higher voltage and higher current draw than this, however, so you will need an external power supply. You can use any DC power supply or battery up to 15V with this motor driver as long as your motor can run at that voltage, and as long as the supply can supply as much current as your motor needs. However you choose to power this circuit, make sure the power source is compatible with your motor. For example, don’t use a 9V battery for a 3V motor.
Read more: Lab: DC Motor Control Using an H-Bridge