28BYJ-48 Stepper Motor Control System Based On Arduino With

ICStation Team introduces to you this stepper motor control system based on the ICStation UNO compatible with Arduino. It uses a ULN2003 chip to drive it. 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.

28BYJ-48 Stepper Motor Control System Based On Arduino With

Functions

1. When it starts up, the stepper motor will rotate in the clockwise direction. At the same time the 1602 LCD will display the stepping rate and rotating direction.

2. When you press key 1, 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

Working Principle:

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

28BYJ-48 Stepper Motor Control System Based On Arduino With Schematic
Stepper Motor Code
#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(“<<<<<<“); }

 

For more detail: 28BYJ-48 Stepper Motor Control System Based On Arduino With


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top