SlideShare a Scribd company logo
1 of 43
Unit-V
8051 MicrocontrollerApplications
By
S.Sayeekumar ,AP/RMDEEE
MICROPROCESSORS AND
MICROCONTROLLERS
โšซ Microprocessor is used for GENERAL
purposes.
โšซ It is the heart of the computer
.
โšซ T
o use microprocessor other components such
as
โ—ฆ Memory &
โ—ฆ Components for receiving and sending data
must be added to it.
MICRO C O N TROLLERS
โšซMicrocontrollers is designed for SPECIAL
purpose.
โšซNo other external components are
needed for its application because all
peripherals are built into it.
EMBEDDED SYSTEMS
โšซ Embedded technology is that exclusively
written software is embedded inside the
custom built hardware to do specific function.
โšซThe advantages are
โ—ฆ higher performance,
lower power consumption
compact size.
Contdโ€ฆ..
โšซThe most commonly used
microcontrollers for embedded
systems are
โšซPIC ( Programmable Interrupt Controller)
โšซ8051 belongs toATMEL 89C51 family
.
8051 MicrocontrollerArchitecture
andApplications
โšซ The 8051 Microcontroller was designed in
1980โ€™
s by Intel.
โšซ Developed for embedded system applications.
โšซ โ€œThere are many applications with8051
microcontroller
.So,8051 Microcontroller
Projects have great significance in Engineering final
year
.โ€
FEATURES
8-bit CPU
4k bytes ROM for the program
128 BYTES of RAM for variables
32 I/O lines ( 4 PORTS WITH 8 EACH )
2 timers
1 Serial port
6 interrupt
PIN DETAILS
IN TERFACIN G WIT H 8051
โšซInterfacing of 8051 with
โ—ฆ Relay
โ—ฆ PWM Generator
โ—ฆ DC Motor
โ—ฆ Stepper Motor
STEPPER MOTOR
โšซ A stepper motor is an electromechanical device
which converts electrical pulses into discrete
mechanical movements or steps.
โšซ This motor divides a full rotation of 360
degrees into a number of equal steps.
Interfacing Stepper Motor with 8051
โšซ
We now want to control a stepper motor in 8051 .It
works by turning ON &OFF afour I/O port lines
generating at a particular frequency
.
โšซ
The 8051 has four numbers of I/O port lines,connected
with I/O Port lines (P0.0 โ€“ P0.3) to rotate the stepper
motor.
โšซ ULN2003 is a high voltage and high current Darlington
array IC.
โšซ ULN2003 is used as a driver for port I/O lines,drivers
output connected to stepper motor, connector
provided for external power supply if needed.
Pin Assignment with 8051
C Program to control stepper motor
using 8051
//Define 8051 registers
โšซ #include <reg51.h>
#include<stdio.h>
void DelayMs(unsigned int); //Delay function
//Delay 20msec
//----------------------------------
// Main Program
//----------------------------------
void Clockwise (void)
{
unsigned int i;
for (i=0;i<30;i++)
{
P0 = 0x01;DelayMs(5);
P0 = 0x02;DelayMs(5);
P0 = 0x04;DelayMs(5);
P0 = 0x08;DelayMs(5);
}
}
C Program to control stepper motor using 8051
Contdโ€ฆ.
โšซ voidAntiClockwise (void)
{
unsigned int i;
for (i=0;i<30;i++)
{
//Delay 20msec
P0 = 0x08;DelayMs(5);
P0 = 0x04;DelayMs(5);
P0 = 0x02;DelayMs(5);
P0 = 0x01;DelayMs(5);
}
}
void main (void)
{
P0 = 0; //Initialize Port0
//Loop Forever
while(1)
{
Clockwise ();
DelayMs (100);
P0 = 0;
AntiClockwise ();
DelayMs (100);
P0 = 0;
}
}
RELAY
โšซ A relay is an electrically operated switch. Relays are
used where it is necessary to control a circuit by a low-
power signal (with complete electrical isolation
between control and controlled circuits),or where
several circuits must be controlled by one signal.
โšซ A relay opens and closes under control of another
electrical circuit.It is therefore connected to output
pins of the microcontroller and used to turn on/off
high-power devices such as motors, transformers,
heaters,bulbs,antenna systems etc Relay is connected
to port 1.0
C Program to control relay using 8051
#include<stdio.h>
sbit relay_pin = P2^0;
void Delay_ms(int);
void main()
{
do
{
relay_pin = 1;//R
elay ON
Delay_ms(1000);
relay_pin = 0;//R
elay OFF
Delay_ms(1000);
}while(1);
}
void Delay_ms(int k)
{ int j;int i;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{ }
}
}
Interfacing 8051 with P W M GENERATOR
โšซ Pulse-width modulation (PWM), or pulse-duration
modulation (PDM), is amodulation technique thatconforms the
width of the pulse,the pulse duration,based on modulator signal
information.Although this modulation technique can be used to
encode information for transmission,its main use is to allow the
control of the power supplied to electrical devices,especially to
inertial loads such as motors.
โšซ The term dutycycledescribes the proportion of 'on' time to the
regular interval or 'period' of time;a low duty cycle corresponds to
low power
,because the power is off for most of the time.Duty
cycle is expressed in percent,100% being fully on.
Interfacing 8051 with P W M GENERATOR
Contdโ€ฆ
โšซ By changing the width of the pulse applied to
the DC motor we can increase or decrease the
amount of power to the motor and increase or
decrease the motor speed.
โšซ The voltage have fixed amplitude but variable
duty cycle.If the pulse is wider then the speed
will be higher and if the pulse is smaller then
the speed will be lower
.
Interfacing 8051 with P W M GENERATOR
Contdโ€ฆ
โšซ If the PWM circuitry is embedded in the chip,
we have to load the registers with high and low
pulses then microcontroller will take remaining
controls.
โšซ If the PWM circuitry is not embedded in the
chip,we have to create various duty cycle pulses
using software.
Interfacing 8051 with P W M GENERATOR
Interfacing 8051 with D C motor
โšซ D C Motors are small,inexpensive and powerful motors used
widely in robotics for their small size and high energy out.A typical
D C motor operates atspeeds thatare fartoo high speed to be
useful,and torque that are too low.Gearโ€™s reduce the speed of
motor and increases the torque.
โšซ The maximum current that canbe sourced or sunk from a8051
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.
Interfacing 8051 with D C motor
DESCRIPTION OF DRIVER CIRCUIT
PROGRAM TO INTERFACE D C MOTOR W ITH 8051
#include<reg52.h>
#include<stdio.h>
void delay(void);
sbit motor_pin_1 = P2^0;
sbit motor_pin_2 = P2^1;
void main()
{
do {
motor_pin_1 = 1;
motor_pin_2 = 0;/
/
Rotates Motor Anti Clockwise
delay();
motor_pin_1 = 1;
motor_pin_2 = 1;/
/
Stops Motor
delay();
motor_pin_1 = 0;
Contdโ€ฆ
motor_pin_2 = 1;//Rotates Motor Clockwise
delay();
motor_pin_1 = 0;
motor_pin_2 = 0;//Stops Motor
delay();
}
while(1);
}
void delay()
{
int i,j;for(i=0;i<1000;i++)
{
for(j=0;j<1000;j++)
{ }
}
}
Control Signals and Motor
Status
โšซP2.0/IN1 P2.1/IN2 Motor Status
โšซLOW LOW Stops
LOW HIGH Clockwise
HIGH LOW Anti-Clockwise
HIGH HIGH Stops
Implementation of Traffic Light
Controller using 8051
โšซ Traffic lights or traffic signals are signaling
devices positioned at road intersections,
pedestrian crossings and other locations to
control competing flows of traffic.
Implementation of traffic light controller
using 8051
โšซ Traffic lights alternate the right of way of road users by displaying
lights of astandard color (red, yellow/amber
,and green), using a
universal color code.
In the typical sequence of colored lights:
Illumination of the green light allows traffic to proceed in the
direction denoted,
โšซ Illumination of the yellow/amber light denoting,if safe to do so,
prepare to stop short of the intersection,and
โšซ Illumination of the red signal prohibits any traffic from proceeding.
PIN ASSIGNMENT WITH 8051
LAN Direction 8051 Lines LEDโ€™s Traffic Light Controller
P3.2 D8-Stop
NORTH D9-Listen
P3.3
P3.4 D10-Go
P3.5 D11-Stop
WEST P3.6 D12-Listen
P3.7 D13-Go
P1.0 D14-Stop
SOUTH P1.1 D15-Listen
P1.2 D16-Go
P1.3 D17-Stop
EAST P1.4 D18-Listen
P1.5 D19-Go
Note : Make SW32 to โ€œTrafficโ€ label marking position
CIRCUIT DIAGRAM TO INTERFACETRAFFIC LIGHT
Program to control traffic signals
#include <reg51.h>
sbit RA =
sbitYA =
sbit GA =
sbit RB =
sbitYB =
sbit GB =
sbit RC =
sbitYC =
sbit GC =
sbit rD =
sbitYD =
sbit GD =
P1^0;
P1^1;
P1^2;
P3^2;
P3^3;
P3^4;
P3^5;
P3^6;
P3^7;
P1^3;
P1^4;
P1^5;
void Delay (void)
{
unsigned int i,j;
for (i=0;i<200;i++)
for (j=0;j<500;j++);
}
void SuperDelay ()
{
unsigned int i;
for (i=0;i<25;i++)
Delay();
}
1; YA = 0;
void main ()
{
P3 = 0;
while (1)
{
RA =
RB =
RC =
rD =
0; GA =
1; GB =
1; GC =
1; GD =
0; YB = 0;
0; YC = 0;
0; YD = 0;
SuperDelay();
GA = 0; YA = 1;
Delay();
RA = 1; GA =
RB = 0; GB =
RC = 1; GC =
rD = 1; GD =
0; YA = 0;
1; YB = 0;
0; YC = 0;
0; YD = 0;
SuperDelay ();
GB = 0; YB = 1;
Delay ();
0; YA = 0;
RA = 1; GA =
RB = 1; GB =
RC = 0; GC =
rD = 1; GD =
0; YB = 0;
1; YC = 0;
0; YD = 0;
SuperDelay ();
GC = 0; YC = 1;
Delay();
RA = 1; GA =
RB = 1; GB =
RC = 1; GC =
rD = 0; GD =
0; YA = 0;
0; YB = 0;
0; YC = 0;
1; YD = 0;
SuperDelay ();
GD = 0; YD = 1;
Delay();
}
}
Washing machine control
Interfacing washing machine control
with 8051
Control flow
Interfacing I2C - Inter integrated circuit
serial bus
โšซ At any time the electrical power is turned off,the
Microcontroller will start from initial state after power
is turned on,losing all intermediate states.
โšซ To avoid this problem a Serial EEPROM is
โšซ interfaced to the microcontroller via I2C serial BUS.
โšซ This is a two wire bus using a protocol to transfer data
between microcontroller and serial memory and save
the status of process event sequentially
DataTransfer from master to slave
โšซ A master device sends the sequence of signal with
START
,ADDRESS, andWRITE protocol, then waits for
an acknowledge bit (A) from the slave
โšซ The slave will generate acknowledge bit only if its
internal address matches the value sent by the master
.
โšซ After that the master sends DATA and waits for
acknowledge (A) from the slave.The master completes
the byte transfer by generating a stop bit (P)
Data transfer sequence
โšซ A Master to slave read or write sequence for I2C
follows the following order:
โšซ 1.Send the START bit (S).
โšซ 2.Send the address (ADDR).
โšซ 3.Send the Read(R)-1 /Write (W)-0 bit.
โšซ 4.Wait for/Send an acknowledge bit (A).
โšซ 5.Send/Receive the data byte (8 bits) (DATA).
โšซ 6.Expect/Send acknowledge bit (A).
โšซ 7.Send STOP bit (P).

