SlideShare a Scribd company logo
Stepper motor Interfacing/Control using 8085 and 8051
Stepper Motor
A stepper motor is a device that translates electrical pulses into mechanical movement in steps of
fixed step angle.
 The stepper motor rotates in steps in response to the applied signals.
 It is mainly used for position control.
 It is used in disk drives, dot matrix printers, plotters and robotics and process control
circuits.
Structure
Stepper motors have a permanent magnet called rotor (also called the shaft) surrounded
by a stator. The most common stepper motors have four stator windings that are paired with a
center-tap. This type of stepper motor is commonly referred to as a four-phase or unipolar stepper
motor. The center tap allows a change of current direction in each of two coils when a winding is
grounded, thereby resulting in a polarity change of the stator.
Interfacing
Even a small stepper motor require a current of 400 mA for its operation. But the ports of
the microcontroller cannot source this much amount of current. If such a motor is directly
connected to the microprocessor/microcontroller ports, the motor may draw large current from the
ports and damage it. So a suitable driver circuit is used with the microprocessor/microcontroller to
operate the motor.
Motor Driver Circuit (ULN2003)
Stepper motor driver circuits are available readily in the form of ICs. ULN2003 is one such
driver IC which is a High-Voltage High-Current Darlington transistor array and can give a current
of 500mA.This current is sufficient to drive a small stepper motor. Internally, it has protection
diodes used to protect the motor from damage due to back emf and large eddy currents. So, this
ULN2003 is used as a driver to interface the stepper motor to the microcontroller.
Operation
The important parameter of a stepper motor is the step angle. It is the minimum angle through
which the motor rotates in response to each excitation pulse. In a four phase motor if there are
200 steps in one complete rotation then then the step angle is 360/200 = 1.8O
. So to rotate the
stepper motor we have to apply the excitation pulse. For this the controller should send a hexa
decimal code through one of its ports. The hex code mainly depends on the construction of the
stepper motor. So, all the stepper motors do not have the same Hex code for their rotation. (refer
the operation manual supplied by the manufacturer.)
For example, let us consider the hex code for a stepper motor to rotate in clockwise direction is
77H , BBH , DDH and EEH. This hex code will be applied to the input terminals of the driver
through the assembly language program. To rotate the stepper motor in anti-clockwise direction
the same code is applied in the reverse order.
Stepper Motor interface- Schematic Diagram (for 8051)
The assembly language program for 8051 is given below.
ASSEMBLY LANGUAGE PROGRAM (8051)
Main : MOV A, # 0FF H ; Initialization of Port 1
MOV P1, A ;
MOV A, #77 H ; Code for the Phase 1
MOV P1, A ;
ACALL DELAY ; Delay subroutine
MOV A, # BB H ; Code for the Phase II
MOV P1, A ;
ACALL DELAY ; Delay subroutine.
MOV A, # DD H ; Code for the Phase III
MOV P1, A ;
ACALL DELAY ; Delay subroutine
MOV A, # EE H ; Code for the Phase 1
MOV P1, A ;
ACALL DELAY ; Delay subroutine
SJMP MAIN; Keep the motor rotating continuously.
DELAY Subroutine
MOV R4, #0FF H ; Load R4 with FF
MOV R5, # 0FF ; Load R5 with FF
LOOP1: DJNZ R4, LOOP1 ; Decrement R4 until zero,wait
LOOP2: DJNZ R5, LOOP2 ; Decrement R5 until zero,wait
RET ; Return to main program .
Stepper Motor interface - Schematic Diagram for (8085)
Detailed Connection diagram between 8085 and 8255
ASSEMBLY LANGUAGE PROGRAM (8085)
Main : MVI A, 80 ; 80H → Control word to configure PA,PB,PC in O/P
OUT CWR_Address ; Write control word in CWR of 8255
MVI A, 77 ; Code for the Phase 1
OUT PortA_Address ; sent to motor via port A of 8255 ;
CALL DELAY ; Delay subroutine
MVI A, BB ; Code for the Phase II
OUT PortA_Address ; sent to motor via port A of 8255
CALL DELAY ; Delay subroutine.
MVI A, DD ; Code for the Phase III
OUT PortA_Address ; sent to motor via port A of 8255;
CALL DELAY ; Delay subroutine
MVI A, EE H ; Code for the Phase 1
OUT PortA_Address ; sent to motor via port A of 8255 ;
CALL DELAY ; Delay subroutine
JMP MAIN ; Keep the motor rotating continuously.
DELAY Subroutine
MVI C, FF ; Load C with FF -- Change it for the speed variation
LOOP1: MVI D,FF ; Load D with FF
LOOP2: DCR D
JNZ LOOP2
DCR C
JNZ LOOP1
RET ; Return to main program .

More Related Content

What's hot

List of 8085 programs
List of 8085 programsList of 8085 programs
Switches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontrollerSwitches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontroller
University of Technology - Iraq
 
8051 memory
8051 memory8051 memory
8051 memory
Mayank Garg
 
program status word
program status wordprogram status word
program status word
sheetalverma38
 
Adc and dac
Adc and dacAdc and dac
Adc and dac
nitugatkal
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
Tech_MX
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
Dr.YNM
 
TMS320C5x
TMS320C5xTMS320C5x
VLSI subsystem design processes and illustration
VLSI subsystem design processes and illustrationVLSI subsystem design processes and illustration
VLSI subsystem design processes and illustration
Vishal kakade
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
NimeshSingh27
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
Shazid Reaj
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
Arjun Singh
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
Sudhanshu Janwadkar
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
parthi_arjun
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
Dr. AISHWARYA N
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
Shehrevar Davierwala
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
MNM Jain Engineering College
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
Directional couplers 22
Directional couplers 22Directional couplers 22
Directional couplers 22
HIMANSHU DIWAKAR
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions
ssuser2797e4
 

What's hot (20)

List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 
Switches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontrollerSwitches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontroller
 
8051 memory
8051 memory8051 memory
8051 memory
 
program status word
program status wordprogram status word
program status word
 
Adc and dac
Adc and dacAdc and dac
Adc and dac
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
 
TMS320C5x
TMS320C5xTMS320C5x
TMS320C5x
 
VLSI subsystem design processes and illustration
VLSI subsystem design processes and illustrationVLSI subsystem design processes and illustration
VLSI subsystem design processes and illustration
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
Directional couplers 22
Directional couplers 22Directional couplers 22
Directional couplers 22
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions
 

Similar to Stepper motor-interfacing

Applications of 8051 microcontrollers
Applications of 8051 microcontrollersApplications of 8051 microcontrollers
Applications of 8051 microcontrollers
Dr.YNM
 
Controlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
Controlled Rotation of the Shaft of a Stepper Motor with 8051 MicrocontrollerControlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
Controlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
inventionjournals
 
Stepper motor interfacing
Stepper motor interfacingStepper motor interfacing
Stepper motor interfacing
BIRLA VISHVAKARMA MAHAVIDYALAY
 
Stepper with 8051.docx
Stepper with 8051.docxStepper with 8051.docx
Stepper with 8051.docx
bhattparthiv23
 
INTERNAL GEAR PUMP
INTERNAL GEAR PUMPINTERNAL GEAR PUMP
INTERNAL GEAR PUMP
Suchit Moon
 
Microcontroller based four step linear stroke positioning system
Microcontroller based four step linear stroke positioning systemMicrocontroller based four step linear stroke positioning system
Microcontroller based four step linear stroke positioning system
Mukesh Khokhar
 
8255
82558255
It 5170 stepper motor
It 5170 stepper motorIt 5170 stepper motor
It 5170 stepper motor
Ishfaqah
 
Drivers2
Drivers2Drivers2
Drivers2
guestea186b
 
Drivers2
Drivers2Drivers2
Drivers2
guestea186b
 
Motor Control Relay, Pwm, DC and Stepper Motors
Motor Control Relay, Pwm, DC and Stepper MotorsMotor Control Relay, Pwm, DC and Stepper Motors
Motor Control Relay, Pwm, DC and Stepper Motors
Devashish Raval
 
8051.pdf
8051.pdf8051.pdf
900 00008-continuous-rotation-servo-documentation-v2.2
900 00008-continuous-rotation-servo-documentation-v2.2900 00008-continuous-rotation-servo-documentation-v2.2
900 00008-continuous-rotation-servo-documentation-v2.2
phamquyenanh
 
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
Ionela
 
My minor project
My minor projectMy minor project
My minor project
Bhrigu Raj Sharma
 
8051 - microcontroller applications.pptx
8051 - microcontroller applications.pptx8051 - microcontroller applications.pptx
8051 - microcontroller applications.pptx
MadavanR1
 
Fadal Spindle Drive and Motor Manual
Fadal Spindle Drive and Motor ManualFadal Spindle Drive and Motor Manual
Fadal Spindle Drive and Motor Manual
Independent Technology Service Inc
 
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
IRJET Journal
 
1206 Interrupts Of 8085
1206 Interrupts Of 80851206 Interrupts Of 8085
1206 Interrupts Of 8085
techbed
 
Interfacing with Atmega 16
Interfacing with Atmega 16Interfacing with Atmega 16
Interfacing with Atmega 16
Ramadan Ramadan
 

Similar to Stepper motor-interfacing (20)

Applications of 8051 microcontrollers
Applications of 8051 microcontrollersApplications of 8051 microcontrollers
Applications of 8051 microcontrollers
 
Controlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
Controlled Rotation of the Shaft of a Stepper Motor with 8051 MicrocontrollerControlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
Controlled Rotation of the Shaft of a Stepper Motor with 8051 Microcontroller
 
Stepper motor interfacing
Stepper motor interfacingStepper motor interfacing
Stepper motor interfacing
 
Stepper with 8051.docx
Stepper with 8051.docxStepper with 8051.docx
Stepper with 8051.docx
 
INTERNAL GEAR PUMP
INTERNAL GEAR PUMPINTERNAL GEAR PUMP
INTERNAL GEAR PUMP
 
Microcontroller based four step linear stroke positioning system
Microcontroller based four step linear stroke positioning systemMicrocontroller based four step linear stroke positioning system
Microcontroller based four step linear stroke positioning system
 
8255
82558255
8255
 
It 5170 stepper motor
It 5170 stepper motorIt 5170 stepper motor
It 5170 stepper motor
 
Drivers2
Drivers2Drivers2
Drivers2
 
Drivers2
Drivers2Drivers2
Drivers2
 
Motor Control Relay, Pwm, DC and Stepper Motors
Motor Control Relay, Pwm, DC and Stepper MotorsMotor Control Relay, Pwm, DC and Stepper Motors
Motor Control Relay, Pwm, DC and Stepper Motors
 
8051.pdf
8051.pdf8051.pdf
8051.pdf
 
900 00008-continuous-rotation-servo-documentation-v2.2
900 00008-continuous-rotation-servo-documentation-v2.2900 00008-continuous-rotation-servo-documentation-v2.2
900 00008-continuous-rotation-servo-documentation-v2.2
 
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller ...
 
My minor project
My minor projectMy minor project
My minor project
 
8051 - microcontroller applications.pptx
8051 - microcontroller applications.pptx8051 - microcontroller applications.pptx
8051 - microcontroller applications.pptx
 
Fadal Spindle Drive and Motor Manual
Fadal Spindle Drive and Motor ManualFadal Spindle Drive and Motor Manual
Fadal Spindle Drive and Motor Manual
 
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
IRJET- Control Strategy of Induction Motor Drive by using Universal Controlle...
 
1206 Interrupts Of 8085
1206 Interrupts Of 80851206 Interrupts Of 8085
1206 Interrupts Of 8085
 
Interfacing with Atmega 16
Interfacing with Atmega 16Interfacing with Atmega 16
Interfacing with Atmega 16
 

More from Lecturer

2017 09-23 112801
2017 09-23 1128012017 09-23 112801
2017 09-23 112801
Lecturer
 
2017 reg ece syllabus
2017 reg ece syllabus2017 reg ece syllabus
2017 reg ece syllabus
Lecturer
 
3d fem
3d fem3d fem
3d fem
Lecturer
 
03 tec literaturereview
03 tec literaturereview03 tec literaturereview
03 tec literaturereview
Lecturer
 
Epma 022
Epma 022Epma 022
Epma 022
Lecturer
 
Epma 013
Epma 013Epma 013
Epma 013
Lecturer
 
Epma 010
Epma 010Epma 010
Epma 010
Lecturer
 
61 programmable
61 programmable61 programmable
61 programmable
Lecturer
 
Tutorial on hmm and applications
Tutorial on hmm and applicationsTutorial on hmm and applications
Tutorial on hmm and applications
Lecturer
 
00. ug (aff) reg (2017)
00. ug (aff) reg (2017)00. ug (aff) reg (2017)
00. ug (aff) reg (2017)
Lecturer
 

More from Lecturer (10)

2017 09-23 112801
2017 09-23 1128012017 09-23 112801
2017 09-23 112801
 
2017 reg ece syllabus
2017 reg ece syllabus2017 reg ece syllabus
2017 reg ece syllabus
 
3d fem
3d fem3d fem
3d fem
 
03 tec literaturereview
03 tec literaturereview03 tec literaturereview
03 tec literaturereview
 
Epma 022
Epma 022Epma 022
Epma 022
 
Epma 013
Epma 013Epma 013
Epma 013
 
Epma 010
Epma 010Epma 010
Epma 010
 
61 programmable
61 programmable61 programmable
61 programmable
 
Tutorial on hmm and applications
Tutorial on hmm and applicationsTutorial on hmm and applications
Tutorial on hmm and applications
 
00. ug (aff) reg (2017)
00. ug (aff) reg (2017)00. ug (aff) reg (2017)
00. ug (aff) reg (2017)
 

