SlideShare a Scribd company logo
1 of 21
Download to read offline
SPEED CONTROL OF A DC MOTOR USING
MICROCONTROLLER 8051
A PROJECT REPORT
Submitted by
S. Kamal Viswanath (07241A0206)
M. Gowtham (07241A0203)
P. Ashok Kumar (06241A0205)
K. Rohit Naik (07241A0247)
in partial fulfillment for the award of the degree
of
Bachelor of Technology
IN
ELECTRICAL AND ELECTRONICS ENGINEERING
GOKARAJU RANGARAJU INSTITUTES OF ENGINEERING AND
TECHNOLOGY
JNTU HYDERABAD : 500085
January 2011
GOKARAJU RANGARAJU INSTITUTES OF
ENGINEERING AND TECHNOLOGY
BONAFIED CERTIFICATE
This is to certify that this project report “Speed Control of DC Motor using
microcontroller 8051” is the bonafied work of “Kamal Viswanath,
Gowtham, Ashok Kumar, Rohith Naik” who carried out the project under
my supervision.
SIGNATURE SIGNATURE
P.M. Sharma M. Chakravarthy
HEAD OF THE DEPARTMENT PROJECT GUIDE
ASSOCIATE PROFESSOR
ELECTRICAL AND ELECTRONICS ELECTRICAL AND ELECTRONICS
GRIET, GRIET,
BACHUPALLY, KUKATPALLY, BACHUPALLY, KUKATPALLY,
HYDERABAD-500 090. HYDERABAD-500 090.
ABSTARCT
The aim of developing this project is to
control the speed of DC motor. The main advantage in using a DC motor is that
the Speed-Torque relationship can be varied to almost any useful form. To
achieve the speed control an electronic technique called Pulse Width
Modulation is used which generates High and Low pulses. These pulses vary
the speed in the motor. For the generation of these pulses a microcontroller
(AT89c51) is used. As a microcontroller is used setting the speed ranges as per
the requirement is easy which is done by changing the duty cycles time period
in the program. This project is practical and highly feasible in economic point of
view, and has an advantage of running motors of higher ratings. This project
gives a reliable, durable, accurate and efficient way of speed control of a DC
motor.
CONTENTS
CHAPTER No. TITLE PAGE No.
ABSTRACT iii
1. INTRODUCTION 1
1.1 DC Motor 1
1.2 Pulse Width Modulation 3
1.3 Microcontroller 6
2. FLOW CHART 8
3. BLOCK DIAGRAM 9
4. CIRCUIT DIAGRAM 10
5. HARDWARE DESCRIPTION 11
6. SOFTWARE DESCRIPTION 12
7. DATA ACQUAINTED 14
8. DATA SHEETS 16
9. COMPONENTS LISTING 24
10. REFERENCES 24
INTRODUCTION
DC MOTOR
The device that converts electrical energy
into mechanical energy is called as a motor. The motor that utilizes a DC supply
to produce mechanical output is DC Motor. The advantages of using these types
of motors over conventionally used AC motors are stated below.
• DC motors have higher controller efficiency.
• DC motors have typical 98% efficiency.
• DC motors have better overload and peak voltage characteristics.
• The main advantage of using these DC motors ids that the speed-
torque characteristics can be varied to almost any useful form.
As a result of all these advantages these
motors have a wide range of applications in places where constant speed is to be
maintained at varying loads. Conveyor belts, elevators, cranes, ski lifts,
extruders, mixers, sewing machines are few such applications where DC motors
are used. So controlling the speed of a DC motor is a purposeful and required
place to work on. The various types of DC motors are
• Series field wound type
• Shunt field wound type
• Compound field wound type
For all these types of DC motor common methods of speed controls.
Speed control methods in a DC motor:
The motor speed can be controlled by
controlling armature voltage and armature current. It is obvious that speed
control is possible by varying
•Flux per pole ,Φ (Flux control)
•resistance Ra of armature circuit (Rheostatic Control)
•applied voltage V (Voltage Control)
The above methods have some demerits like a large amount of power is wasted
in the controller resistance. Hence, efficiency is decreased. It needs expensive
arrangement for dissipation of heat produced in the controller resistance. It
gives speeds below the normal speed. By these data that are acquainted we can
draw a conclusion that these electric and electromechanical methods are less
adaptive so electronic techniques are used for speed control. These methods
provide higher efficiency, greater reliability, quick response, higher efficiency.
One such technique is Pulse Width Modulation. We apply this technique in our
project so as to control the speed of the DC motor.
PWM
Pulse width modulation (PWM) is a method for binary signals generation,
which has 2 signal periods (high and low). The width (W) of each pulse varies
between 0 and the period (T). The main principle is control of power by
varying the duty cycle. Here the conduction time to the load is controlled. Let
for a time t1, the input voltage appears across the load i.e. ON state and for t2
time the voltage across the load is zero.
• The average voltage at output is given by
Va = 1/T ∫ vodt = t1/T Vs = ft1 Vs = kVs
• the average load current Ia = Va/R = kVs/R where,
T is the total time period =t1+t2,
k = t1/T is the duty cycle.
• The rms value of output voltage is V0 = ( i/T ∫ V0
2
dt ) ½
= k Vs
• The output power and is given by
Pi = 1/T ∫v0idt = 1/T ∫ v0
2
/R dt = kVs
2
/R
• The duty cycle can be varied from 0 to 1 by varying t1, T or f. Therefore,
the output voltage V0 can be varied from 0 to Vs by controlling k, and the
power flow can be controlled.
• As the time t1 changes the width of pulse is varied and this type of
control is called pulse width modulation (PWM) control.
For better understanding of PWM these diagrammatic representations can be
used. These figures represent the waveforms obtained as output at different
voltage requirements.
High Speed Signal (90%): The green part of the signal represents the ON
time and the white part of it represents time when it is not receiving any voltage.
Signal with half voltage (50%):
Signal with low voltage (10%):
Advantages of PWM :
The main advantage of PWM is that power loss in
the switching devices is very low. When a switch is off there is practically no
current, and when it is on, there is almost no voltage drop across the switch.
Power loss, being the product of voltage and current, is thus in both cases close
to zero. PWM works also well with digital controls, which, because of their
on/off nature, can easily set the needed duty cycle. Using pulse width
modulation has several advantages over analog control. Using PWM to dim a
lamp would produce less heat than an analog control that converts some of the
current to heat. Also, if you use PWM, the entire control circuit can be digital,
eliminating the need for digital-to-analog converters. Using digital control lines
will reduce the susceptibility of your circuit to interference. Finally, motors may
be able to operate at lower speeds if you control them with PWM. When you
use an analog current to control a motor, it will not produce significant torque at
low speeds. The magnetic field created by the small current will be too weak to
turn the rotor. On the other hand, a PWM current can create short pulses of
magnetic flux at full strength, which can turn the rotor at extremely slow
speeds.
The technology has become more pervasive as low cost
microcontrollers incorporate PWM control. Microcontrollers offer simple
commands to vary the duty cycle and frequencies of the PWM control signal.
PWM is also used in communications to take advantage of the higher immunity
to noise provided by digital signals. So by getting these pulses generated by a
microcontroller we can increase the efficiency, accuracy and thus the reliability
of the system. The most commonly used microcontroller is 8051 that has been
used in this project for production of pulses.
MICROCONTROLLER
A microcontroller (abbreviated µC, uC or MCU) is a
small computer on a single integrated circuit containing a processor core,
memory, and programmable input/output peripherals. This programmes
memory in the form of NOR flash or OTP ROM is also often included on chip,
as well as a typically small amount of RAM.
Advantages of Microcontroller
Microcontrollers are widely used in today’s control systems for the following
reasons:
• Design and Simulation – Because you are programming with software,
detailed simulations may be performed in advance to assure correctness
of code and system performance.
• Flexibility – Ability to reprogram using Flash, EEPROM or EPROM
allows straightforward changes in the control law used.
• High Integration – Most microcontrollers are essentially single chip
computers with on-chip processing, memory, and I/O. Some contain
peripherals for serial communication and reading analog signals (with an
analog-to-digital converter or ADC). This differentiates a microcontroller
from a microprocessor. Microprocessors require that this functionality be
provided by added components.
• Cost – Cost savings come from several locations. Development costs are
greatly decreased because of the design/flexibility advantages mentioned
previously. Because so many components are included on one IC, board
area and component savings are often evident as well.
• Easy to Use – Just program and go! While in the past, programming has
often involved tedious assembly code, today C compilers are available for
most microcontrollers. Microcontrollers often only require a single 5V
supply as well which makes them easier to power and use.
8051 is also one such microcontroller with certain features like
• An 8-bit ALU.
• Harvard memory architecture – the external program memory and data
memory have separate address spaces from 0x0000 and separate
controlsignal(s).
• 8-bit internal data bus width and 16-bit internal address bus – Harvard
memory architecture
• CISC (Complex Instruction Set Computer)
• Special function registers (SFRs) –PSW(processor status word), A
(accumulator),B register, SP (stack pointer) and registers for serial IOs,
timers, ports and interrupt handler.
• on-chip RAM of 128 bytes.
• 32 bytes of RAM also used as four banks of registers. Each register-set
thus eight registers.
• External data/stack memory can be added upto 64 kB in most of the
version. In certain 8051 enhancements, this limit enhanced to 16 MB.
After acquiring the data about microcontroller,
DC motor and PWM technique we can get into designing a circuit that uses
these units in controlling the speed of a DC motor
FLOW CHART
Start
Check if both switches are open
No
Yes
Decrease speed
 
 
 
Speed Required      
80% 
No
Speed Required     
50%
 
No 
Close S1&S2 
 
 
 
 
 
 
 
 
 
 
   
  Stop
 
 
 
 
 
 
BLOCK DIAGRAM
CIRCUIT DIAGRAM
HARDWARE DESCRIPTION
The components are connect on a
Printed Circuit Board as per the given connection details in the circuit diagram.
The functioning of the circuit can be explained with respect to the action format
that occurs in the circuit. As the supply is switched ON and both the switches
are open the switching supplies ideally 5V is given to the microcontroller.
Suppose if the any of the switch is closed the supply gets directly shorted with
the ground. This indicates the microcontroller about the switch positions and
thus generates the signal as per the given program for the respective switches
position. The transistor used allows current to conduct through it when ever a
positive pulse is given at its base that is given by the microcontroller
inaccordance with the program. As the transistor is forward biased the supply
that is used to run the motor gets connected with the motor terminals and motor
starts running. As soon as the 0 voltage is encountered the NPN transistor used
goes into reverse bias and stops its conduction so the motor’s armature supply
gets disconnected till the base current is 0 volts. By this we can deduce that the
speed of the motor is directly dependent on the supply given by microcontroller
to the base which indeed depends on the program written. So the speeds of
working of the circuit depends on the number of switches used, for instance in
the above circuit two switches are used so the number of speed levels are 22
= 4.
So the number of speed levels for X switches will be 2X
. So the speed of the
motor can be varied in steps.
SOFTWARE DESCRIPTION
#include<reg51.h>
These are the ports from where
the microcontroller gets the
information about the switch
positions.
sbit SW_1 = P2^6; //connecting switch 1 to the port 2 ,pin 6.
sbit SW_2 = P2^7; // connecting switch 1 to the port 2 ,pin 7.
sbit MTR = P1^0; // from this pin we get the signal that is to be fed to the base
void main()
{ int x;
while(1)
{
if(SW_1==0 & SW_2==0)
{ This condition is stated when both the switches are
closed in this position the supply from the switches is
shorted into the ground terminal so microcontroller
doesn’t get any voltage so the switches are considered
as 0’s. At this condition the program is written so that
the output signal given by the microcontroller should
have 150 machine cycles of ON state and 600 machine
cycles of OFF state.
MTR=1;
for(x=0;x<150;x++);
MTR=0;
for(x=0;x<600;x++);
}
if(SW_1==0 & SW_2==1)
{ This condition is stated when the switch1 is closed and
switch 2 is open in this position the supply from the
switch1 is shorted into the ground terminal so
microcontroller doesn’t get any voltage so the switch
is considered as 0. Similarly switch 2 is open and
supply is sent to microcontroller so it is considered
1.At this condition the program is written so that the
output signal given by the microcontroller should have
300 machine cycles of ON state and 300 machine
cycles of OFF state.
MTR=1;
for(x=0;x<300;x++);
MTR=0;
for(x=0;x<300;x++);
}
if(SW_1==1 & SW_2==0)
{ This condition is stated when the switch2 is closed and
switch 1 is open in this position the supply from the
switch2 is shorted into the ground terminal so
microcontroller doesn’t get any voltage so the switch
is considered as 0. Similarly switch 1 is open and
supply is sent to microcontroller so it is considered
1.At this condition the program is written so that the
output signal given by the microcontroller should have
600 machine cycles of ON state and 150 machine
MTR=1;
for(x=0;x<600;x++);
MTR=0;
for(x=0;x<150;x++);
}
if(SW_1==1 & SW_2==1)
In this condition both the switches are open so
they are stated as 1’s and in this condition the
motor runs at full speed.
{
MTR=1;
}
}
}
DATA AQUAINTED
Condition 1 when both the switches are open:
Voltage Speed
4.3V 860 rpm
Condition 2 when switch SW1 is
closed:
Voltage Speed Average speed
4.3V 860rpm
3.6V 720rpm
790 rpm
Condition 3 when switch SW2 is closed:
Voltage Speed Average speed
4.3V 860rpm
3.9V 780rpm
820 rpm
Condition 4 when both the switches are
closed:
Voltage Speed Average speed
4.3V 860rpm
3.3V 660rpm
760 rpm
COMPONENT LIST
Name of the
Component
Make Value Number
AT89C51
Micro Controller
ATMEL 1
Resistors R1,R2 10KΩ 2
Capacitors C1,C2 1nF 2
Capacitor C3 1mF 1
Diode D1 IN4004 1
Transistor T1 TIP122 1
Switches SW1,SW2 2
DC Motor AMETECK 12Volts 1
DC Adapter Q1(C) 12 Volts 1
DC Adapter Q2(C) 5 Volts 1
Crystal Oscillator X1 12MHz 1
REFERENCES
• Books on DC motors: Driving DC Motors by G.
MAIOCCHI, DC Motors and drives by BL. THERAJA.
• Books on PWM technique: Pulse Width Modulated
Power supplies by VALTER QUERCIOLI.
• Books on Microcontroller: The 8051
microcontroller and embedded systems by JANICE GILLISPIE MAZIDI.