More Related Content

Similar to 8051 - microcontroller applications.pptx

4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll new
Mainak Nandi
ย 
5 FINAL PROJECT REPORT
5 FINAL PROJECT REPORT5 FINAL PROJECT REPORT
5 FINAL PROJECT REPORT
Debojyoti Majumdar
ย 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed control
Sai Malleswar
ย 
Basic plc
Basic plcBasic plc
Basic plc
sundar sivam
ย 
Cockpit White Box
Cockpit White BoxCockpit White Box
Cockpit White Box
ncct
ย 
Drivers2
Drivers2Drivers2
Drivers2
guestea186b
ย 
Drivers2
Drivers2Drivers2
Drivers2
guestea186b
ย 
Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051
embdnew
ย 

Similar to 8051 - microcontroller applications.pptx (20)

L6283 1.3.pdf
L6283 1.3.pdfL6283 1.3.pdf
L6283 1.3.pdf
ย 
DETECTING POWER GRID SYNCHRONISATION FAILURE ON SENSING BAD VOLTAGE OR FREQUE...
DETECTING POWER GRID SYNCHRONISATION FAILURE ON SENSING BAD VOLTAGE OR FREQUE...DETECTING POWER GRID SYNCHRONISATION FAILURE ON SENSING BAD VOLTAGE OR FREQUE...
DETECTING POWER GRID SYNCHRONISATION FAILURE ON SENSING BAD VOLTAGE OR FREQUE...
ย 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial Automation
ย 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll new
ย 
5 FINAL PROJECT REPORT
5 FINAL PROJECT REPORT5 FINAL PROJECT REPORT
5 FINAL PROJECT REPORT
ย 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed control
ย 
Basic plc
Basic plcBasic plc
Basic plc
ย 
Alcohol detection & driver safety
Alcohol detection & driver safetyAlcohol detection & driver safety
Alcohol detection & driver safety
ย 
Cockpit White Box
Cockpit White BoxCockpit White Box
Cockpit White Box
ย 
embedded system
embedded systemembedded system
embedded system
ย 
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
ย 
Drivers2
Drivers2Drivers2
Drivers2
ย 
Drivers2
Drivers2Drivers2
Drivers2
ย 
IRJET- Automation in Substation using Programmable Logic Controller (PLC)
IRJET- Automation in Substation using Programmable Logic Controller (PLC)IRJET- Automation in Substation using Programmable Logic Controller (PLC)
IRJET- Automation in Substation using Programmable Logic Controller (PLC)
ย 
IRJET - IoT based Speed Control of DC Motor using PWM Technique
IRJET -  	  IoT based Speed Control of DC Motor using PWM TechniqueIRJET -  	  IoT based Speed Control of DC Motor using PWM Technique
IRJET - IoT based Speed Control of DC Motor using PWM Technique
ย 
IRJET- Technique to Prevent Power Theft Losses using Static Device
IRJET-  	  Technique to Prevent Power Theft Losses using Static DeviceIRJET-  	  Technique to Prevent Power Theft Losses using Static Device
IRJET- Technique to Prevent Power Theft Losses using Static Device
ย 
Programmable Logic Controller Training Day 1 to 3.pptx
Programmable Logic Controller  Training Day 1 to 3.pptxProgrammable Logic Controller  Training Day 1 to 3.pptx
Programmable Logic Controller Training Day 1 to 3.pptx
ย 
Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051
ย 
Basic PLC
Basic PLCBasic PLC
Basic PLC
ย 
Home automation control system using dtmf technology
Home automation control system using dtmf technologyHome automation control system using dtmf technology
Home automation control system using dtmf technology
ย 

More from MadavanR1

EE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
EE4104 -ELECTRICAL DRIVES AND CONTROL.pptxEE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
EE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
MadavanR1
ย 
lecture on 31 fuzzy logic _ system (3).ppt
lecture on 31 fuzzy logic _ system (3).pptlecture on 31 fuzzy logic _ system (3).ppt
lecture on 31 fuzzy logic _ system (3).ppt
MadavanR1
ย 
Zaragoza Factory_Transformer Our product_ EN.ppt
Zaragoza Factory_Transformer Our product_ EN.pptZaragoza Factory_Transformer Our product_ EN.ppt
Zaragoza Factory_Transformer Our product_ EN.ppt
MadavanR1
ย 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
MadavanR1
ย 
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.pptOPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
MadavanR1
ย 
MEPCO Full 191217.ppt
MEPCO Full 191217.pptMEPCO Full 191217.ppt
MEPCO Full 191217.ppt
MadavanR1
ย 

More from MadavanR1 (7)

EE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
EE4104 -ELECTRICAL DRIVES AND CONTROL.pptxEE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
EE4104 -ELECTRICAL DRIVES AND CONTROL.pptx
ย 
lecture on 31 fuzzy logic _ system (3).ppt
lecture on 31 fuzzy logic _ system (3).pptlecture on 31 fuzzy logic _ system (3).ppt
lecture on 31 fuzzy logic _ system (3).ppt
ย 
Zaragoza Factory_Transformer Our product_ EN.ppt
Zaragoza Factory_Transformer Our product_ EN.pptZaragoza Factory_Transformer Our product_ EN.ppt
Zaragoza Factory_Transformer Our product_ EN.ppt
ย 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
ย 
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.pptOPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
OPERATING PRINCIPLES OF TRANSFORMER AND CONSTRUCTION.ppt
ย 
MEPCO Full 191217.ppt
MEPCO Full 191217.pptMEPCO Full 191217.ppt
MEPCO Full 191217.ppt
ย 
lec 31 fuzzysystem (3) (2).ppt
lec 31 fuzzysystem (3) (2).pptlec 31 fuzzysystem (3) (2).ppt
lec 31 fuzzysystem (3) (2).ppt
ย 

