Stepper Motor Serial Controller
You have been successfully subscribed to the Notification List for this product and will therefore receive an e-mail from us when it is back in stock! For security reasons, an e-mail has been sent to you acknowledging your subscription.
Please remember that this subscription will not result in you receiving any e-mail from us about anything other than the restocking of this item. If, for any reason, you would like to unsubscribe from the Notification List for this product you will find details of how to do so in the e-mail that has just been sent to you!
Hello friends! I hope you all will be absolutely fine and having fun. Today, I will elaborate you that how can we make a simple algorithm for Stepper Motor Direction Control using Arduino. In my previous tutorials I made algorithm for, DC Motor Speed Control using Arduino and DC Motor Speed Control using Matlab. Now, in this tutorial I will control a stepper motor using Arduino by entering the different commands through its serial port. Before going into the detail of this tutorial, you must know the basic difference between stepper and DC motors.
DC motors have only two input terminal one is positive and the other one is negative. You just have to provide the power supply and it will start rotating but this is not the case in stepper motor.
• 2A 5V-16V dual serial motor controller. Stepper motor driver & motor to choose in Electronics & Electrical. Hi, First, here is the links to: Stepper motors. Stepper Motor Controllers and other robot products. Serial DC Controllers. SPI based stepper motor controller.
The stepper motor which I will use in this tutorial, has six pins out of which four pins provide pulses or steps and the other two pins are power pins. So, in this tutorial I will control this six pins stepper motor using L298 motor controller and Arduino UNO board.
Basically we can use stepper motor where precision is required. Stepper motor has wide range of applications e.g robotics, CNC machines, home automation etc.
In simple word, we can say that stepper motor can be used where there is a need to move at particular angle. So, let’s get started with Stepper Motor Direction Control using Arduino: Stepper Motor Direction Control using Arduino In this tutorial we will learn how to make a program for Stepper Motor Direction Control using Arduinoby sending dfferent commands from the serial port. First of all, I am going share the list of components used for this mini project. Arduino UNO.
Stepper motor (6 wire). L298 Motor Controller (H-Bridge).
Voltage Regulator (7805). 1000uF. Jumper Wires. Solderig Iron. Soldering Wire I want to tell you a bit about the stepper motor because all the other components are discussed in detail in. Stepper Motor. Basically, stepper motors are like the DC motors that rotate in discrete steps.
They have multiple arranged coils and they are usually known as phases. Motor will rotate one step at a time if we energize each phase sequence. High levels of precision can be achieved by controlling the stepper motor with computer. Steppers motors are available in the market in many different sizes. The speed of the stepper motor is controlled by frequency of pulses generated.
Stepper Controller Arduino
They have wide range of applications like hard disk drives, robotics, telescope, antenna, toys etc. A six wire stepper motor is shown in the figure below. I have designed and its screen shot is given in the figure below. You can download complete source code for Stepper Motor Direction Control using Arduino by clicking the below button. I have used 6 wire stepper motor and each wire has its own function.
I have first divided these six wires into two pair. Each pair is consisting of three wires out of which one wire is common and the other two generate pulses.
The two pair of three wires are shown in the figure below. Then, I have chosen a common wire in each pair from which the resistance to the other two wires is common. I have checked the resistance from the common wire to the both of the other wires of the same pair.
I found that the resistance from the common wire to both of the other wires is same. We can see in the figure above the blue, pink and white wires belong to the same pair out of which white is a common wire. Here is the screen shot of the figure when I found the resistance between white and blue wire and I found it to be 8.0 ohms. The screen shot of the above steps is shown in the figure below. After that. I checked the resistance between white and pink wire and found it to be 8.1 which is almost the same as 8.0 so, this shows that the white wire is common to both of the blue and pink wire. Here is the screen shot of the above step.
Then I found the resistance between pink and blue wire and it was 15.6 which is exactly the double of the earlier resistance. It is shown in the figure below.
I have connect the both common wires as shown in the figure below. Here’s the video in which I have discussed it in detail How to identify the wires of Stepper Motor:. The remaining four wires are used to generate pulses which are also know as steps.
I have connected theses four wires to the output pins OUT1, OUT2, OUT3 and OUT4 of the L298 micro controller. Input pins of L298 micro controller In1, In2, In3 and In4 are connected to the pin no 7, 6, 5 and 4 of the Arduino UNO’s board respectively. I have made a simple block diagram for Stepper Motor Direction Control using Arduino, which will be helpful to clearly understand the algorithm and the assembling of the components of Stepper Motor Direction Control using Arduino. The screenshot of the block diagram is shown in the figure below.
Stepper Motor Serial Vs Parallel
First of all we need a power supply to run the project properly. Arduino reads the commands from the serial port and sends to the L298 motor driver to rotate the stepper motor. The commands got printed on the LCD (Liquid Crystal Display). Arduino Source Code Description.
In the code given above we have first initialized the LCD and Stepper motor libraries. Then, I assigned stepper motor pins at which it is connected to the Arduino. After that I initialized the LCD pins at which it is connected to Arduino UNO.

Then I have made three different if statements, C for the clockwise, A for the anti clockwise rotation and S for the no rotation. Then in the loop I called clock wise and anti clockwise functions whose source code will be give and explained below.
Then, I cleared the serial data in order to stop the rotation of the motor. The source code of the clockwise function is given below. The actual hardware operating setup for Stepper Motor Direction Control using Arduino is given in the figure below:. Now, if you send the command C through the serial port the stepper motor will start to rotate in clockwise direction and the command will also be printed on the LCD. The screenshot of the printed command on LCD is shown in the figure below.
Now, if you send the command A through the serial port the stepper motor will start to rotate in anti clockwise direction and the command will also be printed on the LCD. The screenshot of the printed command on LCD is shown in the figure below. Now, if you send the command S through the serial port the stepper motor will show no more rotation and the command will also be printed on the LCD.

The screenshot of the printed command on LCD is shown in the figure below. Here’s the complete video demonstration of Stepper Motor Direction Control using Arduino, I hope it will help as well: That’s all from the tutorial Stepper Motor Direction Control using Arduino. I hope you enjoyed this tutorial. If you face any sort of problem, you can ask me anytime without feeling any kind of hesitation. I will try my level best to solve your problem in a better way if possible. Crazy chicken game. I will explore Arduino by making different projects on it. Till then, Take care 🙂.