Escolar Documentos
Profissional Documentos
Cultura Documentos
A Project Report
On
MICROPROCESSOR EMBEDDED SYSTEM
OF A REAL-TIME SYSTEM
By
NDIKA CHINEMELUM CHUKWUNWEIKE
Abstract ...........................................................................................ii
CHAPTER ONE
Real time simulation of four way traffic light ..................................1
CHAPTER TWO
Fluid level controller ........................................................................9
1.0 REAL TIME SIMULATION OF FOUR WAY TRAFFIC
LIGHT CONTROLLER IN A PROTEUS
ENVIRONMENT
A practical example of a real time system is traffic light. There are
different ways of designing a traffic light system. Depending on
the user’s need , there are traffic light with
Arrow light
Timer
Sensor
In a traffic light with timer, the timer is in a form of counter
enables drivers to know the duration of the light. The design of
this system is done in such a way that the operation
microcontroller will control the traffic light bulb as well as to
control the counter sub-circuit.
Traffic light with sensor are usually used at road junction where
emergencies are needed. Light sensor such as, photodiodes, light
dependent resistors (LDR), phototransistors etc. Are placed along
the road near the junction. The presence of the sensor enables
the traffic light to work according to the value of the traffic the
light at the junction.
While in traffic light with Arrows, the design objective is to give
an additional array of light to reduce traffic.
FIG 1.1 A FOUR WAY TRAFFIC LIGHT
CONTROLLER IN A PROTEUS ENVIRONMENT
1. COMPONENT OF FOUR WAY TRAFFIC LIGHT
Microcontroller AT89C51
Crystal oscillator
Power supply
Capacitor 33pf
Resistor 10k
Switches
Ground
Traffic light
The AT89C51 is a 40-pin microcontroller, which consists of 30
input/output pins and 8 special pins. Many of the pins have
optional alternate function relating to accessing external memory
using the on chip timer/counters, detecting external interrupts,
and handling serial communication.
0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 RED ON GREEN
ON
Call Call
five- five-
sec sec
1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 YELLOW
ON
Call Call
two- two-
sec sec
0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 1 GREEN
ON
Call Call
five- five-
sec sec
1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 YELLOW
ON
Call Call
two- two-
sec sec
org 00h
start:
mov p1,#000010001b
mov p2,#00000011b
call delay
mov p1,#01100010b
mov p2,#00000100
call delay
mov p1,#10001100b
mov p2,#00001000b
call delay
jmp start
delay:
Mov R1,#120
Mov R2,#0
Mov R3,#38
MEG:Djnz R1,MEG
Djnz R2,MEG
Djnz R3,MEG
Ret
CHAPTER TWO
LCD INTERFACE OF FUILD LEVEL CONTROL
2.0 background study of a Liquid Crystal Display LCD
LCD mean Liquid Crystal Display. In recent years, it is finding
widespread use thus, replacing light emitting diodes. (LCDS). The
seven segment display an others.
This is due to the following reasons
1. The declining of prices of LCD
2. The ability to display numbers, characters and graphics. This
is in contrast to 7 segment, which its display is limited to
some numbers and few characters.
3. Ease of programming for characters and graphics display.
4. Incorporation of refreshing controller into the LCD, thereby
hiring the CPU of the task of refreshing the LCD.
There are many places where LCDs are applied in these days’
modern electronics gadgets. Example, modern television set is
made with LCD for display, replacing the old cathode ray tube
system. Then the modern wrist watches use LCD instead of (7)
seven segment, and other examples.
Fig 2.1 : LCD Pin arrangement
The VCC and VSS provide +5v ground respectively, while VEE is
used for controlling the LCD contrast.
READ/WRITE (R/W)
This is another very important register inside the LCD. The R/W
inputs allow the user to write information to the LCD or read
information from it.
If R/W= 0, it write data onto the LCD;
If R/W= 1, it read data from the LCD.
ENABLE (E)
The enable pin is used by LCD to latch information that is present
on its data pins. When data is supplied to the data pin, a high-to-
low pulse must be applied to these pins in order for the LCD to
latch in the data present at the pins.
COMPONENT
I. Microcontroller 80C31
II. Crystal oscillator
III. 10k resistor
IV. Switch
V. Capacitor
VI. Power supply
VII. LM016L
Fig 2.0 FUILD LEVEL CONTROL
This is a real time system that control the level of water in
reservoir. The sensors are wires. When the reservoir is full of
water, the 10k drop the voltage to low , and zero enter into the
microcontroller. Immediately the level of water start going down,
change occur.
At point ‘A’ the VOA is high, so 1bit(high) enter into
microcontroller port, as the water level continues to go down, the
micro controller will be monitoring the level until it gets below ‘B’
level where port goes high. And below ‘C’ level where port goes
high turning to LCD.
CONTROL PROGRAM
org 00h
start:
Mov p1,#11111111b
Mov p2,#00000000b
chinemelum:
jp p1.0,ndika
clr p2.3
setb p2.0
call delay
clr p2.1
clr p2.2
jmp chinemelum
ndika:
jb p1.1,ndika1
clr p2.0
setb p2.1
DELAY:
PET:Mov R1,#120
Mov R2,#0
Mov R3,#38
MEG:Djnz R1,MEG
Djnz R2,MEG
Djnz R3,MEG
Ret
clr p2.2
jmp chinemelum
ndika1:
jb p1.2,ndika2
clr p2.0
clr p2.1
setb p2.2
call delay
jmp chinemelum
ndika2:
setb p2.3
jmp chinemelum
DELAY1:
PET1:Mov R1,#120
Mov R2,#0
Mov R3,#38
Ret
END