More Related Content

What's hot

Firing angle control
Firing angle controlFiring angle control
Firing angle controljawaharramaya
 
Control of electric drive
Control of electric driveControl of electric drive
Control of electric driveVijay Krishna
 
Three phase voltage source inverter
Three phase voltage source inverterThree phase voltage source inverter
Three phase voltage source invertertamilnesaner
 
Variable frequency drives
Variable frequency drivesVariable frequency drives
Variable frequency drivesNaveen Sihag
 
Induction Motor Speed Control Drive, Design and Implementation
Induction Motor Speed Control Drive, Design and ImplementationInduction Motor Speed Control Drive, Design and Implementation
Induction Motor Speed Control Drive, Design and ImplementationNasrullah Khan
 
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)Arpit Kurel
 
WATER LEVEL AUTOMATIC PUMP CONTROLLER
WATER LEVEL AUTOMATIC PUMP CONTROLLERWATER LEVEL AUTOMATIC PUMP CONTROLLER
WATER LEVEL AUTOMATIC PUMP CONTROLLERshiv kapil
 
presentation on POWER THEFT IDENTIFICATION SYSTEM
presentation on POWER THEFT IDENTIFICATION SYSTEMpresentation on POWER THEFT IDENTIFICATION SYSTEM
presentation on POWER THEFT IDENTIFICATION SYSTEMGaurav Shukla
 
Methods of Voltage Control
Methods of Voltage ControlMethods of Voltage Control
Methods of Voltage ControlYashvi Mehta
 
Unit 5 series motor (universal)motors
Unit 5 series motor (universal)motorsUnit 5 series motor (universal)motors
Unit 5 series motor (universal)motorsEr.Meraj Akhtar
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by BluetoothAakashkumar276
 
Electric traction
Electric tractionElectric traction
Electric tractionDipak Meher
 
Power theft detection
Power theft detectionPower theft detection
Power theft detectionAravind Shaji
 
Grid synchronisation
Grid synchronisationGrid synchronisation
Grid synchronisationmanogna gwen
 
CSI and vSI fed induction motor drives
CSI and vSI fed induction motor drivesCSI and vSI fed induction motor drives
CSI and vSI fed induction motor drivesraviarmugam
 
VOICE OPERATED WHEELCHAIR
VOICE OPERATED WHEELCHAIRVOICE OPERATED WHEELCHAIR
VOICE OPERATED WHEELCHAIRMandar Jadhav
 
Latest Electrical Mini Projects For EEE Students
Latest Electrical Mini Projects For EEE StudentsLatest Electrical Mini Projects For EEE Students
Latest Electrical Mini Projects For EEE Studentselprocus
 
supervisory control and data acquisition system
supervisory control and data acquisition systemsupervisory control and data acquisition system
supervisory control and data acquisition systemselvakumar R
 

What's hot (20)

Firing angle control
Firing angle controlFiring angle control
Firing angle control
 
Control of electric drive
Control of electric driveControl of electric drive
Control of electric drive
 
220 kv gss
220 kv gss220 kv gss
220 kv gss
 
Three phase voltage source inverter
Three phase voltage source inverterThree phase voltage source inverter
Three phase voltage source inverter
 
Variable frequency drives
Variable frequency drivesVariable frequency drives
Variable frequency drives
 
Induction Motor Speed Control Drive, Design and Implementation
Induction Motor Speed Control Drive, Design and ImplementationInduction Motor Speed Control Drive, Design and Implementation
Induction Motor Speed Control Drive, Design and Implementation
 
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)
SIMULATION AND STUDY OF MULTILEVEL INVERTER (ppt)
 
WATER LEVEL AUTOMATIC PUMP CONTROLLER
WATER LEVEL AUTOMATIC PUMP CONTROLLERWATER LEVEL AUTOMATIC PUMP CONTROLLER
WATER LEVEL AUTOMATIC PUMP CONTROLLER
 
presentation on POWER THEFT IDENTIFICATION SYSTEM
presentation on POWER THEFT IDENTIFICATION SYSTEMpresentation on POWER THEFT IDENTIFICATION SYSTEM
presentation on POWER THEFT IDENTIFICATION SYSTEM
 
Methods of Voltage Control
Methods of Voltage ControlMethods of Voltage Control
Methods of Voltage Control
 
Unit 5 series motor (universal)motors
Unit 5 series motor (universal)motorsUnit 5 series motor (universal)motors
Unit 5 series motor (universal)motors
 
PMBLDC motor
PMBLDC motorPMBLDC motor
PMBLDC motor
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by Bluetooth
 
Electric traction
Electric tractionElectric traction
Electric traction
 
Power theft detection
Power theft detectionPower theft detection
Power theft detection
 
Grid synchronisation
Grid synchronisationGrid synchronisation
Grid synchronisation
 
CSI and vSI fed induction motor drives
CSI and vSI fed induction motor drivesCSI and vSI fed induction motor drives
CSI and vSI fed induction motor drives
 
