SlideShare a Scribd company logo
1 of 13
BIOMEDICAL ENGINEERING DEPARTMENT
GOVERNMENT ENGINEERING COLLEGE,
GANDHINAGAR
Dc motor direction control using
8051 microcontroller and c
programming
B.E SEM V
PREPARED BY :-
Balat Viral S. (150133103004)
Damodar Dinesh R.(150133103011)
Introduction :-
 In this topic we need to control direction of DC motor using a 8051
Microcontroller with C language Programming.
 The Maximum current that can be sourced or sunk from the a 8051
microcontroller is 15 mA at 5v.
 But a DC Motor need currents very much more than that and it need voltages 6v,
12v, 24v etc. depending upon the type of motor used.
 Another problem is that the back EMF produced by the motor may affect the
proper functioning of the microcontroller. Due to these reasons we can’t connect
a DC Motor directly to a microcontroller.
 To interface DC motor with 8051 microcontroller we requires cleared basic
fundamentals regarding to both as well programming language.
2
DC Motor
 A direct current (DC) motor is another widely used device
that translates electrical pulses into mechanical
movement.
 In the DC motor we have only (+) and (-) leads.
 Connecting them to a DC voltage source moves the motor
in one direction.
 By reversing the polarity, the DC motor will move in the
opposite direction.
3
4
 Motor can be controlled in two ways.
1) Unidirectional Control
2) Bidirectional Control
 As shown in figure DC motor rotation
for Clockwise rotation and Anticlockwise
rotation.
 With the help of relays or some specially
designed chips we can change the
direction of the DC motor rotation.
H-Bridge motor control circuits
 An h-bridge is a bipolar driver circuit that is often used to
control a load such as a brush type DC motor.
 The h-bridge consists of four switches – two half-bridges
with the load connected between them.
 The switches are usually solid-state devices such as
bipolar transistors or power MOSFET’s.
 As depicted in figure when all switches are in off condition
it is in rest condition and don’t rotates.
5
6
 When S1 and S4 are on, current tends to
flow from the positive rail of the power
supply through the motor left to right and
then to ground.
 This configuration used for rotating motor
clockwise direction.
 When S3 and S2 are on, current tends to
flow in vice versa direction this
configuration used to rotating motor in
anticlockwise direction.
 There also a third mode where the
motor leads are effectively shorted
together.
 This can be done by turning on
both high side and both low side
switches.
 This allows current to recirculate
through the motor freely. When
done briefly as the “off” portion of
a PWM cycle, it allows current to
decay slowly.
 When held in this state while a DC
motor is spinning, the back-EMF
of the motor will case a
recirculating current to flow that
will rapidly brake the motor to a
stop.
 This is known as “dynamic
braking”.
7
H-Bridge Logic configuration summary
8
Motor Operation SW1 SW2 SW3 SW4
Off Open Open Open Open
Clockwise Closed Open Open Closed
Counter Clockwise Open Closed Closed Open
Invalid Closed Closed Closed Closed
Some H-Bridge Logic Configuration for Figure
Configuration for Interface 8051 with DC
motor using L293
9
Description of the circuit
 Previous figure depicted the connection between 8051 and L293.
 For sustained operation of the motor It is required to use heat sink because L239 produce heat more
during operation.
 The opto - isolator uses to provide additional protection of the 8051
 L293 uses a separate power supply for the motor and L293 than for the 8051.
 D1,D2,D3,D4 are IN4004 diodes.
 8051 complete the task of controlling dc motor using the sequence of programming establish by
programmer the run the DC motor.
10
C Programing for DC motor direction
control
To set 8051 with DC motor programming is required either assembly or C language can be
used
Problem Statement :- Write a C program to control direction of Direct motor using
controller 8051 and L239 on both Clockwise and Anti clockwise.
Solution :- Simple logic with switch can be used. When switch is not pressed the DC
motor will rotate in clockwise direction and also rotate in opposite (anticlockwise) direction
when switch is pressed.
11
#include <reg51.h> //include header file reg51.h//
sbit SW = P2^7; //define P2.7 as a switch//
sbit ENABLE = P1^0; //define P1.0 as o/p//
sbit MTR_0 = P1^1; //define P1.1 as o/p//
sbit MTR_1 = P1^2; //define P1.2 as o/p//
void main()
{
SW = 1; //switch declares as i/p port//
ENABLE = 0; //declaring o/p port//
MTR_0 = 0; //declaring o/p port//
MTR_1 = 0; //declaring o/p port//
while(1) //Continuous loop//
{
ENABLE = 1; //toggle pin high//
if(SW == 1) //when switch is off//
{
MTR_0 = 1; //rotate in clockwise direction//
MTR_1 = 0;
}
12
else
{
MTR_0 = 0;
MTR_1 = 1; //rotate in anticlockwise direction//
}
}
}
References:-
1) THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM BY MUHAMMAD ALI MAZIDI
2) HTTP://WWW.MICRODIGITALED.COM/8051/CODE/EXAMPLE%2017-8.TXT
3) HTTPS://ELECTROSOME.COM/INTERFACING-DC-MOTOR-8051-KEIL-C-AT89C51/
4) HTTPS://THSENGINEERING.COM/2009/03/INTRO-H-BRIDGE-MOTOR-CONTROL-CIRCUITS/

More Related Content

What's hot

8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O portsanishgoel
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
Stepper motor-interfacing
Stepper motor-interfacingStepper motor-interfacing
Stepper motor-interfacingLecturer
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )Tarun Khaneja
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller Gaurav Verma
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1deval patel
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Aarav Soni
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERAnkita Jaiswal
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.pptDr.YNM
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1techbed
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerJay Makwana
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
8 interrupt 8051
8 interrupt 80518 interrupt 8051
8 interrupt 8051daniemol
 

What's hot (20)

8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
Stepper motor-interfacing
Stepper motor-interfacingStepper motor-interfacing
Stepper motor-interfacing
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
 
8155 PPI
8155 PPI8155 PPI
8155 PPI
 
Memory interfacing
Memory interfacingMemory interfacing
Memory interfacing
 
8251 USART
8251 USART8251 USART
8251 USART
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
8 interrupt 8051
8 interrupt 80518 interrupt 8051
8 interrupt 8051
 

Similar to DC Motor Direction Control Using 8051 C Program

BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLER
BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLERBIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLER
BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLERShanmukha S. Potti
 
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLER
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLERFOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLER
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLERshiv kapil
 
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPIC
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPICSpeed Control of BLDC Motor with Four Quadrant Operation Using dsPIC
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPICijsrd.com
 
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 MotorsDevashish Raval
 
Speed Control Of Single Phase Induction Motor
Speed Control Of Single Phase Induction MotorSpeed Control Of Single Phase Induction Motor
Speed Control Of Single Phase Induction MotorBhuban Chandra Mohanta
 
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Enhmandah Hemeelee
 
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Enhmandah Hemeelee
 
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...Journal For Research
 
Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Ronza Sameer
 
bidirectional report
bidirectional reportbidirectional report
bidirectional reportHasan baig
 
Predefined speed control of bldc motor
Predefined speed control of bldc motorPredefined speed control of bldc motor
Predefined speed control of bldc motorEdgefxkits & Solutions
 
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach
Speed Control of PMBLDC Motor using  LPC 2148 – A Practical Approach  Speed Control of PMBLDC Motor using  LPC 2148 – A Practical Approach
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach IJEEE
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERJournal For Research
 

Similar to DC Motor Direction Control Using 8051 C Program (20)

BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLER
BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLERBIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLER
BIDIRECTIONAL SPEED CONTROL OF DC MOTOR USING 8051 MICROCONTROLLER
 
Presentation200 (1).ppt
Presentation200 (1).pptPresentation200 (1).ppt
Presentation200 (1).ppt
 
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLER
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLERFOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLER
FOUR QUADRANT DC MOTOR SPEED CONTROL WITH MICROCONTROLLER
 
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPIC
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPICSpeed Control of BLDC Motor with Four Quadrant Operation Using dsPIC
Speed Control of BLDC Motor with Four Quadrant Operation Using dsPIC
 
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
 
C010231319
C010231319C010231319
C010231319
 
Stepper Motor
Stepper MotorStepper Motor
Stepper Motor
 
Speed Control Of Single Phase Induction Motor
Speed Control Of Single Phase Induction MotorSpeed Control Of Single Phase Induction Motor
Speed Control Of Single Phase Induction Motor
 
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
 
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
Programmable logic controllers (pl cs) (experiment _2)_bi-directional control...
 
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
 
Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)
 
bidirectional report
bidirectional reportbidirectional report
bidirectional report
 
Motor driver
Motor driverMotor driver
Motor driver
 
THREE PHASE INVERTER FED BLDC MOTOR DRIVE
THREE PHASE INVERTER FED BLDC MOTOR DRIVETHREE PHASE INVERTER FED BLDC MOTOR DRIVE
THREE PHASE INVERTER FED BLDC MOTOR DRIVE
 
Predefined speed control of bldc motor
Predefined speed control of bldc motorPredefined speed control of bldc motor
Predefined speed control of bldc motor
 
Digital Control for a PV Powered BLDC Motor
Digital Control for a PV Powered BLDC MotorDigital Control for a PV Powered BLDC Motor
Digital Control for a PV Powered BLDC Motor
 
Hbridge
HbridgeHbridge
Hbridge
 
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach
Speed Control of PMBLDC Motor using  LPC 2148 – A Practical Approach  Speed Control of PMBLDC Motor using  LPC 2148 – A Practical Approach
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
 

Recently uploaded

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 

Recently uploaded (20)

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 

DC Motor Direction Control Using 8051 C Program

  • 1. BIOMEDICAL ENGINEERING DEPARTMENT GOVERNMENT ENGINEERING COLLEGE, GANDHINAGAR Dc motor direction control using 8051 microcontroller and c programming B.E SEM V PREPARED BY :- Balat Viral S. (150133103004) Damodar Dinesh R.(150133103011)
  • 2. Introduction :-  In this topic we need to control direction of DC motor using a 8051 Microcontroller with C language Programming.  The Maximum current that can be sourced or sunk from the a 8051 microcontroller is 15 mA at 5v.  But a DC Motor need currents very much more than that and it need voltages 6v, 12v, 24v etc. depending upon the type of motor used.  Another problem is that the back EMF produced by the motor may affect the proper functioning of the microcontroller. Due to these reasons we can’t connect a DC Motor directly to a microcontroller.  To interface DC motor with 8051 microcontroller we requires cleared basic fundamentals regarding to both as well programming language. 2
  • 3. DC Motor  A direct current (DC) motor is another widely used device that translates electrical pulses into mechanical movement.  In the DC motor we have only (+) and (-) leads.  Connecting them to a DC voltage source moves the motor in one direction.  By reversing the polarity, the DC motor will move in the opposite direction. 3
  • 4. 4  Motor can be controlled in two ways. 1) Unidirectional Control 2) Bidirectional Control  As shown in figure DC motor rotation for Clockwise rotation and Anticlockwise rotation.  With the help of relays or some specially designed chips we can change the direction of the DC motor rotation.
  • 5. H-Bridge motor control circuits  An h-bridge is a bipolar driver circuit that is often used to control a load such as a brush type DC motor.  The h-bridge consists of four switches – two half-bridges with the load connected between them.  The switches are usually solid-state devices such as bipolar transistors or power MOSFET’s.  As depicted in figure when all switches are in off condition it is in rest condition and don’t rotates. 5
  • 6. 6  When S1 and S4 are on, current tends to flow from the positive rail of the power supply through the motor left to right and then to ground.  This configuration used for rotating motor clockwise direction.  When S3 and S2 are on, current tends to flow in vice versa direction this configuration used to rotating motor in anticlockwise direction.
  • 7.  There also a third mode where the motor leads are effectively shorted together.  This can be done by turning on both high side and both low side switches.  This allows current to recirculate through the motor freely. When done briefly as the “off” portion of a PWM cycle, it allows current to decay slowly.  When held in this state while a DC motor is spinning, the back-EMF of the motor will case a recirculating current to flow that will rapidly brake the motor to a stop.  This is known as “dynamic braking”. 7
  • 8. H-Bridge Logic configuration summary 8 Motor Operation SW1 SW2 SW3 SW4 Off Open Open Open Open Clockwise Closed Open Open Closed Counter Clockwise Open Closed Closed Open Invalid Closed Closed Closed Closed Some H-Bridge Logic Configuration for Figure
  • 9. Configuration for Interface 8051 with DC motor using L293 9
  • 10. Description of the circuit  Previous figure depicted the connection between 8051 and L293.  For sustained operation of the motor It is required to use heat sink because L239 produce heat more during operation.  The opto - isolator uses to provide additional protection of the 8051  L293 uses a separate power supply for the motor and L293 than for the 8051.  D1,D2,D3,D4 are IN4004 diodes.  8051 complete the task of controlling dc motor using the sequence of programming establish by programmer the run the DC motor. 10
  • 11. C Programing for DC motor direction control To set 8051 with DC motor programming is required either assembly or C language can be used Problem Statement :- Write a C program to control direction of Direct motor using controller 8051 and L239 on both Clockwise and Anti clockwise. Solution :- Simple logic with switch can be used. When switch is not pressed the DC motor will rotate in clockwise direction and also rotate in opposite (anticlockwise) direction when switch is pressed. 11
  • 12. #include <reg51.h> //include header file reg51.h// sbit SW = P2^7; //define P2.7 as a switch// sbit ENABLE = P1^0; //define P1.0 as o/p// sbit MTR_0 = P1^1; //define P1.1 as o/p// sbit MTR_1 = P1^2; //define P1.2 as o/p// void main() { SW = 1; //switch declares as i/p port// ENABLE = 0; //declaring o/p port// MTR_0 = 0; //declaring o/p port// MTR_1 = 0; //declaring o/p port// while(1) //Continuous loop// { ENABLE = 1; //toggle pin high// if(SW == 1) //when switch is off// { MTR_0 = 1; //rotate in clockwise direction// MTR_1 = 0; } 12 else { MTR_0 = 0; MTR_1 = 1; //rotate in anticlockwise direction// } } }
  • 13. References:- 1) THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM BY MUHAMMAD ALI MAZIDI 2) HTTP://WWW.MICRODIGITALED.COM/8051/CODE/EXAMPLE%2017-8.TXT 3) HTTPS://ELECTROSOME.COM/INTERFACING-DC-MOTOR-8051-KEIL-C-AT89C51/ 4) HTTPS://THSENGINEERING.COM/2009/03/INTRO-H-BRIDGE-MOTOR-CONTROL-CIRCUITS/