Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

How to control Stepper Motor using ULN2003 and 8051 Microcontroller (AT89C51)- (Part 17/45)

By Himanshu Choudhary

 
This project is an extension to two-phase Unipolar Stepper motor interfacing with AT89C51. In the previous project, transistor switches were used to interface the stepper motor with the microcontroller. Here the transistors have been replaced by using a ULN2003 IC to drive the stepper with 8051 microcontroller.

 


Stepper motor is a variable reluctance DC motor. When correct input sequence of signal is given to the motor, it starts rotation in steps. (For more detail refer Unipolar Stepper motor interfacing with microcontroller AT89C51).

ULN2003 is high voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Here it is used as a current driving IC. This IC is required because stepper motor require more than 60mA current and since controller doesn’t work at this current rating so this IC provides high current to the stepper motor. 

In the circuit port P2 as output port which provide input sequence to four input pins of ULN3003 and output of ULN2003 drives the motor. 

Input sequences are same as in previous project which are

Simplest sequence

0001

0010

0100

1000

And for half step size

0001

0011

0010

0110

0100

1100

1000

1001

Project Source Code

###

// Program to control Stepper Motor with AT89C51 using ULN2003
/**** Wave Drive Stepping ****/
#include<reg51.h>
sfr stepper=0xA0;

void delay(unsigned int count)
{
	int i;
	for(i=0;i<count;i++);
}

void main()
{
	while(1)
	{
		stepper=0x01;
		delay(350);
		stepper=0x02;
		delay(350);
		stepper=0x04;
		delay(350);
		stepper=0x08;
		delay(350);
	}
}
/*****************************/

/**** Half Drive Stepping ****/
#include<reg51.h>
sfr stepper=0xA0;

void delay(unsigned int count)
{ 
	int i;
	for(i=0;i<count;i++);
}

void main()
{
	while(1)
	{
		stepper=0x01;
		delay(300);
		stepper=0x03;
		delay(300);
		stepper=0x02;
		delay(300);
		stepper=0x06;
		delay(300);
		stepper=0x04;
		delay(300);
		stepper=0x0C;
		delay(300);
		stepper=0x08;
		delay(300);
		stepper=0x09;
		delay(300);
	}
}
/*****************************/

###

 


Circuit Diagrams

Circuit-Diagram-Controlling-Stepper-Motor-ULN2003-8051-Microcontroller-AT89C51

Project Components

  • AT89C51 Microcontroller
  • ULN2003

Project Video


Filed Under: 8051 Microcontroller
Tagged With: 8051, microcontroller, motor, stepper motor, uln2003
 

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

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!


Featured Tutorials

  • Designing Gate Driver Circuit and Switching Mechanism for Modified Sine Wave Inverter – (Part 9/17)
  • Completing Modified Sine Wave Inverter Design with Full Bridge Circuit and Step Up Transformer – (Part 10/17)
  • Designing an Offline UPS – Part (12 /17)
  • How to reduce Switching Time of a Relay – (Part 15/17)
  • Testing MOSFET – (Part 16/17)
  • Driving High Side MOSFET using Bootstrap Circuitry – (Part 17/17)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Renesas to demonstrate first working silicon based on the Arm Cortex-M85 processor
  • STMicroelectronics releases first automotive IMU with embedded machine learning
  • Infineon offers DC-DC controller for full LED headlamps without a microcontroller
  • Vishay launches new high-precision, thin-film wraparound chip resistor
  • STMicroelectronics’ common-mode filters ensure signal integrity in serial interfaces

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd ldr led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • IC wirebonding question
  • PS4 chip replacement not going to plan
  • Level shifter for differential oscillator
  • Voltage reference level - how to choose?
  • Boost converter, 3W...shielded or unshielded inductor?

RSS Electro-Tech-Online.com Discussions

  • software PWM
  • Background of Members Here
  • Audio equalizer
  • SPI Questions
  • Dog Scarer
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering