Wednesday, October 12, 2016

5V Stepper Motor controls using Arduino Uno

This blog is about my Stepper motor that I used to control using an Arduino Uno.
A Stepper motor works in steps and there are times when you need to move the motor in steps -like in a wall clock. This is where the motor comes handy.

( the other types of motors are Servo, and DC motor - more of it in other blogs.)

Here I will control the Stepper motor and tell how to make it work with the Arduino Uno.

Cost :
Stepper Motor :125 rupees
ULN 2003    : 7 rupees.
Arduino Uno : 400 rupees.

Time to put it all together - one afternoon -including debugging and figuring out the wiring.
Skill level : Beginner to Medium.

Stepper Motor :

The stepper motor that I used is 28BYJ-48 and can be programmed to spin in steps to suit our industrial needs. It needs a 5V external power supply and I used a wall adapter. DO NOT use the 5V from Arduino !!!

The challenge was that after wiring the circuit and I executed the File -> Examples -> Stepper - > One Step Revolution, the motor would only move in 1 direction ( counter clockwise ) and would not do clockwise.

So, I had to change the wiring of Pin 9 to 10, and Pin 10 to 9 on the Arduino - to make it work.
Found the link here. https://forum.arduino.cc/index.php?topic=143276.0

In other words - don't pin 8,9,10 and 11 to Input 1,  2, 3 and 4, but instead pin to Input 1, 3 , 2 and 4 on the ULN 2003.
( the source in the File -> Examples had to be modified to make this work )

The next challenge is - this Motor driver ULN 2003 cannot move the motor direction on a DC motor. ( You cannot control a DC motor in reverse )
So this motor driver can only be used for a Stepper Motor and NOT a DC motor.

DO NOT CONNECT the Output pins of the Arduino to the Stepper Motor as you will fry your Arduino- Use the IC in between to make this work.

Have a 5V power supply ( wall adapter ) handy to work with the motor.


The circuit diagram of a ULN 2003 motor driver is as shown :

The inputs on the left are from the Arduino Pins and Outputs will go to the Stepper Motor. You are still left with 3 more Pins after all this.






The circuit is as shown: ( the only correction is Pin 9 and 10 has to be interchanged )













No comments:

Post a Comment