3.7 Controlling A Stepper Motor With Remote
3.7 Controlling A Stepper Motor With Remote
Con e r
trolling a Ste p p
Mot
o r Wi t h Rem o t e
Overview
In this lesson, you will learn a fun and easy way to control a stepper motor from a
distance, using an IR remote control.
The stepper we are using comes with its own driver board making it easy to connect to our UNO.
Since we we wanna not to drive the motor directly from the UNO, we will be using an inexpensive
little breadboard power supply, that plugs right into our breadboard and power it with a 9V
1 Amp power supply.
The IR sensor is connected to the UNO directly, since it uses almost no power.
Component Required:
1) x Elegoo Uno R3
IR
VOUT
BLUE
GND
5V
YELLOW
GND +5V-12V
RED
5 6
Arduino BLUE
Uno
7
IN4 PINK
(Rev3)
x113647
4 8
3 IN3 YELLOW 9
IN2 ORANGE
PINK
2 10
1 IN1 RED 11
ORANGE
Connection Schematic
We are using 4 pins to control the Stepper and 1 pin for the IR sensor. Pins 8-11 are controlling the
Stepper motor and pin 12 is receiving the IR information.
We connect the 5V and Ground from the UNO to the sensor. As a precaution, use a breadboard power
supply to power the stepper motor, since it can use more power and we don’t want to damage the
power supply of the UNO.
Wiring diagram
Code
After wiring, please open program in the code folder With_Remote and click UPLOAD to
upload the program. See Lesson 5 of part 1 for details about program uploading if there are any errors.
Before you can run this, make sure that you have installed the < IRremote > < Stepper >library or
re-install it, if necessary. Otherwise, your code won't work. For details about loading the library file,
see Lesson 5 of part 1.
The code only recognise 2 values from the IR Remote control: positive (+) and negative (-).
When positive (+) is pressed on the remote the motor will make a full rotation clockwise.
negative (-) will make a full rotation counter-clockwise.