Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Universal stepper motor speed controller

By Ashutosh Bhatt November 3, 2016

Universal stepper motor speed controller

Stepper motor is a digital motor. It rotates as per applied pulses. The pulses have to be applied in specific sequence to motor coil terminals. The speed of motor can be varied by varying the frequency of applied pulses. As the frequency is increased the speed is increased and vice versa. Increasing frequency means decreasing time period – delay of applied pulses. So as the time period of pulses is decreased the speed of motor increases and vice versa. The maximum frequency (means minimum time period) at which the pulses should be applied depends upon the maximum RPM of motor.
 
Prototype of 8051 Microcontroller based Universal Stepper Motor Speed Controller
 
Fig. 1: Prototype of 8051 Microcontroller based Universal Stepper Motor Speed Controller
 
The project given here demonstrates how to vary speed of any 6-wire or 5-wire unipolar stepper motor. The given circuit can control speed of any unipolar stepper motor having maximum voltage upto 100 V and current upto 5 A. The circuit uses NPN Darlington transistor TIP122 to drive stepper motor that is capable to handle 100 V @ 5A. The circuit is build using AT89C52 micro controller that varies frequency of applied pulses to vary motor speed from min to max. It also uses LCD to display motor speed from 10% to 100%.     
 
Description :
 
As shown in figure the circuit is built using micro controller AT89C52, LCD and Darlington transistor TIP122.
 
• Stepper motor is connected to port P2 pins. Port P2 pins P2.0 to P2.3 drives stepper motor through 4 Darlington amplifiers. P2 pins are    given to base input of TIP122 and collectors of TIP122 are connected to coil terminals of stepper motor. Two common terminals of stepper    motor are shorted and connected to Vcc
 
• LCD is connected to port P0 and P2 pins. Port P0 drives data pins D0 – D7 of LCD and port P2 pins P2.7, P2.6 and P2.5 are connected to   LCD control pins Rs, RW and En pins. One pot is connected to Vee pin as shown to vary brightness of LCD
 
• A 12 MHz crystal with two 33 pF capacitors is connected to crystal input pins to generate required clock signal 
 
 

Operation  :

 
• Initially the motor is stop. First the message is displayed on LCD as “stepper motor speed control”
 
• Then motor starts rotating at very low speed and the motor speed is displayed on LCD as 10%
 
• The motor rotates at this speed for 5 sec only. After 5 sec motor speed automatically increases to 20%
 
• The internal timer generates interrupts after every 50 ms. So when 100 such interrupts are counted it means 50×100 = 5000 ms = 5 sec 
 
• So when 5 sec time period is over the delay given between pulses to motor is decreased by 5 ms. So PRF (pulse repetition frequency) is increase so motor speed is increased
 
• Again after 5 sec, delay is further decreased by 5 ms. So speed is further increased by 10%
 
• Thus after every 5 sec speed is increased by 10% and that is displayed on LCD as 20%, 30%, 40 % and likewise.
 
• Speed is increased up to 100% and again it is set to 10%
 
• The delay is set to 40 ms and decreased to 4 ms. It is set as per maximum RPM of motor. Maximum RPM of motor is 75.
 
• If motor RPM is more we can decrease the delay further to 2 ms or 1 ms. 
 
 
 

Software program  :

 
The program downloaded into internal flash of AT89C52 performs following tasks
 
• Displays motor speed on LCD in % from 10% to 100%
 
• After every 5 sec decreases the time period of applied pulses 
 
• Applies pulses in sequence to rotate motor in clockwise direction
 
 
The program is written in C language. It is compiled using KEIL (IDE). It consists of following functions
 
 
LCD handling functions
 
• lcd_delay() – gives delay to LCD before data of command given to it
 
• writecmd() – sends command to LCD to configure it to initializes it
 
• writedata() – sends data to LCD that is to be displayed
 
• init_lcd() – initialize LCD to 8 bits / char, 7×5 dots / char
 
display_speed() function  – displays motor speed from 10% to 100% on LCD
 
delay() function – it generates variable delay in millisecond as per the value passed to it. The delay is
varied from 4 ms to 40 ms
 
timer0_ISR()  function – its timer 0 overflow interrupt function. It counts timer 0 overflow. Timer 0 will overflow after every 50 ms. When count reaches to 100 it gives 100×50 = 5000 ms = 5 sec time. So after every 100 counts the delay (time period) of applied pulses is decreased by 4 ms so motor speed is increased by 10%. 

 

Circuit Diagrams

Circuit-Diagram-8051-Microcontroller-Universal-Stepper-Motor-Speed-Controller

Project Video



Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • SMPS feedback circuit
  • How to generate and use large‑signal S‑parameter (LSSP) files for PA harmonic‑balance (HB) simulations?
  • Snooping Around is All
  • ADEM III ECM — No CAN Signal & Power Supply Issue
  • IGBTs without negative gate drive

RSS Electro-Tech-Online.com Discussions

  • More fun with ws2812 this time XC8 and CLC
  • Pic18f25q10 osccon1 settings swordfish basic
  • Pickit 5
  • turbo jet fan - feedback appreciated.
  • I Wanna build a robot

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How IoT network topologies work
  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe