Arduino SA
  • Learn @ Arduino SA
  • Arduino Introduction
  • Support
    • Setup your Computer
    • Adding Libraries
    • Setting up a ESP32
  • Arduino Robot Car
    • Arduino Bluetooth Car
      • What you will need
      • Circuit Diagram
      • Assembly the Car
      • Upload the Code
      • Bluetooth setup and Test
    • 4WD Obstacle Avoidance
      • Introduction
      • Component List
      • Assembly
      • Component Description
      • Circuit Diagram
      • Computer Setup
      • Line Tracking Mode
      • Obstacle Avoidance Mode
  • Arduino Kits
    • Smart Plant Watering Kit
      • What you will need
      • Wiring Diagram
      • The Code
      • Pics
    • Basic Starter Kit
      • Component View
      • Installing the IDE
      • Add Libraries
      • Blink
      • Button Control LED Delay Switch
      • Active Buzzer
      • Passive Buzzer
      • Servo
      • IR Remote and Receiver
      • Stepper Motor
      • Eight LED with 74HC595
      • LCD
      • Digital tube with Traffic Light Experiment
      • Four digit tube display
      • LM35D Temperature Sensor
      • LDR 5516 experiment
      • Flame Sensor
      • 8 * 8 LED Module
      • Controlling Stepper Motor With Remote
    • Super Starter Kit
      • Tutorials
    • Best Beginner Kit for Arduino
      • Tutorials
    • Uno R3 RFID Kit
    • WIFI ESP32 IOT Kit
    • Arduino School STEM Kit
    • Arduino Ultimate Starter Kit
  • Blocking Coding Lessons
    • Beginner Lessons
      • Setting up mBlock
      • Blinking an LED
      • LED Switching
      • LED Chasing
      • Traffic Signal
      • Buzzer
      • Buzzer + Push Button
      • LED + Push Button
  • Sensor Kits
    • 37-in-1 Sensor Kit
      • Joystick
      • Relay
      • Big Sound
      • Small Sound
      • Tracking
      • Avoid
      • Flame
      • Linear Hall Sensor
      • Touch
      • Digital Temperature
      • Buzzer
      • Passive Buzzer
      • RGB LED
      • SMD RGB
      • Two-Color 5mm
      • Two Color 3mm
      • Reed Switch
      • Mini Reed
      • Heartbeat
      • 7 color flash
      • Laser emitter
      • PCB mounted push Button
      • Shock switch
      • Rotary encoder
      • Light Cup
      • Tilt Switch
      • Rolling ball tilt switch
      • Photoresistor
      • Temp and Humidity
      • Analog Hall
      • Hall Magnetic
      • Temp
      • Analog Temp
      • IR Emission
      • IR Receiver
      • Tap Module
      • Light blocking
Powered by GitBook
On this page
  • Component Required:
  • Connection Diagram:
  • Wiring schematic:
  • Code

Was this helpful?

  1. Arduino Kits
  2. Basic Starter Kit

Stepper Motor

In this lesson, you will learn a fun and easy way to drive a stepper motor. The stepper we are using comes with its own driver board making it easy to connect to our UNO.

PreviousIR Remote and ReceiverNextEight LED with 74HC595

Last updated 3 years ago

Was this helpful?

Component Required:

1 x Arduino Uno R3

1 x 830 tie-points breadboard

1 x ULN2003 stepper motor driver module

1 x Stepper motor

1 x 9V1A Adapter

1 x Power supply module

6 x F-M wires (Female to Male DuPont wires) 1 x M-M wire (Male to Male jumper wire)

Stepper Motor:

A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence.

The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. One of the most significant advantages of a stepper motor is its ability to be accurately controlled in an open loop system. Open loop control means no feedback information about position is needed.

This type of control eliminates the need for expensive sensing and feedback devices such as optical encoders. Your position is known simply by keeping track of the input step pulses.

ULN2003 Driver Board

Connection Diagram:

Wiring schematic:

Code

After wiring**,** install the Stepper.zip library

#include <Stepper.h>
const int stepsPerRevolution = 1500;
// change this to fit the number of steps per revolution
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void setup()
{
  // set the speed at 20 rpm:
  myStepper.setSpeed(20);
  // initialize the serial port:
  Serial.begin(9600);
}
void loop() { // step one revolution  in one direction:
  Serial.println("clockwise");
  myStepper.step(stepsPerRevolution);
  delay(500);// step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution); delay(500);
}
10KB
Stepper.zip
archive
637B
Stepper_Motor.ino