Controlling Stepper Motor with Joystick and Arduino

Controlling Stepper Motor with Joystick and Arduino (Last Updated On: February 22, 2019)

Controlling Stepper Motor with Joystick and Arduino:

In this post we will learn about Controlling Stepper Motor with Joystick and Arduino. Here we will control stepper motor speed and direction of rotation using Arduino UNO board and PS2 joystick.

We will be using 28BYJ-48 unipolar 5V DC stepper Motor which comes with internal driver. So there is no need of any Easy Step Driver. Rather we will use ULN2003A Darlington Pair Motor Driver IC. The PS2 Joystick consists of two potentiometers of 10k ohm, i.e one for the X-axis and the other for the Y-axis. It also consist a push-button. But we will use only X-axis to control the stepper motor movement. Before getting started check our previous article: Stepper motor Control with Potentiometer and Arduino




Components Required:

1. Arduino UNO Board (Buy Online from Amazon)
2. 28BYJ-48 5V DC Stepper Motor (Buy Online From Amazon)
3. ULN2003 Motor Diver IC (Buy Online From Amazon)
4. PS2 Joystick (Buy Online From Amazon)
5. 5V DC Supply

What is Stepper Motor?

Stepper motor Control with Potentiometer & Arduino

A stepper motor or step motor or stepping motor is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor’s position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.


Stepper Motor 28-BYJ48 Connection:

Stepper Motor 28-BYJ48 is a Unipolar motor with 5-lead coil arrangement. There are four coils which have to be energized in a particular sequence. The Red wires will be supplied with +5V and the remaining four wires will be pulled to ground for triggering the respective coil. We used Arduino board to energize these coils in a particular sequence and make the motor perform the required number of steps.

Controlling Stepper Motor with Joystick and Arduino


Need of ULN2003 as Driver:

Stepper Motors operates with the help of driver IC. The reason is the controller requires high current for operation but the stepper motor alone will not be able to provide enough current from its I/O pins for the motor to operate. So with the application of ULN2003 as a driver module current is amplified.

Stepper motor Control with Potentiometer & Arduino


Circuit Diagram & Connection:

For Controlling Stepper Motor with Joystick and Arduino, assemble the circuit as shown in the figure below.

Controlling Stepper Motor with Joystick and Arduino


Steps Calculations:

There is need of calculations of steps before uploading code to Arduino board for Stepper motor Control with Potentiometer and Arduino

In Arduino we will be operating the motor in 4-step sequence so the stride angle calculation is necessary.

Stride Angle = 5.625°
Arduino Step Sequence = 4
Required Step Sequence = 8
Steps per Revolution = 5.625*2 = 11.25

Steps per revolution = 360/step angle= 360/11.25 = 32 steps per revolution.




Source Code/Program:


Video Tutorial:

Recommended For You

Ask A Question .......

Close