Recently uploaded

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
sivaprakash250
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
SUHANI PANDEY
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
ย 

Recently uploaded (20)

Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
ย 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
ย 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
ย 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
ย 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
ย 

8051 - microcontroller applications.pptx

  • 2. MICROPROCESSORS AND MICROCONTROLLERS โšซ Microprocessor is used for GENERAL purposes. โšซ It is the heart of the computer . โšซ T o use microprocessor other components such as โ—ฆ Memory & โ—ฆ Components for receiving and sending data must be added to it.
  • 3. MICRO C O N TROLLERS โšซMicrocontrollers is designed for SPECIAL purpose. โšซNo other external components are needed for its application because all peripherals are built into it.
  • 4. EMBEDDED SYSTEMS โšซ Embedded technology is that exclusively written software is embedded inside the custom built hardware to do specific function. โšซThe advantages are โ—ฆ higher performance, lower power consumption compact size.
  • 5. Contdโ€ฆ.. โšซThe most commonly used microcontrollers for embedded systems are โšซPIC ( Programmable Interrupt Controller) โšซ8051 belongs toATMEL 89C51 family .
  • 6. 8051 MicrocontrollerArchitecture andApplications โšซ The 8051 Microcontroller was designed in 1980โ€™ s by Intel. โšซ Developed for embedded system applications. โšซ โ€œThere are many applications with8051 microcontroller .So,8051 Microcontroller Projects have great significance in Engineering final year .โ€
  • 7.
  • 8. FEATURES 8-bit CPU 4k bytes ROM for the program 128 BYTES of RAM for variables 32 I/O lines ( 4 PORTS WITH 8 EACH ) 2 timers 1 Serial port 6 interrupt
  • 9.
  • 11. IN TERFACIN G WIT H 8051 โšซInterfacing of 8051 with โ—ฆ Relay โ—ฆ PWM Generator โ—ฆ DC Motor โ—ฆ Stepper Motor
  • 12. STEPPER MOTOR โšซ A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements or steps. โšซ This motor divides a full rotation of 360 degrees into a number of equal steps.
  • 13. Interfacing Stepper Motor with 8051 โšซ We now want to control a stepper motor in 8051 .It works by turning ON &OFF afour I/O port lines generating at a particular frequency . โšซ The 8051 has four numbers of I/O port lines,connected with I/O Port lines (P0.0 โ€“ P0.3) to rotate the stepper motor. โšซ ULN2003 is a high voltage and high current Darlington array IC. โšซ ULN2003 is used as a driver for port I/O lines,drivers output connected to stepper motor, connector provided for external power supply if needed.
  • 15. C Program to control stepper motor using 8051 //Define 8051 registers โšซ #include <reg51.h> #include<stdio.h> void DelayMs(unsigned int); //Delay function //Delay 20msec //---------------------------------- // Main Program //---------------------------------- void Clockwise (void) { unsigned int i; for (i=0;i<30;i++) { P0 = 0x01;DelayMs(5); P0 = 0x02;DelayMs(5); P0 = 0x04;DelayMs(5); P0 = 0x08;DelayMs(5); } }
  • 16. C Program to control stepper motor using 8051 Contdโ€ฆ. โšซ voidAntiClockwise (void) { unsigned int i; for (i=0;i<30;i++) { //Delay 20msec P0 = 0x08;DelayMs(5); P0 = 0x04;DelayMs(5); P0 = 0x02;DelayMs(5); P0 = 0x01;DelayMs(5); } } void main (void) { P0 = 0; //Initialize Port0 //Loop Forever while(1) { Clockwise (); DelayMs (100); P0 = 0; AntiClockwise (); DelayMs (100); P0 = 0; } }
  • 17. RELAY โšซ A relay is an electrically operated switch. Relays are used where it is necessary to control a circuit by a low- power signal (with complete electrical isolation between control and controlled circuits),or where several circuits must be controlled by one signal. โšซ A relay opens and closes under control of another electrical circuit.It is therefore connected to output pins of the microcontroller and used to turn on/off high-power devices such as motors, transformers, heaters,bulbs,antenna systems etc Relay is connected to port 1.0
  • 18. C Program to control relay using 8051 #include<stdio.h> sbit relay_pin = P2^0; void Delay_ms(int); void main() { do { relay_pin = 1;//R elay ON Delay_ms(1000); relay_pin = 0;//R elay OFF Delay_ms(1000); }while(1); } void Delay_ms(int k) { int j;int i; for(i=0;i<k;i++) { for(j=0;j<100;j++) { } } }
  • 19. Interfacing 8051 with P W M GENERATOR โšซ Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is amodulation technique thatconforms the width of the pulse,the pulse duration,based on modulator signal information.Although this modulation technique can be used to encode information for transmission,its main use is to allow the control of the power supplied to electrical devices,especially to inertial loads such as motors. โšซ The term dutycycledescribes the proportion of 'on' time to the regular interval or 'period' of time;a low duty cycle corresponds to low power ,because the power is off for most of the time.Duty cycle is expressed in percent,100% being fully on.
  • 20. Interfacing 8051 with P W M GENERATOR Contdโ€ฆ โšซ By changing the width of the pulse applied to the DC motor we can increase or decrease the amount of power to the motor and increase or decrease the motor speed. โšซ The voltage have fixed amplitude but variable duty cycle.If the pulse is wider then the speed will be higher and if the pulse is smaller then the speed will be lower .
  • 21. Interfacing 8051 with P W M GENERATOR Contdโ€ฆ โšซ If the PWM circuitry is embedded in the chip, we have to load the registers with high and low pulses then microcontroller will take remaining controls. โšซ If the PWM circuitry is not embedded in the chip,we have to create various duty cycle pulses using software.
  • 22. Interfacing 8051 with P W M GENERATOR
  • 23. Interfacing 8051 with D C motor โšซ D C Motors are small,inexpensive and powerful motors used widely in robotics for their small size and high energy out.A typical D C motor operates atspeeds thatare fartoo high speed to be useful,and torque that are too low.Gearโ€™s reduce the speed of motor and increases the torque. โšซ The maximum current that canbe sourced or sunk from a8051 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.
  • 26. PROGRAM TO INTERFACE D C MOTOR W ITH 8051 #include<reg52.h> #include<stdio.h> void delay(void); sbit motor_pin_1 = P2^0; sbit motor_pin_2 = P2^1; void main() { do { motor_pin_1 = 1; motor_pin_2 = 0;/ / Rotates Motor Anti Clockwise delay(); motor_pin_1 = 1; motor_pin_2 = 1;/ / Stops Motor delay(); motor_pin_1 = 0;
  • 27. Contdโ€ฆ motor_pin_2 = 1;//Rotates Motor Clockwise delay(); motor_pin_1 = 0; motor_pin_2 = 0;//Stops Motor delay(); } while(1); } void delay() { int i,j;for(i=0;i<1000;i++) { for(j=0;j<1000;j++) { } } }
  • 28. Control Signals and Motor Status โšซP2.0/IN1 P2.1/IN2 Motor Status โšซLOW LOW Stops LOW HIGH Clockwise HIGH LOW Anti-Clockwise HIGH HIGH Stops
  • 29. Implementation of Traffic Light Controller using 8051 โšซ Traffic lights or traffic signals are signaling devices positioned at road intersections, pedestrian crossings and other locations to control competing flows of traffic.
  • 30. Implementation of traffic light controller using 8051 โšซ Traffic lights alternate the right of way of road users by displaying lights of astandard color (red, yellow/amber ,and green), using a universal color code. In the typical sequence of colored lights: Illumination of the green light allows traffic to proceed in the direction denoted, โšซ Illumination of the yellow/amber light denoting,if safe to do so, prepare to stop short of the intersection,and โšซ Illumination of the red signal prohibits any traffic from proceeding.
  • 32. LAN Direction 8051 Lines LEDโ€™s Traffic Light Controller P3.2 D8-Stop NORTH D9-Listen P3.3 P3.4 D10-Go P3.5 D11-Stop WEST P3.6 D12-Listen P3.7 D13-Go P1.0 D14-Stop SOUTH P1.1 D15-Listen P1.2 D16-Go P1.3 D17-Stop EAST P1.4 D18-Listen P1.5 D19-Go Note : Make SW32 to โ€œTrafficโ€ label marking position
  • 33. CIRCUIT DIAGRAM TO INTERFACETRAFFIC LIGHT
  • 34. Program to control traffic signals #include <reg51.h> sbit RA = sbitYA = sbit GA = sbit RB = sbitYB = sbit GB = sbit RC = sbitYC = sbit GC = sbit rD = sbitYD = sbit GD = P1^0; P1^1; P1^2; P3^2; P3^3; P3^4; P3^5; P3^6; P3^7; P1^3; P1^4; P1^5;
  • 35. void Delay (void) { unsigned int i,j; for (i=0;i<200;i++) for (j=0;j<500;j++); } void SuperDelay () { unsigned int i; for (i=0;i<25;i++) Delay(); }
  • 36. 1; YA = 0; void main () { P3 = 0; while (1) { RA = RB = RC = rD = 0; GA = 1; GB = 1; GC = 1; GD = 0; YB = 0; 0; YC = 0; 0; YD = 0; SuperDelay(); GA = 0; YA = 1; Delay(); RA = 1; GA = RB = 0; GB = RC = 1; GC = rD = 1; GD = 0; YA = 0; 1; YB = 0; 0; YC = 0; 0; YD = 0; SuperDelay ();
  • 37. GB = 0; YB = 1; Delay (); 0; YA = 0; RA = 1; GA = RB = 1; GB = RC = 0; GC = rD = 1; GD = 0; YB = 0; 1; YC = 0; 0; YD = 0; SuperDelay (); GC = 0; YC = 1; Delay(); RA = 1; GA = RB = 1; GB = RC = 1; GC = rD = 0; GD = 0; YA = 0; 0; YB = 0; 0; YC = 0; 1; YD = 0; SuperDelay (); GD = 0; YD = 1; Delay(); } }
  • 39. Interfacing washing machine control with 8051
  • 41. Interfacing I2C - Inter integrated circuit serial bus โšซ At any time the electrical power is turned off,the Microcontroller will start from initial state after power is turned on,losing all intermediate states. โšซ To avoid this problem a Serial EEPROM is โšซ interfaced to the microcontroller via I2C serial BUS. โšซ This is a two wire bus using a protocol to transfer data between microcontroller and serial memory and save the status of process event sequentially
  • 42. DataTransfer from master to slave โšซ A master device sends the sequence of signal with START ,ADDRESS, andWRITE protocol, then waits for an acknowledge bit (A) from the slave โšซ The slave will generate acknowledge bit only if its internal address matches the value sent by the master . โšซ After that the master sends DATA and waits for acknowledge (A) from the slave.The master completes the byte transfer by generating a stop bit (P)
  • 43. Data transfer sequence โšซ A Master to slave read or write sequence for I2C follows the following order: โšซ 1.Send the START bit (S). โšซ 2.Send the address (ADDR). โšซ 3.Send the Read(R)-1 /Write (W)-0 bit. โšซ 4.Wait for/Send an acknowledge bit (A). โšซ 5.Send/Receive the data byte (8 bits) (DATA). โšซ 6.Expect/Send acknowledge bit (A). โšซ 7.Send STOP bit (P).