Arduino : How to Control a Stepper Motor With L293D Motor Driver

by MertArduino in Circuits > Arduino

84074 Views, 212 Favorites, 0 Comments

Arduino : How to Control a Stepper Motor With L293D Motor Driver

L293D_icon.jpg

This instructable is the written version of my "Arduino :How To Control a Stepper Motor with L293D Motor Driver" YouTube video that I've uploaded recently. I strongly recommend you to check it out.

My YouTube Channel

Tutorial

Arduino : How To Control a Stepper Motor with L293D Motor Driver (Chip)

In this tutorial you will learn how to control a stepper motor using your L293D motor control chip

Stepper motors fall somewhere in between a regular DC motor and a servo motor. They have the advantage that they can be positioned accurately, moved forward or backwards one 'step' at a time, but they can also rotate continuously.

Hardware Required

vlcsnap-2016-10-04-22h33m53s534.png

Arduino or Genuino Board

Stepper L293D Motor Driver (Chip)

Breadboard

Battery

Jumper Wires

Circuit & Connections

02_L293D_step_connections.jpg
01_L293D_step_connections.jpg
L293D_circuit.JPG
vlcsnap-2016-10-04-22h34m57s769.png
vlcsnap-2016-10-04-22h35m02s994.png
vlcsnap-2016-10-04-22h35m42s116.png
vlcsnap-2016-10-04-22h35m53s996.png
vlcsnap-2016-10-04-22h36m10s306.png
vlcsnap-2016-10-04-22h36m23s867.png
vlcsnap-2016-10-04-22h36m41s048.png
vlcsnap-2016-10-04-22h36m56s743.png
vlcsnap-2016-10-04-22h37m24s748.png
vlcsnap-2016-10-04-22h37m49s339.png
vlcsnap-2016-10-04-22h37m53s856.png
vlcsnap-2016-10-04-22h38m34s731.png

Hardware (L293D)

Run four solenoids, two DC motors or one bi-polar or uni-polar stepper with up to 600mA per channel using the L293D. These are perhaps better known as "the drivers in Adafruit Motorshield". If you accidentally damaged the drivers in a shield, you can use one of these puppies to replace it. Or you can breadboard something on your own! Each chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi-directionally, or one stepper motor. There's a PWM input per driver so you can control motor speed. Runs at 5V logic. Good for motor voltages from 4.5V up to 36V! This wont work well for 3V motors. The motor voltage is separate from the logic voltage.

The stepper motor has five leads, and we will be using both halves of the L293D this time. This means that there are a lot of connections to make on the breadboard. The motor has a 5-way socket on the end. Push jumper wires into the sockets to allow the motor to be connected to the breadboard.

Note that the red lead of the Stepper motor is not connected to anything.
Use the colors of the leads to identify them, not the position from which they emerge from the motor.


Bipolar Stepper Motor

Driving a bipolar stepper motor with the L293D is very similar to driving a unipolar stepper motor. The pulse sequence is the same. The only difference between driving a unipolar stepper motor and driving a bipolar stepper motor is that there is an extra wire in a unipolar stepper motor you have to hook up.


Programming

code.JPG

If I Was Helpful

vlcsnap-2016-10-04-12h30m59s610.png

First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

My YouTube Channel