Recently uploaded

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 

Recently uploaded (20)

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 

Stepper motor-interfacing

  • 1. Stepper motor Interfacing/Control using 8085 and 8051 Stepper Motor A stepper motor is a device that translates electrical pulses into mechanical movement in steps of fixed step angle.  The stepper motor rotates in steps in response to the applied signals.  It is mainly used for position control.  It is used in disk drives, dot matrix printers, plotters and robotics and process control circuits. Structure Stepper motors have a permanent magnet called rotor (also called the shaft) surrounded by a stator. The most common stepper motors have four stator windings that are paired with a center-tap. This type of stepper motor is commonly referred to as a four-phase or unipolar stepper motor. The center tap allows a change of current direction in each of two coils when a winding is grounded, thereby resulting in a polarity change of the stator. Interfacing Even a small stepper motor require a current of 400 mA for its operation. But the ports of the microcontroller cannot source this much amount of current. If such a motor is directly connected to the microprocessor/microcontroller ports, the motor may draw large current from the ports and damage it. So a suitable driver circuit is used with the microprocessor/microcontroller to operate the motor. Motor Driver Circuit (ULN2003) Stepper motor driver circuits are available readily in the form of ICs. ULN2003 is one such driver IC which is a High-Voltage High-Current Darlington transistor array and can give a current of 500mA.This current is sufficient to drive a small stepper motor. Internally, it has protection diodes used to protect the motor from damage due to back emf and large eddy currents. So, this ULN2003 is used as a driver to interface the stepper motor to the microcontroller.
  • 2. Operation The important parameter of a stepper motor is the step angle. It is the minimum angle through which the motor rotates in response to each excitation pulse. In a four phase motor if there are 200 steps in one complete rotation then then the step angle is 360/200 = 1.8O . So to rotate the stepper motor we have to apply the excitation pulse. For this the controller should send a hexa decimal code through one of its ports. The hex code mainly depends on the construction of the stepper motor. So, all the stepper motors do not have the same Hex code for their rotation. (refer the operation manual supplied by the manufacturer.) For example, let us consider the hex code for a stepper motor to rotate in clockwise direction is 77H , BBH , DDH and EEH. This hex code will be applied to the input terminals of the driver through the assembly language program. To rotate the stepper motor in anti-clockwise direction the same code is applied in the reverse order. Stepper Motor interface- Schematic Diagram (for 8051) The assembly language program for 8051 is given below.
  • 3. ASSEMBLY LANGUAGE PROGRAM (8051) Main : MOV A, # 0FF H ; Initialization of Port 1 MOV P1, A ; MOV A, #77 H ; Code for the Phase 1 MOV P1, A ; ACALL DELAY ; Delay subroutine MOV A, # BB H ; Code for the Phase II MOV P1, A ; ACALL DELAY ; Delay subroutine. MOV A, # DD H ; Code for the Phase III MOV P1, A ; ACALL DELAY ; Delay subroutine MOV A, # EE H ; Code for the Phase 1 MOV P1, A ; ACALL DELAY ; Delay subroutine SJMP MAIN; Keep the motor rotating continuously. DELAY Subroutine MOV R4, #0FF H ; Load R4 with FF MOV R5, # 0FF ; Load R5 with FF LOOP1: DJNZ R4, LOOP1 ; Decrement R4 until zero,wait LOOP2: DJNZ R5, LOOP2 ; Decrement R5 until zero,wait RET ; Return to main program .
  • 4. Stepper Motor interface - Schematic Diagram for (8085) Detailed Connection diagram between 8085 and 8255
  • 5. ASSEMBLY LANGUAGE PROGRAM (8085) Main : MVI A, 80 ; 80H → Control word to configure PA,PB,PC in O/P OUT CWR_Address ; Write control word in CWR of 8255 MVI A, 77 ; Code for the Phase 1 OUT PortA_Address ; sent to motor via port A of 8255 ; CALL DELAY ; Delay subroutine MVI A, BB ; Code for the Phase II OUT PortA_Address ; sent to motor via port A of 8255 CALL DELAY ; Delay subroutine. MVI A, DD ; Code for the Phase III OUT PortA_Address ; sent to motor via port A of 8255; CALL DELAY ; Delay subroutine MVI A, EE H ; Code for the Phase 1 OUT PortA_Address ; sent to motor via port A of 8255 ; CALL DELAY ; Delay subroutine JMP MAIN ; Keep the motor rotating continuously. DELAY Subroutine MVI C, FF ; Load C with FF -- Change it for the speed variation LOOP1: MVI D,FF ; Load D with FF LOOP2: DCR D JNZ LOOP2 DCR C JNZ LOOP1 RET ; Return to main program .