Documente Academic
Documente Profesional
Documente Cultură
by the IR sensor arranged before the signal post, the controller in the transmitting
section transmits the time duration of the RED signal to the vehicle. If the time
duration is more than 10 seconds, the controller in the vehicle activates the alarm
to switch OFF the engine. If the engine is not switched OFF, the controller
automatically OFFs the engine. If the time duration is less than 10 seconds, the
vehicles engine will not be switched OFF.
By this type of system, lot of fuel can be saved and the pollution can also
be decreased. This way the traffic signaling system can be designed to other
three directions as well.
CHAPTER-2
INTRODUCTION
Traffic congestion is increasingly becoming a severe problem in many
large cities around the world. The problem is more complex in developing
countries where cities are growing much faster than those in the developed
countries. The average annual population growth in developing countries is
estimated at around 5% compared to 0.7% in developed countries. With the
increase of population the traffic is also being increased day by day. It has
become a hell kind of experience in these days to go out in the peak hours,
mostly in the metropolitan cities. It takes hours to go to a near place where there
have been number of traffic signal junctions.
Automotive technologies are gaining ground in modern road traffic-control
systems, since the number of road vehicles and passengers is rapidly growing.
There is a perpetual need for safety-critical traffic automation, and traffic
engineering makes the dynamic or static analysis and the synthesis of
automotive vehicle technologies possible. The main goal of engineering is the
planning and management of traffic systems as well as the intelligent
automobiles to take self decisions i.e., artificial intelligence is to be designed in
them.
The project supports the development of reliable and optimal control
structures for urban traffic and for motorway systems. The intelligent and
cooperative set-up of actuation and its linkage to the central control system is
vital for avoiding fuel consumption of vehicle at signal post. Moreover,
environmental costs (e.g., pollution) can be decreased. Growing numbers of road
users and the limited resources provided by current infrastructures lead to ever
increasing traveling times.
Traffic in a city is very much affected by traffic light controllers. When
waiting for a traffic light, the driver looses time and the car uses fuel. To make
automobile controllers more intelligent, we exploit the emergence of novel
technologies such as communication networks and sensor networks, as well as
the use of more sophisticated algorithms for setting traffic lights. Intelligent traffic
light control does not only mean that traffic lights are set in order to minimize
waiting times of road users, but also that road users receive information about
how to drive through a city in order to minimize their waiting times and save fuel
as well as reduce pollution. This means that we are coping with a complex multiagent system, where communication and coordination play essential roles. Our
research has led to a novel system in which traffic light controllers and the
behavior of car drivers are optimized using machine-learning methods.
Generally when the traffic signaling post is reached and if a RED signal is
displayed, all the vehicles will stop. But the human tendency is that the vehicle
engines will not be switched off. This leads to fuel combustion even the vehicle
isnt travelling which leads to more pollution. This project presents an automated
solution that reduces the pollution as well as saves the fuel of the vehicles. As
mentioned in the abstract the signal post acts as the transmitter, transmitting the
time duration to turn the RED signal to GREEN. The vehicle receives the signal
and displays the information of time duration in the LCD. If the time duration is
more than the set value in the program, automatically the vehicle engine will be
stopped by the controller.
This project has been designed by using IR sensors for approaching road
at a signal junction. The IR sensor gives a signal indication that the vehicle has
approached the signal junction to the controller at the signal post. By which the
controller transmits the seconds time duration of turning on the GREEN indicator
through the Zigbee RF transmitter. Depending on the information received, the
controller takes the decision to switch off the engine or not by taking the time
duration into account. And the rest of the signals will be in red for the duration of
period defined in the controller. Likewise in each direction all the vehicles can be
given information about the signaling time duration by which the vehicle engines
can be stopped to save fuel as well as reduce pollution to some extent.
The explosion in wireless technology has seen the emergence of many
standards, especially in the industrial, scientific and medical (ISM) radio band.
There have been a multitude of proprietary protocols for control applications,
which bottlenecked interfacing. Need for a widely accepted standard for
communication between sensors in low data rate wireless networks was felt. As
an answer to this dilemma Zigbee is designed. As ZigBee protocol provides
simple and robust wireless applications, this device can send and receive the
digital data. ZigBee is a specification for a suite of high level communication
protocols using small, low-power digital radios based on an IEEE 802 standard
for personal area networks.
Zigbee is one of the wireless protocols based on the IEEE 802.15.4
standard for wireless personal area networks (WPANs). Zigbee is designed to
use in embedded applications requiring low data rates and low power
consumption. The benefits of using Zigbee technology is to make the design as
simple as possible, cost-effective, Robust (Ensuring a reliable solution in noisy
environments), low-power wireless connectivity, etc. One main advantage of
using this technology is to cover large areas with routers. As each Zigbee module
can send and receive data, the received data received from one point can be
transported to the third point as a mediator.
CHAPTER 3
FUNCTIONAL DESCRIPTION
The functional description of the project work is explained in this chapter.
For better understanding total project work is divided into various sections and
each section circuit description is provided in this chapter. The complete block
and circuit diagram of this project is provided in the next chapter.
When both the transmitted and the received frequencies are matched, the
I-phase detector enables the output pin of the 567-tone decoder i.e., the 8 th pin.
So when the output is enabled the output from the IC is a logic low signal. And if
the frequencies do not match, the output will not be enabled and the 8th pin will
logic high signal. This is due to the fact that at the 8 th pin internally a transistor is
present whose emitter is grounded and the collector pin the output 8 th pin. And if
the circuit of the 567-tone decoder is observed, we can see the supply i.e., Vcc is
connected to the output pin of the IC through a resistor.
When the frequencies match, the output will be enabled by which the
transistor will be conducting (ON) and the Vcc supply will grounded through the
transistor internally in the IC 567 Tone decoder itself. So a logic low signal will be
received. And the same way if frequencies do not match output will not enabled
by which the transistor will not be conducting (OFF) and the supply will be
coming from the output pin, which is the logic high signal.
When the IR sensors are connected facing each other, every time the
output of the tone decoder IC will be a logic low signal until no obstacle comes in
between the IR transmitter and the IR receiver. Unless any obstacle is present
the transmitted frequency will be continuously received by the receiver and
frequency will be matched with that of the generated ones and the output will be
enabled. So a logic low will be the output. And if obstacle comes in between the
sensors the IR receiver will not receive the signal and the tone decoder IC
checks the received frequency. As there is no received frequency the output will
not be enabled, thus a logic high signal is received.
If the sensors are placed side by side, the IR transmitter will be
transmitting the IR signal continuously and the receiver will receive the reflected
signal when there is any obstacle. So until there is no obstacle, the receiver will
not receive the IR signal, so the frequencies do not match and the output will not
be enabled. So the output of the 567-tone decoder will be a logic high signal. If
obstacle comes in front of the sensors, the IR signal will be reflected back which
will be observed by the IR receiver and feeds the signal to the tone decoder,
which checks the frequency with the generated ones and as both of them match
the output will be enabled by which the internal will be in ON state and the supply
will be grounded internally in the IC. So a logic low signal will be received from
the output of the 567-tone decoder IC. And to indicate whether the output of the
sensing circuit is a logic low signal or a logic high signal, a LED is connected at
the output pin of the 567-tone decoder IC. If the output is high LED will be in ON
state and LED will be in OFF state if the output is low.
ZIGBEE TECHNOLOGY
Here for wireless communication purpose we use Zigbee technology.
ZigBee is a wireless technology developed as an open global standard to
address the unique needs of low-cost, low-power, wireless sensor networks.
Zigbee is the set of specs built around the IEEE 802.15.4 wireless protocol.
As Zigbee is the upcoming technology in wireless field, we had tried to
demonstrate its way of functionality and various aspects like kinds, advantages
and disadvantages using a small application of controlling the any kind of
electronic devices and machines. The Zigbee technology is broadly adopted for
bulk and fast data transmission over a dedicated channel.
After the birth of wireless LAN and Bluetooth, new International shortdistance wireless standard technology of ZigBee has applied rapidly in our life
and recognized as core technology to bring Ubiquitous life in near future.
Overview
Introduction
(sensor
and
control)
and
short-distance
wireless
communication.
ZigBee is one of short-distance wireless communication standard IEE
802.15.4 used for wireless networking range of 10~20 meters mainly by
home and offices and International wireless communication standard for
Ubiquitous computing.
Origin of word
Word ZigBee was originated from word ZigZag indicating cross-shaped
network cables and Bee to indicate economical communication method.
Word ZigBee was proposed and decided by committee members in early phase
of standard committee of ZigBee.
Introduction and characteristics
ZigBee consumes low electricity supply and can be configured to large
scale sensor networks by integrating with sensor (Activity, light, temperature and
humidity, etc) and transmitter/receiver devices. This type of structure is defined
as foundation technology for sensing, monitoring and controlling.
Applicable fields
ZigBee, unlike other wireless communication technology, consumes low
electricity power and inexpensive to implement. These advantages allow to be
applied diverse Ubiquitous environments including intelligent home networks,
automated commercial devices, building automation industry, commercial
automation, environment monitoring, toy and industries and telematics.
Microcontroller unit
The entire system described here utilizes two microcontroller units and
these units are playing dominant role in this project work. The main processing
unit is designed with 89C51, as this controller is having 4 Kb memory the main
program is dumped in to this chip. The data acquired from this module is
transmitted to the other controller through wireless technology Zigbee.
So the roles of microcontrollers are increasingly being used to implement
in communication systems. It is therefore important to understand Microcontroller
based systems well. Today, microcontrollers have become an integral part of all
digital communication systems. Dedicated system that use microcontrollers, have
certainly
improved
the
functional,
operational
and
performance
based
The controller used here is belongs to 8051 family architecture & often it is
referred to as MCS-51. This microcontroller is having an 8-bit data bus. In this
family some of the controllers are capable of addressing 64K of program memory
and a separate 64K of data memory. The 8051 has 4K of code memory
implemented as on-chip Read Only Memory (ROM). The 8051 has 128 bytes of
internal Random Access Memory (RAM). The 8051 has two timer/counters, a
serial port, 4 general purpose parallel input/output ports, and interrupt control
logic with five sources of interrupts. Besides internal RAM, the 8051 has various
Special Function Registers (SFR), which are the control and data registers for
on-chip facilities. The SFRs also include the accumulator, the B register, and the
Program Status Word (PSW), which contains the CPU flags. Programming the
various internal hardware facilities of the 8051 is achieved by placing the
appropriate control words into the corresponding SFRs.
As stated, the 8051 can address 64K of external data memory and 64K of
external program memory. These may be separate blocks of memory, so that up
to 128K of memory can be attached to the microcontroller. Separate blocks of
code and data memory are referred to as the Harvard architecture. The 8051 has
two separate read signals, RD# and PSEN#. The first is activated when a byte is
to be read from external data memory, the other, from external program memory.
Both of these signals are so-called active low signals. That is, they are cleared to
logic level 0 when activated. All external code is fetched from external program
memory. In addition, bytes from external program memory may be read by
special read instructions such as the MOVC instruction. There are separate
instructions to read from external data memory, such as the MOVX instruction.
That is, the instructions determine which block of memory is addressed, and the
corresponding control signal, either RD# or PSEN# is activated during the
memory read cycle. A single block of memory may be mapped to act as both
data and program memory. This is referred to as the Von Neumann1 architecture.
In order to read from the same block using either the RD# signal or the PSEN#
signal, the two signals are combined with a logic AND operation. This way, the
output of the AND gate is low when either input is low. The advantage of the
Harvard architecture is not simply doubling the memory capacity of the
microcontroller. Separating program and data increases the reliability of the
microcontroller, since there are no instructions to write to the program memory. A
ROM device is ideally suited to serve as program memory. The Harvard
architecture is somewhat awkward in evaluation systems, where code needs to
be loaded into program memory. By adopting the Von Neumann architecture,
code may be written to memory as data bytes, and then executed as program
instructions.
The 8052 has 256 bytes of internal RAM and 8K of internal code ROM.
The 8051 and 8052 internal ROM cannot be programmed by the user. The user
must supply the program to the manufacturer, and the manufacturer programs
the microcontrollers during production. Due to the setup costs, the factory
masked ROM option is not economical for small quantity productions. The 8751
and 8752 are the Erasable Programmable Read Only Memory (EPROM)
versions of the 8051 and 8052. Many manufacturers offer the EPROM versions
in windowed ceramic and non-windowed plastic packages. These are user
programmable. However, the non-windowed versions cannot be erased. These
are usually referred to as One-Time- Programmable (OTP) microcontrollers,
which are more suitable for experimental work or for small production runs. The
8951 and 8952 contain FLASH EEPROMs (Electrically Erasable Programmable
Read Only Memory). These chips can be programmed as the EPROM versions,
using a chip programmer. Moreover, the memory may be erased. Similar to
EPROMs, Erasing FLASH memory sets all data bits (data bytes become FFh). A
bit may be cleared (made 0) by programming. However, a zero bit may not be
programmed to a one. This requires erasing the chip. Some larger FLASH
memories are organized in banks or sectors. Rather than erasing the entire chip,
you may erase a given sector and keep the remaining sectors unchanged.
During the past decade, many manufacturers introduced enhanced
members of the 8051 microcontroller. The enhancements include more memory,
more ports, analog to - digital converters, more timers with compare, reload
and capture facilities, more interrupt sources, higher precision multiply and divide
units, idle and power down mode support, watchdog timers, and network
communication subsystems. All microcontroller of the family use the same set of
machine instructions, the MCS-51. The enhanced features are programmed and
controlled by additional SFRs. In the remainder of this chapter, the hardware
architecture of the 8051 is presented. The enhancements brought by the 8052
and 80C515 follow. The reader is referred to the manufacturers' data books for
the specifics of other enhanced members.
LCD DISPLAY
The LCD panel used in the project work is aimed to display the information
that is generated by the PC keyboard. The LCD used here is having two rows
and each row contains 16 characters, depending up on the availability of LCD
panel 3 lines or 4 lines panels can be used for the purpose, so that more
information can be displayed simultaneously. LCD Displays are dominating LED
displays, because these displays can display alphabets, numbers and some kind
of special symbols, where as LEDs (seven segment display) can display only
numbers. These LCD displays are very useful for displaying user information and
communication. LCD displays are available in various formats. Most common
are 2 x 16, is that two lines with 16 alphanumeric characters. Other formats are
3x16, 2x40, 3x40 etc;
The following is the circuit diagram of LCD that is interfaced with 89C51
microcontroller.
Pin No.
Name
Description
Pin no. 1
D7
Pin no. 2
D6
Pin no. 3
D5
Pin no. 4
D4
Pin no. 5
D3
Pin no. 6
D2
Pin no. 7
D1
Pin no. 8
D0
Pin no. 9
EN1
Pin no. 10
R/W
RS
0 = Instruction input
1 = Data input
Contrast adjust
Not Connected
Vcc, Vss, and VEE: While Vcc and Vss provide +5V and ground,
respectively; VEE is used for controlling LCD contrast.
RS - register select:
There are two very important registers inside the LCD. The RS pin is used
for their selection as follows. If RS = 0, the instruction command code register is
selected, allowing the user to send a command such as clear display, cursor at
home, etc. If RS = 1 the data register is selected, allowing the user to send data
to be displayed on the LCD.
R/W - read/write:
R/W input allows the user to write information to the LCD or read
information from it. R/W = 1 when reading; R/W =0 when writing.
E - Enable:
The enable pin is used by the LCD to latch information presented to its
data pins. When data is supplied to data pins, a high to low pulse must be
applied to this pin in order for the LCD to latch in the data present at the data
pins. This pulse must be a minimum of 450 ns wide.
D0 D7: The 8 bit data pins, D0 D7, are used to send information to the
LCD or read the contents of the LCDs internal registers. To display letters and
numbers, we send ASCII codes for the letters A Z, a z, and numbers 0 9 to
these pins while making RS = 1. There are also instructions command codes that
can be sent to the LCD to clear the display or force the cursor to the home
position or blink the cursor. Table below lists the instruction command codes.
DC Motor
DC motors are widely used, inexpensive, small and poweful for their size.
They are most easy to control. One DC motor requires only two singals for its
operation. They are non-polarized, means you can reverse the voltage without
any damage to motor. DC motors have +ve and ve leads. Connecting them to a
DC voltage source moves motor in one direction (clockwise) and by reversing the
polarity, the DC motor will move in opposite direction (counter clockwise). The
maximum speed of DC motor is specified in rpm (rotation per minute). It has two
rpms: no load and loaded. The rpm is reduces when moving a load or decreases
when load increases. Other specifications of DC motors are voltage and current
ratings. Below table shows the specifications of the motor used in the project.
Operating Voltage
12V DC
Operating Current
150 milli
Amps
Speed
30 RPM
DC Motor Specifications
RELAY
A relay is an electrical switch that opens and closes under the control of
another electrical circuit. In the original form, the switch is operated by an
electromagnet to open or close one or many sets of contacts. These contacts
can be either Normally Open (NO), Normally Closed (NC), or changeover contacts. A relay is able to control an output circuit of higher power than
the input circuit, it can be considered to be, in a broad sense, a form of an
electrical
amplifier.
So
relay
can
be
defined
as
an
automatic
applications that require the circuit to remain closed until the relay is
activated.
Change-over contacts control two circuits: one normally-open
contact and one normally-closed contact with a common terminal. It is
also called Form C contact.
The electromagnetic relay, one of mankinds first electrical device, was
used practically in telegraphy as early as 1850. The modern relay, properly
applied, is one of the most simple, effective and dependable component
available. In the majority of instances, it can achieve better reliability at lesser
cost than an equivalent solid-state complex type of relay. The term relay was
used for the first time to describe an invention made by Samuel Morse in 1836.
The device invented by Morse was a Telegraph Amplifying Electromagnetic
Device which enabled a small current flowing in a coil to switch on a large
current in another circuit and thus helped in relay of signals.
OPERATION
The relay used in this project work is electromagnetic relay.
The
CHAPTER 5
embedded application software and has been ratified in late 2004 under IEEE
802.15.4 Wireless Networking Standards.
ZIGBEE is an established set of specifications for wireless personal area
networking (WPAN), i.e., digital radio connections between computers and
related devices. This kind of network eliminates use of physical data buses like
USB and Ethernet cables. The devices could include telephones, hand-held
digital assistants, sensors and controls located within a few meters of each other.
ZIGBEE is one of the global standards of communication protocol
formulated by the relevant task force under the IEEE 802.15 working group. The
fourth in the series, WPAN Low Rate/ZIGBEE is the newest and provides
specifications for devices that have low data rates, consume very low power and
are thus characterized by long battery life.
Other standards like Blue tooth and IrDA address high data rate
applications such as voice, video and LAN communications.
The ZIGBEE Alliance has been set up as an association of companies
working together to enable reliable, cost-effective, low-power, wirelessly
networked, monitoring and control products based on an open global standard.
Once a manufacturer enrolls in this Alliance for a fee, he can have access
to the standard and implement it in his products in the form of ZIGBEE chipsets
that would be built into the end devices. Philips, Motorola, Intel, HP are all
members of the Alliance. The goal is to provide the consumer with ultimate
flexibility, mobility, and ease of use by building wireless intelligence and
capabilities into every day devices.
Architecture
Though WPAN implies a reach of only a few meters, 30 feet in the case of
ZIGBEE, the network will have several layers, so designed as to enable
interpersonal communication within the network, connection to a network of
higher level and ultimately an uplink to the Web.
The ZIGBEE Standard has evolved standardized sets of solutions, called
layers'. These layers facilitate the features that make ZIGBEE very attractive:
low cost, easy implementation, reliable data transfer, short-range operations,
Very low power consumption and adequate security features.
Device Types
There are three different ZIGBEE device types that operate on these layers
in any self-organizing application network. These devices have 64-bit IEEE
addresses, with option to enable shorter addresses to reduce packet size, and
work in either of two addressing modes star and peer-to-peer.
The ZIGBEE coordinator node: There is one, and only one, ZIGBEE
coordinator in each network to act as the router to other networks, and can
be likened to the root of a (network) tree. It is designed to store information
about the network.
The full function device FFD: The FFD is an intermediary router
transmitting data from other devices. It needs lesser memory than the
ZIGBEE coordinator node, and entails lesser manufacturing costs. It can
operate in all topologies and can act as a coordinator.
The reduced function device RFD: This device is just capable of talking in
the network; it cannot relay data from other devices. Requiring even less
memory, (no flash, very little ROM and RAM), an RFD will thus be cheaper
than an FFD. This device talks only to a network coordinator and can be
implemented very simply in star topology.
Zigbee Characteristics
The focus of network applications under the IEEE 802.15.4 / ZIGBEE
standard include the features of low power consumption, needed for only two
major modes (Tx/Rx or Sleep), high density of nodes per network, low costs and
simple implementation.
2.4GHz and 868/915 MHz dual PHY modes. This represents three licensefree bands:
2.4- 2.4835 GHz, 868-870 MHz and 902-928 MHz The number of channels
allotted to each frequency band is fixed at sixteen (numbered 11-26), one
(numbered 0) and ten (numbered 1-10) respectively.
The higher frequency band is applicable worldwide, and the lower band in the
areas of North America, Europe, Australia and New Zealand.
Low power consumption, with battery life ranging from months to years.
Considering the number of devices with remotes in use at present, it is easy
to see that more numbers of batteries need to be provisioned every so often,
entailing regular (as well as timely), recurring expenditure.
In the ZIGBEE standard, longer battery life is achievable by either of two
means: continuous network connection and slow but sure battery drain, or
intermittent connection and even slower battery drain.
Maximum data rates allowed for each of these frequency bands are fixed as
250 kbps @2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868MHz.
High throughput and low latency for low duty-cycle applications (<0.1%)
Channel access using Carrier Sense Multiple Access with Collision
Avoidance
(CSMA - CA)
Addressing space of up to 64 bit IEEE address devices, 65,535 networks
50m typical range
Fully reliable hand shaked data transfer protocol.
Different topologies as illustrated below: star, peer-to-peer, mesh
Traffic Types
ZIGBEE /IEEE 802.15.4 addresses three typical traffic types. IEEE
802.15.4 MAC can accommodate all the types.
Data is periodic is The application dictates the rate, and the sensor
activates, checks for data and deactivates.
Data is intermittent is The application, or other stimulus, determines the
rate, as in the case of say smoke detectors. The device needs to connect to
the network only when communication is necessitated. This type enables
optimum saving on energy.
Data is repetitive, and the rate is fixed a priori. Depending on allotted time
slots, called GTS (guaranteed time slot), devices operate for fixed
durations.
ZIGBEE employs either of two modes, beacon or non-beacon to enable
the to-and-fro data traffic. Beacon mode is used when the coordinator runs on
batteries and thus offers maximum power savings, whereas the non-beacon
mode finds favor when the coordinator is mains powered. In the beacon mode, a
device watches out for the coordinator's beacon that gets transmitted at
periodically, locks on and looks for messages addressed to it.
If message transmission is complete, the coordinator dictates a schedule
for the next beacon so that the device goes to sleep'; in fact, the coordinator
itself switches to sleep mode.
Network Model
Technology Comparisons
The Why ZIGBEE question has always had an implied, but never quite
worded follower phrase when there is Blue tooth. A comparative study of the
two can be found in ZIGBEE 'Wireless Control That Simply Works.
The bandwidth of Blue tooth is 1 Mbps; ZIGBEE is one-fourth of this value.
The strength of Blue tooth lies in its ability to allow interoperability and
replacement of cables, ZIGBEE, of course, is low costs and long battery life.
ZIGBEE Applications
The ZIGBEE Alliance targets applications "across consumer, commercial,
industrial and government markets worldwide".
Unwired applications are highly sought after in many networks that are
characterized by numerous nodes consuming minimum power and enjoying long
battery lives.
CHAPTER 6
INTRODUCTION
A Micro controller consists of a powerful CPU tightly coupled with memory,
various I/O interfaces such as serial port, parallel port timer or counter, interrupt
controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog
converter, integrated on to a single silicon chip. If a system is developed with a
microprocessor, the designer has to go for external memory such as RAM, ROM,
EPROM and peripherals.
But controller is provided all these facilities on a single chip. Development
of a Micro controller reduces PCB size and cost of design. One of the major
differences between a Microprocessor and a Micro controller is that a controller
often deals with bits not bytes as in the real world application.
Intel has introduced a family of Micro controllers called the MCS-51.The
microcontroller plays the major role in any embedded project. In this my project
we use two microcontrollers they are made by the ATMEL Company. That is
AT89S52.
NECESSITY OF MICROCONTROLLERS
Microprocessors brought the concept of programmable devices and
made many applications of intelligent equipment. Most applications, which do not
need large amount of data and program memory, tended to be costly.
size of PCB will be large enough to hold all the required peripherals. But, the
micro controller has got all this peripheral facility on a single chip o development
of a similar system with a micro controller reduces PCB size and cost of the
design.
2. One of the major differences between a micro controller and a microprocessor
is that a controller often deals with bits, not bytes as in the real world application,
for example switch contacts can only be open or close, indicators should be lit or
dark and motors can be either turned on or off and so forth.
The system requirements and control specifications clearly rule out the use
of 16, 32 or 64 bit micro controllers or microprocessors. Systems using these
may be earlier to implement due to large number of internal features. They are
also faster and more reliable but, the above application is satisfactorily served by
8-bit micro controller. Using an inexpensive 8-bit Microcontroller will doom the 32bit product failure in any competitive market place.
Coming to the question of why to use P89V51RD2 of all the 8-bit
Microcontroller available in the market the main answer would be because it has
64 kB Flash and 1024 bytes of data RAM. . The Flash program memory supports
both parallel programming and in serial In-System Programming (ISP). The
P89V51RD2 is also In-Application Programmable (IAP), allowing the Flash
program memory to be reconfigured even while the application is running.
The generic 8051 architecture supports a Harvard architecture, which
contains two separate buses for both program and data. So, it has two distinctive
memory spaces of 64K X 8 size for both programmed and data.
It is based on an 8 bit central processing unit with an 8 bit Accumulator
and another 8 bit B register as main processing blocks. Other portions of the
architecture include few 8 bit and 16 bit registers and 8 bit memory locations.
PIN DIAGRAM
Alternate Function
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
The heart of the 8051 circuitry that generates the clock pulses by which all
the internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is
provided for connecting a resonant network to form an oscillator. Typically a
quartz crystal and capacitors are employed. The crystal frequency is the basic
internal clock frequency of the microcontroller. The manufacturers make 8051
designs that run at specific minimum and maximum frequencies typically 1 to 16
MHz.
Types of memory
The 8051 have three general types of memory. They are on-chip memory,
external Code memory and external Ram. On-Chip memory refers to physically
existing memory on the micro controller itself. External code memory is the code
memory that resides off chip. This is often in the form of an external EPROM.
External RAM is the Ram that resides off chip. This often is in the form of
standard static RAM or flash RAM.
Code memory
Code memory is the memory that holds the actual 8051 programs that is to
be run. This memory is limited to 64K. Code memory may be found on-chip or
off-chip. It is possible to have 4K of code memory on-chip and 60K off chip
memory simultaneously. If only off-chip memory is available then there can be
64K of off chip ROM. This is controlled by pin provided as EA.
Internal RAM
The 8051 have a bank of 128 bytes of internal RAM. The internal RAM is
found on-chip. So it is the fastest Ram available. And also it is most flexible in
terms of reading and writing. Internal Ram is volatile, so when 8051 is reset, this
memory is cleared. 128 bytes of internal memory are subdivided. The first 32
bytes are divided into 4 register banks. Each bank contains 8 registers. Internal
RAM also contains 128 bits, which are addressed from 20h to 2Fh. These bits
are bit addressed i.e. each individual bit of a byte can be addressed by the user.
They are numbered 00h to 7Fh. The user may make use of these variables with
commands such as SETB and CLR.
B register (0F0h)
The B register is very similar to accumulator. It may hold 8-bit value. The b
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the product gets stored in B register. In div AB the quotient gets stored in
B with the remainder in A.
Data pointer
The SFRs DPL and DPH work together work together to represent a 16-bit
value called the data pointer. The data pointer is used in operations regarding
external RAM and some instructions code memory. It is a 16-bit SFR and also
an addressable SFR.
Program counter
The program counter is a 16 bit register, which contains the 2 byte
address, which tells the 8051 where the next instruction to execute to be found
in memory. When the 8051 is initialized PC starts at 0000h. And is incremented
each time an instruction is executes. It is not addressable SFR.
The power control SFR is used to control the 8051s power control modes.
Certain operation modes of the 8051 allow the 8051 to go into a type of sleep
mode which consumes much less power.
PCON
REGISTER
TCON REGISTERS
TMOD
to a bit of this SFR will send a high level on the corresponding I/O pin whereas a
value of 0 will bring it to low level.
IE Registers
IP registers
PSW registers
SBUF (Serial Buffer, 99h)
SBUF is used to hold data in serial communication. It is physically two
registers. One is writing only and is used to hold data to be transmitted out of
8051 via TXD. The other is read only and holds received data from external
sources via RXD. Both mutually exclusive registers use address 99h.
I/O Ports
One major feature of a microcontroller is the versatility built into the
input/output (I/O) circuits that connect the 8051 to the outside world. The main
constraint that limits numerous functions is the number of pins available in the
8051 circuit. The DIP had 40 pins and the success of the design depends on the
flexibility incorporated into use of these pins. For this reason, 24 of the pins may
each used for one of the two entirely different functions which depend, first, on
what is physically connected to it and, then, on what software programs are used
to program the pins.
PORT 0
Port 0 pins may serve as inputs, outputs, or, when used together, as a bi
directional low-order address and data bus for external memory. To configure a
pin as input, 1 must be written into the corresponding port 0 latch by the program.
When used for interfacing with the external memory, the lower byte of address is
first sent via PORT0, latched using Address latch enable (ALE) pulse and then
the bus is turned around to become the data bus for external memory.
PORT 1
Port 1 is exclusively used for input/output operations. PORT 1 pins have
no dual function. When a pin is to be configured as input, 1 is to be written into
the corresponding Port 1 latch.
PORT 2
Port 2 maybe used as an input/output port. It may also be used to supply
a high order address byte in conjunction with Port 0 low-order byte to address
external memory. Port 2 pins are momentarily changed by the address control
signals when supplying the high byte a 16-bit address. Port 2 latches remain
PORT 3
Port 3 may be used to input /output port. The input and output functions
can be programmed under the control of the P3 latches or under the control of
various special function registers. Unlike Port 0 and Port 2, which can have
external addressing functions and change all eight-port b se, each pin of port 3
maybe individually programmed to be used as I/O or as one of the alternate
functions. The Port 3 alternate uses are:
Port 3 Alternate Uses
Pin (SFR)
Alternate Use
P3.0-RXD (SBUF)
P3.1-TXD (SBUF)
P3.2-INTO 0 (TCON.1)
External interrupt 0
External interrupt 1
P3.4 - T0 (TMOD)
P3.5 T1 (TMOD)
P3.6 - WR
P3.7 - RD
INTERRUPTS
Interrupts are hardware signals that are used to determine conditions that
exist in external and internal circuits. Any interrupt can cause the 8051 to perform
a hardware call to an interrupt handling subroutine that is located at a
predetermined absolute address in the program memory.
Five interrupts are provided in the 8051. Three of these are generated
automatically by the internal operations: Timer flag 0, Timer Flag 1, and the serial
port interrupt (RI or TI) Two interrupts are triggered by external signals provided
by the circuitry that is connected to the pins INTO 0 and INTO1. The interrupts
maybe enable or disabled, given priority or otherwise controlled by altering the
bits in the Interrupt Enabled (IE) register, Interrupt Priority (IP) register, and the
Timer Control (TCON) register. . These interrupts are mask able i.e. they can be
disabled. Reset is a non maskable interrupt which has the highest priority. It is
generated when a high is applied to the reset pin. Upon reset, the registers are
loaded with the default values.
Each interrupt source causes the program to do store the address in PC
onto the stack and causes a hardware call to one of the dedicated addresses in
the program memory. The appropriate memory locations for each for each
interrupt are as follows:
Interrupts
Interrupt
Address
RESET
0000
000B
001B
SERIAL
0023
CHAPTER 7
As seen from the above figure, Pins from 7 to 14 are data pins used for the
selection of a particular character and pins 4 to 6 are Control signal pins used for
performing Register bank selection, Read / Write and Enable pins respectively.
By adjusting the voltage at pin number 3 we can change the contrast of the
display. To display a particular character its associated logic sequence has to be
placed on the data pins and write signal (Pin-6) has to be enabled.
Microcontroller takes care of all these things based on the program loaded into it.
In the receiving end, Microcontroller places the logic sequence on the data pins
based on the information obtained from the decoder output.
The function of each pin is given in the following table.
Pin
Symbol
I/O
Description
Vss
--
Ground
Vcc
--
VEE
--
RS
RS = 0 to select command
R/W
I/O
Enable
DB0
I/O
DB1
I/O
DB2
I/O
10
DB3
I/O
11
DB4
I/O
12
DB5
I/O
13
DB6
I/O
14
DB7
I/O
In the above table Vcc and Vss are supply pins and VEE (Pin no.3) is used
for controlling LCD contrast. Pin No.4 is Rs pin for selecting the register, there
are two very important registers are there inside the LCD. The RS pin is used for
their selection as follows. If RS = 0, the instruction command code register is
selected, allowing the user to send a command such as clear display. If RS=1,
the data register is selected, allowing the user to send data to be displayed on
the LCD.
R/W is a read or writes Pin, which allows the user to write information to the
LCD or read information from it. R/W=1 when reading, R/W=0 when writing. The
enable (E) pin is used by the LCD to latch information presented to its data pins.
When data is supplied to data pins, a high to-low pulse must be applied to this
pin in order for the LCD to latch in the data present at the data pins. This pulse
must be a minimum of 450 ns wide.
The 8-bit data pins, D0-D7, are used to send information to the LCD or read
the contents of the LCDS internal registers. To display letters and numbers, we
must send ASCII (Antenna Standard Code for Information Inter Change,
Pronounced ask E) codes for the letters A Z, and numbers 0 - 9 to these
pins while making RS=1.
In recent years the LCD panels became very popular because of their
widespread use in various electronic systems like instruments to read the
parameter values, digital communications for sending or receiving the text
information, data acquisition systems, etc. These display units dominating seven
segment displays by providing more features to the user. The LCD system can
display numbers, characters, and graphics, where as seven segments LEDs
displays only numbers, therefore most of the engineers prefers LCDs. The data
fed to the LCD remains as it is and the same will be displayed until it gets an
erase signal from the controller. The data can be stored and it can be refreshed
for the next task.
The instruction command codes from microcontroller can be sent to the
LCD to clear the display, depending up on the command the cursor can be
brought to home position or blink the cursor. The LCD is having two important
resistors internally, command resistor and data register; RS pin is used to select
either command register or data register. If RS = 0, the instruction command
code register is selected and allowing the user to send a command to clear the
display. If RS = 1 the data register is selected, there by the user is allowed to
Code
Return home
10
14
18
IC
80
CO
38
To send any commands from instruction command code table to the LCD,
make RS pin to zero. For data, feed high signal to RS pin, then send a high to
low pulse to the E pin to enable the internal latch of the LCD. For this, the
suitable program is to be prepared for LCD connections. Another suitable
program is to be prepared for sending code to the LCD with checking busy flag.
Depending up on the program the busy flag can be D7 of the command resistor,
to read command register R/W pin must be high and RS pin must be low, and a
low to high pulse for the enable pin will provide the command register. After
reading the command register, if bit D7 (busy flag) is high, the LCD is busy and
no information (either command or data) should be issued to it. During D7 is
zero; at that time we can send data or commands to the LCD. In this method time
delays are not required in the program, because we are checking the busy flag
before issuing commands to the LCD. Enable line must be negative-edge
triggered for the write and it should be positive-edge triggered for the read.
CHAPTER 8
In a color display, after the light passes through the liquid crystal matrix, it
passes through a color filter (usually glass). This filter blocks all wavelengths of
light except those within the range of that pixel. In a typical RGB display, the
color filter is integrated into the upper glass colored microscopically to render
each individual pixel either red, green or blue. The areas in between the colored
pixel filter areas are printed black to increase contrast. After a beam of light
passes through the color filter, it passes through yet another polarizer to sharpen
the image and eliminate glare. The image is then available for viewing.
Direct addressing, usually used in watches and calculators, is great for simple
alphanumeric characters, since one signal controls many segments. However,
direct addressing is not realistic for larger systems due to the interfacing difficulty
the large number of wires would present. In a multiplexed interface, the number
of wires can be greatly reduced because one wire can be "shared" by several
pixels through a "matrix" wiring scheme. Multiplex addressing is similar to active
matrix, where a separate signal is sent to each pixel. The display is split up into a
grid of "wires", with cross- points at each pixel. The only difference between the
two addressing schemes (multiplex and active matrix) is in the charge storage.
Multiplex stores no charge at each pixel. Active addressing, however, frequently
refreshes each pixel to "store" the charge, allowing displays to show real- time
video in larger screens than multiplex addressing. TFT displays use active matrix
addressing. (Sarif Primer 1)
There are many advantages to the active matrix (AM) approach. The first
AM display was invented by Lechner et al. in 1971 to circumvent an inherent
problem in passive-matrix displays - their contrast decreases with increased
resolution (Yaniv). In addition to solving this problem, AMLCDs virtually eliminate
an effect known to many users of PMLCDs as "ghosting". This happens when the
display is expected to refresh its output faster than it is able, leaving "ghost"
images on the screen. Although this effect is a mere annoyance in some
systems, todays laptop computers are often expected to play full- motion MPEG
video, and "ghosting" would all but destroy the quality of playback. Faster video
speed is desireable in virtually all LCD applications including laptop computers,
integrated systems, and is perhaps most important in the development of a flatpanel TV.
Manufacturing and Display Configurations
A 16 Character x 2 Line LCD Module to the Parallel Port. These LCD Modules
are very common these days, and are quite simple to work with, as all the logic
required running them is on board.
Schematic
Circuit Description
Above is the quite simple schematic. The LCD panel's Enable and
Register Select is connected to the Control Port. The Control Port is an open
collector / open drain output. While most Parallel Ports have internal pull-up
resistors, there are a few which don't. Therefore by incorporating the two 10K
external pull up resistors, the circuit is more portable for a wider range of
computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore
we hard wire the R/W line of the LCD panel, into write mode. This will cause no
bus conflicts on the data lines. As a result we cannot read back the LCD's
internal Busy Flag, which tells us if the LCD has accepted and finished
processing the last instruction. This problem is overcome by inserting known
delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I've left the power supply out. You can use a
bench power supply set to 5v or use a onboard +5 regulator. Remember a few
de-coupling capacitors, especially if you have trouble with the circuit working
properly.
The 2 line x 16 character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to
test this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which
was extracted from a Poker Machine! The diagram to the right shows the pin
numbers for these devices. When viewed from the front, the left pin is pin 14 and
the right pin is pin 1.
CHAPTER 9
RELAYS AND THEIR APPLICATIONS
The electromagnetic relay, one of mankinds first electrical device, was
used practically in telegraphy as early as 1850. The modern relay, properly
applied, is one of the most simple, effective and dependable component
available. In the majority of instances, it can achieve better reliability at lesser
cost than an equivalent solid-state complex type of relay.
The term relay was used for the first time to describe an invention made
by Samuel Morse in 1836. The device invented by Morse was a Telegraph
Amplifying Electromagnetic Device which enabled a small current flowing in a
coil to switch on a large current in another circuit and thus helped in relay of
signals.
A relay is a device that opens or closes an auxiliary circuit under some
predetermined condition in the main circuit. The object of a relay is generally to
act as a sort of electric magnifier, that is to say, it enables a comparatively weak
current to bring into operation a much stronger current. It also provides complete
electrical isolation between the controlling circuit and the controlled circuit.
Relays are widely used in industry. Railroads, pipelines and heavy-duty
signaling operations have relied for many years to handle their automatic and
remote control problems. Most of the traffic control signals on our streets use
relays. Telephone, telegraph and telemetry systems depend on relays to provide
circuit selection and switching. Complete automatic and many semi-automatic
control processes in industrial plants use relays extensively. In computer circuit,
They
have been developed to meet a wide range of requirements. A relay, when used
properly under good climatic conditions, can have a very long life. Under other
conditions, it can give considerable trouble.
The relays used in this project work are electromagnetic relays. The
electromagnetic relay is basically a switch (or a combination of switches)
operated by the magnetic force generated by a current flowing through a coil.
Essentially, it consists of four parts an electromagnet comprising a coil and a
magnetic circuit, a movable armature, a set of contacts, and a frame to mount all
these components. However, very wide ranges of relays have been developed to
meet the requirements of the industry.
This relay is nothing but a switch, which operates electro-magnetically. It
opens or closes a circuit when current through the coil is started or stopped.
When the coil is energized armature is attracted by the electromagnet and the
contacts are closed. That is how the power is applied to the signals (indicators).
The construction of the typical relay contains a code surrounded by a coil
of copper wire. The core is mounted on a metal frame. The movable part of the
relay is called armature. When a voltage is applied to the coil terminals, the
current flowing through the coil produces a magnetic field in the core. In other
words, the core acts as an electromagnet and attracts the metal armature. When
the armature is attracted to the core, the magnetic path is from the core through
armature, through the frame, and back to the core. On removing the voltage the
spring attached to the armature returns the armature to its original position. In
this position, there is a small air-gap in the magnetic path. Hence, more power is
needed to pull in the armature than that needed to keep it held in the attracted
position.
The relay contacts and the terminals are mounted on an insulated board.
When no current flows through the relay coil, the contact arm, or pole as it is
called, mounted on the armature, touches the top contact.
energized by flow of current, the armature along with the contact arm assembly
moves downwards so that the contact arm touches the bottom contact.
When an electric current is flowing through a relay coil, it is said to be
energized, and when the current flow stops, the relay is said to be de-energized.
They have a set of parallel contacts, which are all pulled in when the
electromagnet pulls in the armature. On being energized, whether a relay makes
contact(s) or breaks them depends on the design of contact arrangements.
Though the contacts are open or close simultaneously, the sequence of
operation cannot be guaranteed in this of construction.
To have a definite
RELAY CHARACTERSTICS
A relay is a device that opens or closes an auxiliary circuit under
predetermined condition in the main circuit. The object of a relay is generally to
act as a sort of electrical magnifier; that is to say, it enables a comparatively
weak current to bring into operation a much stronger current. It also provides
complete electrical isolation between the controlling circuit and the controlled
circuit.
CHAPTER 10
Keil Software
Keil development tools for the 8051 Microcontroller Architecture support
every level of software developer from the professional applications engineer to
the student just learning about embedded software.
The industry-standard Keil C Compilers, Macro Assemblers, Debuggers,
Real-time Kernels, Single-board Computers, and Emulators support all 8051
derivatives and help you get your projects completed on schedule.
Simulation
The Vision Simulator allows you to debug programs using only your PC
using simulation drivers provided by Keil and various third-party developers. A
good simulation environment, like Vision, does much more than simply simulate
the instruction set of a microcontroller it simulates your entire target system
including interrupts, startup code, on-chip peripherals, external signals, and I/O.
Next the source code needs to be translated into instructions the micro
controller can actually execute. A microcontrollers instruction set is represented
by "op codes". Op codes are unique sequences of bits ("0" and "1") that are
decoded by the controller's instruction decode logic and then executed. Instead
of writing op-codes in bits, they are commonly represented as hexadecimal
numbers, whereby one hex number represents 4 bits within a byte, so it takes
two hex numbers to represent 8 bits or 1 byte. For that reason a micro
controllers firmware in Machine-readable form is also called Hex-Code and the
file that stores that code Hex-File.
Debugging the Code
A debugger is a piece of software running on the PC, which has to be
tightly integrated with the emulator that you use to validate your code. For that
reason all emulator manufacturers ship their own debugger software with their
tools, but also compiler manufacturers frequently include debuggers, which work
with certain emulators, into their development suites.
ADVANTAGES
1. One of the advantages of an embedded system is to decrease power
consumption and space.
2. All embedded systems that are based on micro controller have low power
consumption in addition to some form of I/O, COM port and ROM all on a
single chip.
CHIP BURNING PROCESS
The process of chip burning depends up on the compiler kit, the CA51
Compiler Kit for the 8051 micro controller family supports all 8051 derivatives
including those from
C51 C Compiler
The Keil C51 C Compiler for the 8051 micro controller is the most popular
8051 C compiler in the world. It provides more features than any other 8051 C
compiler available today.
The C51 Compiler allows you to write 8051 micro controller applications in
C that have the efficiency and speed of assembly language. Language
extensions in the C51 Compiler give you full access to all resources of the 8051.
C51 translates C source files into a re-locatable object module. When the
DEBUG control is used, the object file contains full symbolic information for
debugging with the Vision3 Debugger or an in-circuit emulator. In addition to the
object file, the C51 Compiler generates a listing file, which optionally may include
symbol table and cross-reference information.
Features
Flexible variable allocation with bit, data, bdata, idata, xdata, and pdata
memory types
Support
for
dual
data
pointers
on
Atmel,
AMD,
Cypress,
Dallas
Support for the Philips 8xC750, 8xC751, and 8xC752 limited instruction sets
Vision3 IDE
The Vision3 IDE from Keil Software combines project management; make
facilities, source code editing, program debugging, and complete simulation in
one powerful environment. Vision3 helps you get programs working faster than
ever while providing an easy-to-use development platform. The editor and
debugger are integrated into a single application and provide a seamless
embedded project development environment.
Vision3 features include:
The Device Database, which automatically sets the assembler, compiler, and
linker options for the chip, you select. This prevents you from wasting your
time configuring the tools and helps you get started writing code faster.
Intel HEX files are ASCII files that contain a hexadecimal representation of
your program. They easily may be loaded into a device programmer for writing
EPROMs or other memory devices.
KEIL Compiler
It's very easy to work with Keil if you know how to write the programs in c or
assembly language. The basic steps to compile and run a program in
assembly language:
1. Open the Keil
2. Open project window and then select a new project and save it by any name
like exam1.
3.
Now
"select
device
for
target
'target1'
"
window
will
appear.
Select the name of the chip vendor (Intel, Philips, Siemens, etc.) in the Vendor
box. Select the device family from the drop down menu in the Family box.
Enter the part number for the device in the Device box. I select ATMEL, after
clicking on Atmel it will give device no. I select AT89C51.
4. Now in "project workspace"(window on the left side), target1 will appear. Click
on target1, source group1 will appear.
5. Open new file and write a program in assembly. Save it with .asm (like
'exam.asm').
6. Now right click on the "source group1. Select "add files to group 'source
group1' "
7. Give the file name like 'exam.asm and add it and close that window. Again left
click on the source group1; you can see the added file.
8. Right click on this added file and select build target. By this you can compile
your program. Check the output window. If youre pro is compiled properly
then go to 'Debug'.
9. Select 'start/stop debug session'.
10. In project workspace you can see how your program is running.
11. Again go to 'Debug' and see F11 is there for running your program step-bystep.
12. Press F11 or F5.
13. Again go to Debug and select 'start/stop debug session' to stop the program.
CHAPTER 11
HARDWARE DETAILS
The ICs and other important components used in this project work,
procured from the Hyderabad Electronics Market. The details or data sheets of
the ICs are down loaded from the Internet. The following are the web sites that
can be browsed for collecting the data sheets.
1.
2.
3.
The required PCBS (Printed Circuit boards) for the project work fabricated
by SUN RISE CIRCUITS, Kushaiguda Industrial Estate, Hyderabad. Kushaiguda
Industrial Estate is very famous for fabricating the Industrial grade PCBs.
CHAPTER 12
CONCLUSION
REFERENCES:
The following are the references made during the development of this
project work.
Text Books:
1. Linear Integrated Circuits By: D. Roy Choudhury, Shail Jain
2. Digital Electronics. By JOSEPH J.CARR
3. Digital and Analog Communication System By: K. sam Shanmugam
4. Communication - Four-Wire, Resistive-Type Touch Screen with USB
Interface by SVYATOSLAV PALIY.
5. System level solutions Lab manual, a study on Touch Screen by JOHN J
ROVE.
6. The concepts and Features of Micro-controllers - By: Raj Kamal
7. The 8051 Micro-controller Architecture, programming & Applications - By:
Kenneth J. Ayala
8. Programming and Customizing the 8051 Micro-controller - By: Myke
Predko
Catalogs:
(1) TEXAS