VOICE OPERATED WHEELCHAIR
VOICE OPERATED WHEELCHAIRVOICE OPERATED WHEELCHAIR
VOICE OPERATED WHEELCHAIR
 
Latest Electrical Mini Projects For EEE Students
Latest Electrical Mini Projects For EEE StudentsLatest Electrical Mini Projects For EEE Students
Latest Electrical Mini Projects For EEE Students
 
supervisory control and data acquisition system
supervisory control and data acquisition systemsupervisory control and data acquisition system
supervisory control and data acquisition system
 

Similar to Doc speed control of a dc motor using micro controller 8051

MICROCONTROLLER BASED SOLAR POWER INVERTER
MICROCONTROLLER BASED SOLAR POWER INVERTERMICROCONTROLLER BASED SOLAR POWER INVERTER
MICROCONTROLLER BASED SOLAR POWER INVERTERIAEME Publication
 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed controlSai Malleswar
 
Speed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueSpeed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueRITESH D. PATIL
 
Digital Current Mode Controller for Buck Converter
Digital Current Mode Controller for Buck ConverterDigital Current Mode Controller for Buck Converter
Digital Current Mode Controller for Buck ConverterIJMREMJournal
 
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...Design and Implementation of an Interface Circuit for DC Motor Speed Control ...
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...Firas Mohammed Ali Al-Raie
 
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLER
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY  PIC16F877A MICROCONTROLLERDC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY  PIC16F877A MICROCONTROLLER
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLERTridib Bose
 
sms based speed change of motor or fan
sms based speed change of motor or fansms based speed change of motor or fan
sms based speed change of motor or fanRahul Gupta
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll newMainak Nandi
 
Power theft detection via plc
Power theft detection via plcPower theft detection via plc
Power theft detection via plcbbshashanka
 
IRJET- Hybrid Feed Forward Control for Power Factor Correction Rectifier
IRJET-  	  Hybrid Feed Forward Control for Power Factor Correction RectifierIRJET-  	  Hybrid Feed Forward Control for Power Factor Correction Rectifier
IRJET- Hybrid Feed Forward Control for Power Factor Correction RectifierIRJET Journal
 
To control the pwm dc motor using ic555 timer
To control the pwm dc motor using ic555 timerTo control the pwm dc motor using ic555 timer
To control the pwm dc motor using ic555 timerVINAY KUMAR GUDELA
 
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 D.C motor using Pusle width modulation
Speed control of D.C motor using Pusle width modulationSpeed control of D.C motor using Pusle width modulation
Speed control of D.C motor using Pusle width modulationSantoshkumarVarry
 
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
 
Doc a.7-tlc report
Doc a.7-tlc reportDoc a.7-tlc report
Doc a.7-tlc report9951081577
 
Design and Implementation of a Microcontroller Based DC/AC Inverter
Design and Implementation of a Microcontroller Based DC/AC InverterDesign and Implementation of a Microcontroller Based DC/AC Inverter
Design and Implementation of a Microcontroller Based DC/AC InverterFiras Mohammed Ali Al-Raie
 

Similar to Doc speed control of a dc motor using micro controller 8051 (20)

IJET-V2I6P11
IJET-V2I6P11IJET-V2I6P11
IJET-V2I6P11
 
Final_Presentation
Final_PresentationFinal_Presentation
Final_Presentation
 
MICROCONTROLLER BASED SOLAR POWER INVERTER
MICROCONTROLLER BASED SOLAR POWER INVERTERMICROCONTROLLER BASED SOLAR POWER INVERTER
MICROCONTROLLER BASED SOLAR POWER INVERTER
 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed control
 
Speed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueSpeed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM Technique
 
Digital Current Mode Controller for Buck Converter
Digital Current Mode Controller for Buck ConverterDigital Current Mode Controller for Buck Converter
Digital Current Mode Controller for Buck Converter
 
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...Design and Implementation of an Interface Circuit for DC Motor Speed Control ...
Design and Implementation of an Interface Circuit for DC Motor Speed Control ...
 
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLER
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY  PIC16F877A MICROCONTROLLERDC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY  PIC16F877A MICROCONTROLLER
DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLER
 
sms based speed change of motor or fan
sms based speed change of motor or fansms based speed change of motor or fan
sms based speed change of motor or fan
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll new
 
Power theft detection via plc
Power theft detection via plcPower theft detection via plc
Power theft detection via plc
 
