CD ROM Stepper motor Arduino L298n + Joystick controlled speed and Direction Control

(Last Updated On: July 17, 2019)

stepper motor

Description:

In this Tutorial, you will learn how to control the speed and direction of the CD ROM stepper motor using 2 axis joystick, L298N motor driver and Arduino. The stepper motor control system can be activated and deactivated using the joystick push button. The same program and circuit connections can be used for the other types of the stepper motors.

For the extreme basics, you can watch my getting started tutorials on the bipolar and unipolar stepper motors, 2 Axis Joystick and L298n motor driver. So I highly recommend first you should watch these tutorials and then you can resume from here. The Tutorials links are given below.


UniPolar and Bipolar Stepper Motors Basics:

2 axis joystick getting started Tutorial:

 

L298n getting started tutorial:


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
L298N motor driver: https://amzn.to/2DF41EX
Joystick: https://amzn.to/2E2Q0kI
12v UniPolar stepper motor: https://amzn.to/2IFpIbU
CD ROM bipolar stepper motor: https://amzn.to/2XE38UG
24BYJ48 5V DC unipolar stepper motor: https://amzn.to/2L0Wm9U
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

Circuit Diagram:

stepper motor

Regardless of the type and size of the stepper motor the basic working principle of all the stepper motors is exactly the same. The circuit diagram as you can see on the screen will remain the same for all types of the stepper motors. As the stepper motor, I am using has current requirement less than 4amps so that’s why I decided to use the L298N motor driver. The L298N motor driver is basically designed for controlling simple dc motors; in my previous tutorials, I used this motor driver for controlling the Robot… As the L298N motor driver has the ability to control 2 dc motors at the same, and as you know a stepper motor has 4 wires, so it means we can use the L298N motor driver to control a Unipolar or bipolar stepper motor. You might be thinking what about the Unipolar motors as they have 6 wires. Well, the common wires are not connected. So the Unipolar stepper motor connection with the l298n motor driver is exactly the same as the bipolar stepper motor.


As you can see in the circuit diagram the four wires of the stepper motor are connected with the out1, out2, out3, and out4. While the input pins of the l298N motor driver are connected with Arduino’s Pin number 8, 9, 10 and 11.

The enables pins of the l298n motor driver by default comes with the jumper caps, so make sure you remove the jumper caps and connect the enable pins with the Arduino’s pin number 6 and pin number 7.


J1 is the DC female power jack, this is where we connect the external 12v or 5v power supply and finally connect the VCC of the L298N motor driver with the Arduino’s 5volts.

The vrx and vry pins of the joystick are connected with the analog pins A0 and A1. The Switch is connected with the Arduino’s pin number 4. The VCC pin of the joystick is connected with the Arduino’s pin number 5, while the ground is connected with the Arduino’s Ground.

Let me tell you once again if you are using stepper motors with current ratings greater than 4amps then never use the l298N motor driver. Now let’s have a look at the pinout of the L298N motor Driver.


Programming:

Watch Video Tutorial:

 

Other Stepper Motor Related Tutorial:

UniPolar and Bipolar Stepper Motors Speed and Position Control

 

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply