28BYJ-48 Stepper Motor Control System Based on Arduino With ULN2003 Chip

32,871

59

14

Introduction: 28BYJ-48 Stepper Motor Control System Based on Arduino With ULN2003 Chip

About: www.ICStation.com is a top store of electronic, which specializes in all kinds of IC products, such IC accessories, Module, Robots, Development Board, Transistor, Capacitor and so on. We're located in Shenz…

ICStation Team introduce you this stepper motor control system based on ICStation UNO compatible with Arduino. It uses ULN2003 chip to drive. The working voltage is DC5V. It is widely used on ATM machine, inkjet printer,cutting plotter, fax machine,spraying equipment, medical instruments and equipments, PC peripheral, and USB Mass Storage ,precise instrument,industrial control system,office automation,robot areas,etc.

Functions

1.When start up, the stepper motor will rotate in the clockwise direction, at the same time the1602 LCD will display the stepping rate and rotating direction.

2.When you press the key1, the stepper motor will rotate in the counter-clockwise direction.

3.When you turn the potentiometer to the left or to the right, you can adjust the stepping rate of the stepper motor. At the same tine the 1602 LCD will display the current speed.

Code for your reference:

http://www.icstation.com/newsletter/eMarketing/Stepper_Motor_Code.txt

Step 1: Components List

Step 2: Schematic Diagram

Working Principle:

To change the rotating speed of the stepper motor by changing the input frequency of pulse signal. And to realize the motor rotating in the clockeise direction and counter-clockwise direction by controlling the transform sequence of the pulse signal.


Step 3: Overall Hardware Connected Diagram

Step 4: Plug Into the Power Supply Wires and Place the Components

Step 5: Connect the LCD1602

Step 6: Connect the Stepper Motor

Step 7: Connect the Signal End and Power Supply End

Connect the signal end of the components and the cathode and anode of the power supply to the ICStation UNO board compatible with Arduino and common port of power supply.

Step 8: The Experimental Effect After Starting Up the Power Supply

Gadget Hacking and Accessories Contest

Participated in the
Gadget Hacking and Accessories Contest

Be the First to Share

    Recommendations

    • For the Home Contest

      For the Home Contest
    • Big and Small Contest

      Big and Small Contest
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge

    14 Comments

    0
    bill1959parker
    bill1959parker

    Question 2 years ago on Step 8

    Do you hold down the button to keep it running or can I use end stop switches instead of the buttons so it keeps hitting the end stops and reversing the opposite way on a linear rail?
    Thank you
    Bill

    0
    krisald444
    krisald444

    3 years ago

    I kept wondering why i put everything you showed on Fritzing together, just as the picture showed yet wouldn't work. I went back and compared the picture of your finished circuit with the Fritzing. You forgot to put on your Fritzing a Ground wire that's connected to the LCD on pin RW and Connect the 50K POT to A0 on the Arduino. (everything else is correct and will work after). Thanks for everything else this is perfect for what i need making a Barn Door Star Tracker w/ adjustable speed.

    StepperPWMlcd_bb.jpg
    0
    krisald444
    krisald444

    Reply 3 years ago

    Here's the corrections on Fritzing with the 28BYJ-48 included, on LCD ground connected to RW, and 50k pot connected to A0 on Arduino

    0
    bernyro
    bernyro

    4 years ago

    salve mi sono iscritto al vostro sito pagando la quota minima e vorrei realizzare questo progetto del motore passo passo con arduino,ma mi manca lo sketch…..

    me lo potete inviare?

    0
    GianL
    GianL

    6 years ago

    Hi, good job man ;-) I wish to ask you if iou can tell me how, adding a
    third button, to tell the motor to stop, assuming that the motor
    rotates continuously when the left or right button is pressed.

    Thank you for any help ;-)

    0
    dancopy
    dancopy

    7 years ago

    1) Can be used stepper motor 12 volts? (Printer)
    2) key1 and key2 is the engine rotation direction?
    Thank you

    0
    Skyfinder
    Skyfinder

    7 years ago

    Doesn't Work, the attachInterrupt not work... The stepper rotate ok, but the button are Useless... Wiring is correct. Something wrong in code. I use ad Arduino Uno Adeept, until now every projects works...this no. I tried to change some way to code, like digitalWrite (pin, HIGH); for the pullup but same result

    0
    Prince N
    Prince N

    7 years ago

    I am working on a project that uses 4 ldr's, two potentiometers and 2 step motor 28byj-48 to track the movement of the sun. I really need help with the programming

    0
    Prince N
    Prince N

    7 years ago

    I am working on a project that uses 4 ldr's, two potentiometers and 2 step motor 28byj-48 to track the movement of the sun. I really need help with the programming

    0
    mike_menci
    mike_menci

    Reply 7 years ago

    10K

    0
    mike_menci
    mike_menci

    7 years ago

    #include <Stepper.h>

    #include <LiquidCrystal.h>

    int Iint1=0;

    int Iint2=1;

    int anjian1=2;

    int anjian2=3;

    int motorSpeed;

    LiquidCrystal lcd(9,8,7,6,5,4);

    const int stepsPerRevolution =200;

    // Here set the stepper motor rotation step how much is a circle

    int dim=stepsPerRevolution;

    // Set the step motor number and pin

    Stepper myStepper(stepsPerRevolution, 10,11,12,13);

    void setup()

    {

    lcd.begin(16, 2);

    lcd.print("speed:");

    lcd.setCursor(10,0);

    lcd.print("n/min");

    lcd.setCursor(0, 1);

    lcd.print("Direction:");

    // Set the motor speed of 60 steps per minute

    myStepper.setSpeed(60);

    pinMode(anjian1,INPUT_PULLUP);

    pinMode(anjian2,INPUT_PULLUP);

    attachInterrupt(Iint1,counterclockwise,FALLING);

    attachInterrupt(Iint2,clockwise,FALLING);

    Serial.begin(9600);

    }

    void loop()

    {

    myStepper.step(dim);

    void Direction();

    // Read the sensor values:

    int sensorReading = analogRead(A0);

    // Map it to a range of 0-150:

    int motorSpeed = map(sensorReading, 0, 1023, 0, 150);

    // Set the motor speed:

    if (motorSpeed > 0)

    {

    myStepper.setSpeed(motorSpeed);

    lcd.setCursor(6,0);

    lcd.print(float(float(motorSpeed)/float(200)));

    }

    }

    void clockwise()

    {

    // clockwise rotation

    dim=stepsPerRevolution;

    lcd.setCursor(10, 1);

    lcd.print(">>>>>>");

    }

    void counterclockwise()

    {

    // anti-clockwise

    dim=-stepsPerRevolution;

    lcd.setCursor(10, 1);

    lcd.print("<<<<<<");

    }

    0
    steinie44
    steinie44

    8 years ago on Introduction

    If you use a ULN2803, you can run 2 steppers. Put a PCF8574 IC in front of that and you can use I2C, only 2 pins.