Lesson 16 Controlling Stepper Motor With Remote
Lesson 16 Controlling Stepper Motor With Remote
Remote
Introduction
In this lesson, you will learn a fun and easy way to control a stepper motor from
a distance using an IR remote control.
Hardware Required
1 * RexQualis UNO R3
1 * Breadboard
1 * IR receiver module
1 * IR remote
1 * Stepper motor
1 * 9V 1A Adapter
Principle
gradually and a higher voltage power source (I tested them with 12 volts DC) I
was able to get about 25+ RPM. These little steppers can be purchased
together with a small breakout board for the Arduino compatible ULN2003
stepper motor driver. Quite a bargain, compared to the price of a geared DC
motor, a DC motor controller and a wheel encoder! The low cost and small size
make the 28BYJ-48 an ideal option for small robotic applications and an
excellent introduction to stepper motor control with Arduino. Here are the
detailed specs of the 28BYJ-48 stepper motor.
Model:28BYJ-48
Rated voltage:5VDC
Number of Phase:4
Stride Angle:5.625°/64
Frequency:100Hz
DC resistance:50Ω±7%(25°C)
Insulation grade:A
Noise<35dB(120Hz,No load,10cm)
The ULN2003 stepper motor driver board allows you to easily control the
28BYJ-48 stepper motor from a microcontroller, like the Arduino Uno. One side
of the board side has a 5 wire socket where the cable from the stepper motor
hooks up and 4 LEDs to indicate which coil is currently powered. The motor
cable only goes in one way, which always helps. UNL2003 board On the side
you have a motor on / off jumper (keep it on to enable power to the stepper).
The two pins below the 4 resistors, is where you provide power to the stepper.
Note that powering the stepper from the 5 V rail of the Arduino is not
recommended. A separate 5-12 V 1 Amp power supply or battery pack should
be used, as the motor may drain more current than the microcontroller can
handle and could potentially damage it. In the middle of the board we have the
ULN2003 chip. At the bottom are the 4 control inputs that should be connected
to four Arduino digital pins.
Code interpretation
#include "Stepper.h"
#include "IRremote.h"
void setup()
void loop()
switch(results.value)
small_stepper.step(Steps2Take);
delay(2000);
break;
case 0xFFC23D: // VOL- button pressed
small_stepper.setSpeed(500);
small_stepper.step(Steps2Take);
delay(2000);
break;
Experimental Procedures
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.
Controlling_Stepper_Motor_With_Remote_Code
Step 3: Attach Arduino UNO R3 board to your computer via
USB cable and check that the 'Board Type' and 'Serial Port' are
set correctly.
Then you can control the motor left and right by remote
control and infrared control.
If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board. For
how to upload the code and install the library, check Lesson 0
Preface.