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 interface Stepper Motor with PIC18F4550 Microcontroller- (Part 13/25)

By Amit Joshi

 
A Stepper Motor is a brushless, synchronous DC motor which divides a full rotation into a number of steps. For detailed information on working, types and stepping modes, refer the article on Stepper Motors. Here the operation of a unipolar Stepper motor with PIC18F4550 microcontroller has been explained.

 

As stated earlier, a Stepper motor rotates step by step. Each stepper motor has a defined step angle which is the minimum degree of rotation in a single step. This step angle depends on the internal construction of the motor. If a stepper motor has a step angle of 1.8°, then it would need 200 steps for a complete circular rotation. For control operation, construction and stepping modes, refer the article on Stepper Motors.
 
The stepper motor consists of a Rotor and four Stators. The stators are rounded with center-taped winding. The center-taped terminals are known Common terminals. Thus a unipolar stepper motor consists of total 6 wire-ends (four wires for coils and two for the common ends).
 Unipolar Stepper Motor with 6 Wire-Ends
Fig. 2: Unipolar Stepper Motor with 6 Wire-Ends
 
The COMs are connected with +12V which is the power supply to drive the stepper motor. To rotate the Rotor, zero voltage is provided at coil-ends one by one in a sequential manner. (Based on this sequence, stepper motors have different stepping modes which are explained in the article on Stepper Motor)
 
The sequential voltage signals are provided by the PIC microcontroller. A repetitive sequence of 1110, 1101, 1011 and 0111 is sent by PIC18F4550 to its PortB pins to rotate the Stepper motor.
 
Although this PIC microcontroller can provide enough output current to drive the stepper motor, but its becomes more efficient by employing a current driver between the controller and motor. For this purpose, sometimes ULN2003 is used to drive the stepper motor. Check interfacing Stepper motor with 8051 using ULN2003 for reference.
 

Project Source Code

###

// Program to Interface Stepper Motor with PIC18F4550 Microcontroller
void main()
{
	unsigned int i=0;
	TRISB=0;                       // Set PortB as output port
	while(1)
	{
		LATB=0x07;             //  To send 1110 at PortB
        	Delay_ms(20);
        
        	LATB=0x0B;             //  To send 1101 at PortB
        	Delay_ms(20);
        
        	LATB=0x0D;             //  To send 1011 at PortB
        	Delay_ms(20);
        
        	LATB=0x0E;             //  To send 0111 at PortB
       	 	Delay_ms(20);
        }
}

###

 


Circuit Diagrams

Circuit-Diagram-of-How-to-interface-Stepper-Motor-with-PIC-Microcontroller

Project Components

  • PIC18F4550

Project Video


Filed Under: PIC Microcontroller
Tagged With: microcontroller, motor, pic18f4550, stepper motor
 

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

  • 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)

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 Research robot samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Do you use C++ for device drivers in embedded systems?
  • MAX5389 resetting by noise
  • Help with Verilog replicate operator
  • Verilog/SV: Using an array as a set of individual registers and not RAM
  • How did they made the old manuals or magazines sketches?

RSS Electro-Tech-Online.com Discussions

  • Relaxation oscillator with neon or...
  • MOSFET gets hot and burns
  • LCD display on PICDEM 2 Plus board
  • software PWM
  • Positive and negative sides of voltage source
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