Ac motor closedloo[p
Ac motor closedloo[pAc motor closedloo[p
Ac motor closedloo[p
 
IRJET- Hybrid Feed Forward Control for Power Factor Correction Rectifier
IRJET-  	  Hybrid Feed Forward Control for Power Factor Correction RectifierIRJET-  	  Hybrid Feed Forward Control for Power Factor Correction Rectifier
IRJET- Hybrid Feed Forward Control for Power Factor Correction Rectifier
 
To control the pwm dc motor using ic555 timer
To control the pwm dc motor using ic555 timerTo control the pwm dc motor using ic555 timer
To control the pwm dc motor using ic555 timer
 
Predefined speed control of bldc motor
Predefined speed control of bldc motorPredefined speed control of bldc motor
Predefined speed control of bldc motor
 
Speed control of D.C motor using Pusle width modulation
Speed control of D.C motor using Pusle width modulationSpeed control of D.C motor using Pusle width modulation
Speed control of D.C motor using Pusle width modulation
 
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
 
Doc a.7-tlc report
Doc a.7-tlc reportDoc a.7-tlc report
Doc a.7-tlc report
 
03 TOTAL REPORT
03 TOTAL REPORT03 TOTAL REPORT
03 TOTAL REPORT
 
Design and Implementation of a Microcontroller Based DC/AC Inverter
Design and Implementation of a Microcontroller Based DC/AC InverterDesign and Implementation of a Microcontroller Based DC/AC Inverter
Design and Implementation of a Microcontroller Based DC/AC Inverter
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Doc speed control of a dc motor using micro controller 8051

  • 1. SPEED CONTROL OF A DC MOTOR USING MICROCONTROLLER 8051 A PROJECT REPORT Submitted by S. Kamal Viswanath (07241A0206) M. Gowtham (07241A0203) P. Ashok Kumar (06241A0205) K. Rohit Naik (07241A0247) in partial fulfillment for the award of the degree of Bachelor of Technology IN ELECTRICAL AND ELECTRONICS ENGINEERING GOKARAJU RANGARAJU INSTITUTES OF ENGINEERING AND TECHNOLOGY JNTU HYDERABAD : 500085 January 2011
  • 2. GOKARAJU RANGARAJU INSTITUTES OF ENGINEERING AND TECHNOLOGY BONAFIED CERTIFICATE This is to certify that this project report “Speed Control of DC Motor using microcontroller 8051” is the bonafied work of “Kamal Viswanath, Gowtham, Ashok Kumar, Rohith Naik” who carried out the project under my supervision. SIGNATURE SIGNATURE P.M. Sharma M. Chakravarthy HEAD OF THE DEPARTMENT PROJECT GUIDE ASSOCIATE PROFESSOR ELECTRICAL AND ELECTRONICS ELECTRICAL AND ELECTRONICS GRIET, GRIET, BACHUPALLY, KUKATPALLY, BACHUPALLY, KUKATPALLY, HYDERABAD-500 090. HYDERABAD-500 090.
  • 3. ABSTARCT The aim of developing this project is to control the speed of DC motor. The main advantage in using a DC motor is that the Speed-Torque relationship can be varied to almost any useful form. To achieve the speed control an electronic technique called Pulse Width Modulation is used which generates High and Low pulses. These pulses vary the speed in the motor. For the generation of these pulses a microcontroller (AT89c51) is used. As a microcontroller is used setting the speed ranges as per the requirement is easy which is done by changing the duty cycles time period in the program. This project is practical and highly feasible in economic point of view, and has an advantage of running motors of higher ratings. This project gives a reliable, durable, accurate and efficient way of speed control of a DC motor.
  • 4. CONTENTS CHAPTER No. TITLE PAGE No. ABSTRACT iii 1. INTRODUCTION 1 1.1 DC Motor 1 1.2 Pulse Width Modulation 3 1.3 Microcontroller 6 2. FLOW CHART 8 3. BLOCK DIAGRAM 9 4. CIRCUIT DIAGRAM 10 5. HARDWARE DESCRIPTION 11 6. SOFTWARE DESCRIPTION 12 7. DATA ACQUAINTED 14 8. DATA SHEETS 16 9. COMPONENTS LISTING 24 10. REFERENCES 24
  • 5. INTRODUCTION DC MOTOR The device that converts electrical energy into mechanical energy is called as a motor. The motor that utilizes a DC supply to produce mechanical output is DC Motor. The advantages of using these types of motors over conventionally used AC motors are stated below. • DC motors have higher controller efficiency. • DC motors have typical 98% efficiency. • DC motors have better overload and peak voltage characteristics. • The main advantage of using these DC motors ids that the speed- torque characteristics can be varied to almost any useful form. As a result of all these advantages these motors have a wide range of applications in places where constant speed is to be maintained at varying loads. Conveyor belts, elevators, cranes, ski lifts, extruders, mixers, sewing machines are few such applications where DC motors are used. So controlling the speed of a DC motor is a purposeful and required place to work on. The various types of DC motors are
  • 6. • Series field wound type • Shunt field wound type • Compound field wound type For all these types of DC motor common methods of speed controls. Speed control methods in a DC motor: The motor speed can be controlled by controlling armature voltage and armature current. It is obvious that speed control is possible by varying •Flux per pole ,Φ (Flux control) •resistance Ra of armature circuit (Rheostatic Control) •applied voltage V (Voltage Control) The above methods have some demerits like a large amount of power is wasted in the controller resistance. Hence, efficiency is decreased. It needs expensive arrangement for dissipation of heat produced in the controller resistance. It gives speeds below the normal speed. By these data that are acquainted we can draw a conclusion that these electric and electromechanical methods are less adaptive so electronic techniques are used for speed control. These methods provide higher efficiency, greater reliability, quick response, higher efficiency. One such technique is Pulse Width Modulation. We apply this technique in our project so as to control the speed of the DC motor.
  • 7. PWM Pulse width modulation (PWM) is a method for binary signals generation, which has 2 signal periods (high and low). The width (W) of each pulse varies between 0 and the period (T). The main principle is control of power by varying the duty cycle. Here the conduction time to the load is controlled. Let for a time t1, the input voltage appears across the load i.e. ON state and for t2 time the voltage across the load is zero. • The average voltage at output is given by Va = 1/T ∫ vodt = t1/T Vs = ft1 Vs = kVs • the average load current Ia = Va/R = kVs/R where, T is the total time period =t1+t2, k = t1/T is the duty cycle. • The rms value of output voltage is V0 = ( i/T ∫ V0 2 dt ) ½ = k Vs • The output power and is given by Pi = 1/T ∫v0idt = 1/T ∫ v0 2 /R dt = kVs 2 /R
  • 8. • The duty cycle can be varied from 0 to 1 by varying t1, T or f. Therefore, the output voltage V0 can be varied from 0 to Vs by controlling k, and the power flow can be controlled. • As the time t1 changes the width of pulse is varied and this type of control is called pulse width modulation (PWM) control. For better understanding of PWM these diagrammatic representations can be used. These figures represent the waveforms obtained as output at different voltage requirements. High Speed Signal (90%): The green part of the signal represents the ON time and the white part of it represents time when it is not receiving any voltage. Signal with half voltage (50%):
  • 9. Signal with low voltage (10%): Advantages of PWM : The main advantage of PWM is that power loss in the switching devices is very low. When a switch is off there is practically no current, and when it is on, there is almost no voltage drop across the switch. Power loss, being the product of voltage and current, is thus in both cases close to zero. PWM works also well with digital controls, which, because of their on/off nature, can easily set the needed duty cycle. Using pulse width modulation has several advantages over analog control. Using PWM to dim a lamp would produce less heat than an analog control that converts some of the current to heat. Also, if you use PWM, the entire control circuit can be digital, eliminating the need for digital-to-analog converters. Using digital control lines will reduce the susceptibility of your circuit to interference. Finally, motors may be able to operate at lower speeds if you control them with PWM. When you use an analog current to control a motor, it will not produce significant torque at low speeds. The magnetic field created by the small current will be too weak to turn the rotor. On the other hand, a PWM current can create short pulses of magnetic flux at full strength, which can turn the rotor at extremely slow speeds. The technology has become more pervasive as low cost microcontrollers incorporate PWM control. Microcontrollers offer simple
  • 10. commands to vary the duty cycle and frequencies of the PWM control signal. PWM is also used in communications to take advantage of the higher immunity to noise provided by digital signals. So by getting these pulses generated by a microcontroller we can increase the efficiency, accuracy and thus the reliability of the system. The most commonly used microcontroller is 8051 that has been used in this project for production of pulses. MICROCONTROLLER A microcontroller (abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. This programmes memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Advantages of Microcontroller Microcontrollers are widely used in today’s control systems for the following reasons: • Design and Simulation – Because you are programming with software, detailed simulations may be performed in advance to assure correctness of code and system performance. • Flexibility – Ability to reprogram using Flash, EEPROM or EPROM allows straightforward changes in the control law used. • High Integration – Most microcontrollers are essentially single chip computers with on-chip processing, memory, and I/O. Some contain peripherals for serial communication and reading analog signals (with an
  • 11. analog-to-digital converter or ADC). This differentiates a microcontroller from a microprocessor. Microprocessors require that this functionality be provided by added components. • Cost – Cost savings come from several locations. Development costs are greatly decreased because of the design/flexibility advantages mentioned previously. Because so many components are included on one IC, board area and component savings are often evident as well. • Easy to Use – Just program and go! While in the past, programming has often involved tedious assembly code, today C compilers are available for most microcontrollers. Microcontrollers often only require a single 5V supply as well which makes them easier to power and use. 8051 is also one such microcontroller with certain features like • An 8-bit ALU. • Harvard memory architecture – the external program memory and data memory have separate address spaces from 0x0000 and separate controlsignal(s). • 8-bit internal data bus width and 16-bit internal address bus – Harvard memory architecture • CISC (Complex Instruction Set Computer) • Special function registers (SFRs) –PSW(processor status word), A (accumulator),B register, SP (stack pointer) and registers for serial IOs, timers, ports and interrupt handler. • on-chip RAM of 128 bytes. • 32 bytes of RAM also used as four banks of registers. Each register-set thus eight registers. • External data/stack memory can be added upto 64 kB in most of the version. In certain 8051 enhancements, this limit enhanced to 16 MB. After acquiring the data about microcontroller, DC motor and PWM technique we can get into designing a circuit that uses these units in controlling the speed of a DC motor
  • 12. FLOW CHART Start Check if both switches are open No Yes Decrease speed       Speed Required       80%  No Speed Required      50%   No  Close S1&S2 
  • 16. The components are connect on a Printed Circuit Board as per the given connection details in the circuit diagram. The functioning of the circuit can be explained with respect to the action format that occurs in the circuit. As the supply is switched ON and both the switches are open the switching supplies ideally 5V is given to the microcontroller. Suppose if the any of the switch is closed the supply gets directly shorted with the ground. This indicates the microcontroller about the switch positions and thus generates the signal as per the given program for the respective switches position. The transistor used allows current to conduct through it when ever a positive pulse is given at its base that is given by the microcontroller inaccordance with the program. As the transistor is forward biased the supply that is used to run the motor gets connected with the motor terminals and motor starts running. As soon as the 0 voltage is encountered the NPN transistor used goes into reverse bias and stops its conduction so the motor’s armature supply gets disconnected till the base current is 0 volts. By this we can deduce that the speed of the motor is directly dependent on the supply given by microcontroller to the base which indeed depends on the program written. So the speeds of working of the circuit depends on the number of switches used, for instance in the above circuit two switches are used so the number of speed levels are 22 = 4. So the number of speed levels for X switches will be 2X . So the speed of the motor can be varied in steps. SOFTWARE DESCRIPTION #include<reg51.h> These are the ports from where the microcontroller gets the information about the switch positions.
  • 17. sbit SW_1 = P2^6; //connecting switch 1 to the port 2 ,pin 6. sbit SW_2 = P2^7; // connecting switch 1 to the port 2 ,pin 7. sbit MTR = P1^0; // from this pin we get the signal that is to be fed to the base void main() { int x; while(1) { if(SW_1==0 & SW_2==0) { This condition is stated when both the switches are closed in this position the supply from the switches is shorted into the ground terminal so microcontroller doesn’t get any voltage so the switches are considered as 0’s. At this condition the program is written so that the output signal given by the microcontroller should have 150 machine cycles of ON state and 600 machine cycles of OFF state. MTR=1; for(x=0;x<150;x++); MTR=0; for(x=0;x<600;x++); } if(SW_1==0 & SW_2==1) { This condition is stated when the switch1 is closed and switch 2 is open in this position the supply from the switch1 is shorted into the ground terminal so microcontroller doesn’t get any voltage so the switch is considered as 0. Similarly switch 2 is open and supply is sent to microcontroller so it is considered 1.At this condition the program is written so that the output signal given by the microcontroller should have 300 machine cycles of ON state and 300 machine cycles of OFF state. MTR=1; for(x=0;x<300;x++); MTR=0; for(x=0;x<300;x++); } if(SW_1==1 & SW_2==0) { This condition is stated when the switch2 is closed and switch 1 is open in this position the supply from the switch2 is shorted into the ground terminal so microcontroller doesn’t get any voltage so the switch is considered as 0. Similarly switch 1 is open and supply is sent to microcontroller so it is considered 1.At this condition the program is written so that the output signal given by the microcontroller should have 600 machine cycles of ON state and 150 machine MTR=1;
  • 18. for(x=0;x<600;x++); MTR=0; for(x=0;x<150;x++); } if(SW_1==1 & SW_2==1) In this condition both the switches are open so they are stated as 1’s and in this condition the motor runs at full speed. { MTR=1; } } } DATA AQUAINTED Condition 1 when both the switches are open:
  • 19. Voltage Speed 4.3V 860 rpm Condition 2 when switch SW1 is closed: Voltage Speed Average speed 4.3V 860rpm 3.6V 720rpm 790 rpm Condition 3 when switch SW2 is closed:
  • 20. Voltage Speed Average speed 4.3V 860rpm 3.9V 780rpm 820 rpm Condition 4 when both the switches are closed: Voltage Speed Average speed 4.3V 860rpm 3.3V 660rpm 760 rpm
  • 21. COMPONENT LIST Name of the Component Make Value Number AT89C51 Micro Controller ATMEL 1 Resistors R1,R2 10KΩ 2 Capacitors C1,C2 1nF 2 Capacitor C3 1mF 1 Diode D1 IN4004 1 Transistor T1 TIP122 1 Switches SW1,SW2 2 DC Motor AMETECK 12Volts 1 DC Adapter Q1(C) 12 Volts 1 DC Adapter Q2(C) 5 Volts 1 Crystal Oscillator X1 12MHz 1 REFERENCES • Books on DC motors: Driving DC Motors by G. MAIOCCHI, DC Motors and drives by BL. THERAJA. • Books on PWM technique: Pulse Width Modulated Power supplies by VALTER QUERCIOLI. • Books on Microcontroller: The 8051 microcontroller and embedded systems by JANICE GILLISPIE MAZIDI.