rfid based toll tax system with vehicle security
DESCRIPTION
THIS PROJECT CAN BE USED FOR AUTOMATIC TOLL Tax system It can also be used for the security of the vehicleTRANSCRIPT
INTRODUCTION
The need for manual toll based systems is completely reduced in this method and the
tolling system works through RFID. A complete RFID system consists of a transponder
(tag),reader/writer, antenna, and computer host. The transponder, better known as the tag, is a
microchip combined with an antenna system in a compact package. The microchip contains
memory and logic circuits to receive and send data back to the reader.
These tags are classified as either active or passive tags. Active tags have internal
batteries that allow a longer reading range, while passive tags are powered by the signal from
its reader and thus have shorter reading range. Passive RFID have no internal power source
and use external external power to operate.
These tags are powered by the electromagnetic signal received from a reader. The
Received Electromagnetic signal charges an internal capacitor on the tags, which in turn, acts
as a power source and supplies the power to the chip. Though these passive tags have both
UHF and LF, the low
The received electromagnetic signal charges an internal capacitor on the tags, which
in turn, acts as a power source and supplies the power to the chip. Though these passive tags
have both UHF and LF, the low frequency tags are best because UHF tags have high read
range and hence capable of reading multiple tags simultaneously which in turn may lead to
collision. The obvious advantage of the transponder in our project is that it reads only one tag
at a time and hence it is very advantageous compared to all the other previously existing
system.
Why Toll is collected?
Any structure, building or system needs maintenance and rehabilitation which are of
course costly. Highways and roads are also not an exception. From the very past, the
construction, extension, maintenance and operating costs of highways, roads, bridges and
tunnels were collected directly or indirectly. In the older indirect method, the expenses are
compensated either by tax payment on fuel or by budget allocation from the national income.
The shortcoming of this method is that a number of tax payers, who do not use some of the
roads and carriageways, have to pay extra money. However, in the other system, called direct
method, the tolls are taken directly from the drivers passing that road or street. The other
three main reasons why tolling, or road pricing, is implemented are listed below.
1. Finance/Revenue Generation: To recoup the costs of building, operating and
maintaining the facility. Road pricing is becoming a more appealing means of funding
transportation. Moreover, toll financing allows projects to be built sooner instead of waiting
for tax revenues to accumulate.
2. Demand Management: To moderate the growth in demand on the transportation
system, and to encourage more use of public transportation and carpooling. For example,
vehicles are charged to enter inner London, England, as a way of regulating the demand in
the region.
3. Congestion Management: To place a price on limited roadway space in
proportion to demand. In this application the toll increases with the level of congestion. In the
absence of such pricing, drivers do not appreciate the costs they impose on others as a result
of the congestion they cause.
Different types of Toll Collection Systems
Three systems of toll roads exist: open (with mainline barrier toll plazas); closed (with
entry/exit tolls) and all-electronic toll collection (no toll booths, only electronic toll collection
gantries at entrances and exits or at strategic locations on the mainline of the road).
On an open toll system, all vehicles stop at various locations along the highway to pay a toll.
While this may save money from the lack of need to construct tolls at every exit, it can cause
traffic congestion, and drivers may be able to avoid tolls by exiting and re-entering the
highway.
With a closed system, vehicles collect a ticket when entering the highway. In some
cases, the ticket displays the toll to be paid on exit. Upon exit, the driver must pay the amount
listed for the given exit. Should the ticket be lost, a driver must typically pay the maximum
amount possible for travel on that highway. Short toll roads with no intermediate entries or
exits may have only one toll plaza at one end, with motorists traveling in either direction
paying a flat fee either when they enter or when they exit the toll road. In a variant of the
closed toll system, mainline barriers are present at the two endpoints of the toll road, and each
interchange has a ramp toll that is paid upon exit or entry. In this case, a motorist pays a flat
fee at the ramp toll and another flat fee at the end of the toll road; no ticket is necessary.
In an all-electronic system no cash toll collection takes place, tolls are usually
collected with the use of a transponder placed before the Gate as soon as the vehicle reaches
near the Transponder the amount is deducted and the gate will be opened customer account
which is debited for each use of the toll road. On some roads automobiles and light trucks
without transponders are permitted to use the road (though trucks with a gross vehicle weight
over 5,000 kilograms must have a transponder)- a bill for the toll due is then sent to the
registered owner of the vehicle by mail; by contrast, some tollways require all vehicles to be
equipped with a transponder.
Modern toll roads often use a combination of the three, with various entry and exit
tolls supplemented by occasional mainline tolls. Open Road Tolling (ORT), with all-
electronic toll collection, is now the preferred practice, being more efficient, environmentally
friendly, and safer than manual toll collection.
LITERATURE SURVEY
In most advanced countries, ETC systems have evolved from older systems where
many of the existing technologies did not exist. Due to backward compatibility constraints,
implementing ETC models across the country has proved to be a challenge, and sometimes
complicated solutions have evolved to ensure interoperability between systems of different
toll vendors.
India has an advantage as there are no legacy systems in place, and highway
expansion has begun to take off mainly over the last decade .Consequently, there is an
opportunity to built a simple and robust ETC system that leverages modern information and
communication technologies. Presently, Electronic toll collection is used at few toll plazas on
national highways like:
I. Delhi- Gurgaon Highway
II. Bangalore-Electronic City Elevated Highway
I. DELHI-GURGAON HIGHWAY:
The solution introduced on Delhi-Gurgaon Expressway is a multi- tiered processing
ability so as to accommodate the motorists and the processing speeds ensuring little to no
queuing at the Toll Plazas. The acceptance of cash and the introduction of the following cash-
less (Electronic Media to pay Toll) transaction will enable this to be achieved.
Technology: Smart Tag
The Smart Tag allows a motorist to travel non-stop through the toll plaza. It is an
electronic device the size of a computer mouse which is installed in the windscreen behind
the rear view mirror of your vehicle. It is charged with the denomination of your choice and
has the capability of interacting with sensors placed at the toll gates. Which means that all
you have to do is to slow down to 20 Km/hr (you don't have to stop) near the toll gates, the
sensor at the gates interact with your Smart Tag, the transaction is recorded and the toll
deducted, you hear a confirmation beep inside your car and you're off.
All of this takes less than a second and is extremely convenient to commuters and the
best way to do away with waiting periods at the toll gates. Smart tag works like a debit card,
it has no expiry and you can use it till you keep re-charging the amount in your account.
Designated lanes for Smart Tag holders have been created to ensure a seamless drive through.
Any person may apply for a smart tag device who travels on the NH-8. This could include
Motorists , Local residents and local commercial traffic. All you need is a copy of the
registration Certificate of your vehicle and you can register for the Smart Tag at the following
locations as per your convenience:
1. Point of Sale Office at the KM 24 Toll Plaza at the Delhi-Gurgaon Border
2. Point of Sale Office at the KM 42 Toll Plaza near Haldiram on NH 8
3. Point of Sale Office at IGI Airport Toll Plaza
Rules for vehicle with Smart Tag:
The smart tag based ETC implemented at Delhi-Gurgaon Highway is basic model and
works under certain constraints which are mentioned below.[13]
• Tag users are required to proceed only after observing green traffic signal.
• Tag users are required to maintain approx. 2 car length distance while crossing toll
gate.
• Speed of the vehicle should not be more than 15 km while crossing the toll gate.
• Tag is not an authority to move freely without following traffic rules. Being
electronic item there can be instances when the system doesn’t work.
• Don’t move on hearing the beep sound coming out of tag. Look out for a green
Traffic light only.
• Each vehicle will be required to have its own Smart-Tag. If anyone tries to tamper
the device, a tamper switch which is monitored by the system and will result in hot-listing of
the account.
• If there is any problem in the Smart-tag, the consumer should visit the POS and get
the Smart-tag checked. It will be replaced if it has not been tampered with.
• Speed limits in a nonstop Smart Tag lane must be not more than 15 Km/h for the
safety of commuters.
• The same Smart-tag can be used at all the three toll plazas on the Delhi - Gurgaon
Expressway, this Smart-tag can’t be used on any other toll road across the country as DG
Expressway is the only toll road in India which offers Smart-tag technology.
• In case the customer changes his/her vehicle or changes the existing fleet, change in
particulars need to be filled in, which would then be available at all the three toll plazas to
avoid any inconvenience.
• If the Smart-tag is lost or stolen, the customer should report it to the Point of Sale in
writing. The customer will be held responsible for any loss from the use that Smart-tag for 48
hours after the loss has been reported in writing.
Smart-tag antenna requires the device to be in a certain position and angle on the
windshield.
Invalid card: If the card to which the Smart-Tag is linked is no longer valid the
Smart-tag will not function as system automatically checks the validity of the linked card,
before opening the boom.
Functionality:
A centralized back office operation or Central Toll Clearing House is mandatory for
the operation of nation-wide ETC systems. The Central Clearing House concept is a
transaction management which will enable multiple toll collection agencies to share toll
transaction data and revenue reconciliation. It is convenient and easy for a road user to use a
common payment mechanism which can be accepted at all toll plazas. Irrespective of the toll
plazas being operated by NHAI or BOT concessionaries, the reader system at each toll plaza
debits the applicable amount from the smart card of users.
Every Toll plaza shall have the facility to account for ETC based payments, and all
such transactions for the day are sent to the central toll clearing house (CTCH) as claims. The
CTCH runs an end of the day settlement and sends files to every toll plaza and point of sales
outlet for their receivables for that particular day. Such files are then sent to the bank for
conducting finanancial settlements to the particular bank accounts of all the collecting
agencies.
II. BANGALORE ELEVATED TOLLWAY LTD:
A Consortium of Soma Enterprise Ltd (Soma), Nagarjuna Construction Company
Limited (NCCL), and Maytas Infra Limited (Maytas) has built a 9 Km long 4 lane Elevated
Divided Carriageway Road between Silk Board Junction and Electronic City Junction on a
Build, Operate and Transfer (BOT) Basis for the National Highways Authority of India
(NHAI). The Consortium will operate and maintain the roads in the stretch between Silk
Board Junction and Inter State Border for the next 18 years. Bangalore Elevated Tollway Ltd
(BETL), which has been awarded the expressway project on the Bangalore-Hosur section of
the National Highway connecting the Electronic City, has proposed a toll of Rs 10 to Rs 70
per trip for different modes of vehicles, including heavy commercial vehicles. [15]
Technology: Passive RFID
Toll booths on National Highways will adopt the passive RFID technology standard –
ISO 18000 6C — for electronic toll collection (ETC) system, based on the recommendation
of a committee set up for this purpose, headed by Mr Nandan Nilekani, Chairman, Unique
Identification Authority of India (UIDAI). The recommendations have been adopted by the
Highways Ministry. In the ETC system, vehicles will have tags on their windscreens – where
amounts can be pre-loaded (just like prepaid SIM cards for phones) – and when the vehicles
pass through NH toll lanes with tag readers, the toll amount would automatically get debited.
This will pave the way for setting up of ETC system across the NH network.
There are about 147 toll booths on the NH network, out of which about 100-odd are
operated by NHAI and remaining by private developers. Each reader will cost about Rs 2
lakh. Each NH toll booth will have at least two lanes (one on each side) with tag readers.
NHAI or the operating concessionaire is likely to bear the cost of setting up tag readers at its
toll plazas though the Union Highway Minister, Mr Kamal Nath, said he expects the system
to be ―self-financing. It is also not clear as to who will fund the clearing house operator. At
present, two NH stretches have ETC options –Delhi-Gurgaon Expressway and Bangalore-
Electronic City elevated highway.
BLOCK DIAGRAM
The figure below shows the Block Diagram of the RFID based Toll Tax System:
Block Description:
RFID Transponder:
The RFID transponder module used in the project is a low frequency transponder
which works at the frequency of 125 Khz and it is responsible for providing power to the
Passive Tag and also reads the 12 byte code sent by the RFID tag and sends it to the TTL to
RS-232 converter.
RFID TRANSPONDER
RS232 TO TTLCONVERTER
MICONTROLLERAT89S52
LC D16x2UART
4X3 MATRIXSWITCH
MOTORDRIVER
L293D
MOTOR(GATE)
IR SENSORMODULE
BUZZER
RFID TAG
TTL to RS-232 converter:
The output of the RFID Transponder is RS 232 level it is necessary to convert the
RS232 level to the TTL level before providing it to the microcontroller this is done by using
and IC Max 232 which is a level shifter which is capable of converting the signals from
RS232 to TTL and TTL to RS232.
4x3 Matrix Switch:
The 4x3 Matrix Switch is a numeric keypad which is used to recharge the amount
when the amount of the user is low.
Microcontroller AT89S52:
The microcontroller is the most important device of the system since it is capable of
controlling all the device connected to it. It receives the code of the RFID tag from the
transponder and then compares it with the code stored in the memory and performs various
operations like deducting the amount from the user, recharging the amount, controlling the
gate. It also checks whether the vehicle is a stolen vehicle, if the vehicle is a stolen vehicle
then it will not open the gate and also generates a buzzer sound.
IR Sensor Module:
The IR Sensor Module is used to detect whether the vehicle has left the gate so that
the gate can be closed. The IR sensor Module normally comprises of an IR transmitter LED
and an IR receiver. The IR signals are continuously transmitted. Whenever an obstruction is
present then the IR signals emitted from the transmitter gets reflected towards the receiver
due to which the output of the receiver goes low, this can be detected by the microcontroller.
LCD 16x2:
The LCD provides all the information of the user like the user name the account
balance of the user the key pressed while recharging and also to show the type of the vehicle
such as LMV, HMV and STOLEN.
Motor Driver:
The Motor Driver receives the input from the microcontroller and drives the motor in
forward or reverse direction according to received command input. It mainly consists of an
IC L293d which has two H-bridges inbuilt . Among the two H-Bridge we are using a single
H-Bridge for controlling the Gate Motor.
Motor:
A high geared Torque DC motor is used for opening or closing the gate.
BUZZER:
A BUZZER is used to generate an alarm sound when a stolen vehicle arrives the Toll
Collection System.
INTRODUCTION TO RFID
Radio-frequency identification (RFID) is an automatic identification method, relying
on storing and remotely retrieving data using devices called RFID tags or transponders. The
technology requires some extent of cooperation of an RFID reader and an RFID tag.
An RFID tag is an object that can be applied to or incorporated into a product, animal,
or person for the purpose of identification and tracking using radio waves. Some tags can be
read from several meters away and beyond the line of sight of the reader.
An RFID tag is an object that can be applied to or incorporated into a product, animal,
or person for the purpose of identification and tracking using radio waves. Some tags can be
read from several meters away and beyond the line of sight of the reader.
What is RFID?
A basic RFID system consists of three components:
a) An antenna or coil
b) A transceiver (with decoder)
c) A transponder (RF tag)
Electronically programmed with unique information. There are many different types
of RFID systems out in the market. They are categorized according to there frequency ranges.
Some of the most commonly used RFID kits are as follows:
1) Low-frequency (30 KHz to 500 KHz)
2) Mid-Frequency (900KHz to 1500MHz)
3) High Frequency (2.4GHz to 2.5GHz)
These frequency ranges mostly tell the RF ranges of the tags from low frequency tag
ranging from 3m to 5m, mid-frequency ranging from 5m to 17m and high frequency ranging
from 5ft to 90ft. The cost of the system is based according to there ranges with low-frequency
system ranging from a few hundred dollars to a high-frequency system ranging somewhere
near 5000 dollars.
How RFID Is Changing the Business Environment today
Radio frequency identification (RFID) technology has been in use for several decades
to track and identify goods, assets and even living things. Recently, however, RFID has
generated widespread corporate interest as a means to improve supply chain performance.
Market activity has been exploding since Wal-Mart's June 2003 announcement that its top
100 suppliers must be RFID-compliant by January 2005. Mandates from Wal-Mart and the
Department of Defense (DoD) are making many companies scramble to evaluate, select and
implement solutions that will make them compliant with their customers' RFID requirements
and additional retailers and other large supply chain channel masters are likely to follow suit.
COMPONENTS OF RFID
A basic RFID system consist of three components:
An antenna or coil
A transceiver (with decoder)
A transponder (RF tag) electronically programmed with unique information
These are described below:
ANTENNA
The antenna emits radio signals to activate the tag and read and write data to it.
Antennas are the conduits between the tag and the transceiver, which controls the system's
data acquisition and communication. Antennas are available in a variety of shapes and sizes;
they can be built into a door frame to receive tag data from persons or things passing through
the door, or mounted on an interstate tollbooth to monitor traffic passing by on a freeway.
The electromagnetic field produced by an antenna can be constantly present when multiple
tags are expected continually. If constant interrogation is not required, a sensor device can
activate the field.
Often the antenna is packaged with the transceiver and decoder to become a reader
(a.k.a. interrogator), which can be configured either as a handheld or a fixed-mount device.
The reader emits radio waves in ranges of anywhere from one inch to 100 feet or more,
depending upon its power output and the radio frequency used. When an RFID tag passes
through the electromagnetic zone, it detects the reader's activation signal. The reader decodes
the data encoded in the tag's integrated circuit (silicon chip) and the data is passed to the host
computer for processing.
TAGS
An RFID tag is comprised of a microchip containing identifying information and an
antenna that transmits this data wirelessly to a reader. At its most basic, the chip will contain
a serialized identifier, or license plate number, that uniquely identifies that item, similar to the
way many bar codes are used today. A key difference, however is that RFID tags have a
higher data capacity than their bar code counterparts. This increases the options for the type
of information that can be encoded on the tag, including the manufacturer, batch or lot
number, weight, ownership, destination and history (such as the temperature range to which
an item has been exposed). In fact, an unlimited list of other types of information can be
stored on RFID tags, depending on application needs. An RFID tag can be placed on
individual items, cases or pallets for identification purposes, as well as on fixed assets such as
trailers, containers, totes, etc.
Tags come in a variety of types, with a variety of capabilities. Key variables include:
"Read-only" versus "read-write"
There are three options in terms of how data can be encoded on tags: (1) Read-only
tags contain data such as a serialized tracking number, which is pre-written onto them by the
tag manufacturer or distributor. These are generally the least expensive tags because they
cannot have any additional information included as they move throughout the supply chain.
Any updates to that information would have to be maintained in the application software that
tracks SKU movement and activity. (2) "Write once" tags enable a user to write data to the
tag one time in production or distribution processes. Again, this may include a serial number,
but perhaps other data such as a lot or batch number. (3) Full "read-write" tags allow new
data to be written to the tag as needed—and even written over the original data. Examples for
the latter capability might include the time and date of ownership transfer or updating the
repair history of a fixed asset. While these are the most costly of the three tag types and are
not practical for tracking inexpensive items, future standards for electronic product codes
(EPC) appear to be headed in this direction.
RFID TAGS
Data capacity
The amount of data storage on a tag can vary, ranging from 16 bits on the low end to
as much as several thousand bits on the high end. Of course, the greater the storage capacity,
the higher the price per tag.
Form factor
The tag and antenna structure can come in a variety of physical form factors and can
either be self-contained or embedded as part of a traditional label structure (i.e., the tag is
inside what looks like a regular bar code label—this is termed a 'Smart Label') companies
must choose the appropriate form factors for the tag very carefully and should expect to use
multiple form factors to suit the tagging needs of different physical products and units of
measure. For example, a pallet may have an RFID tag fitted only to an area of protected
placement on the pallet itself. On the other hand, cartons on the pallet have RFID tags inside
bar code labels that also provide operators human-readable information and a back-up should
the tag fail or pass through non RFID-capable supply chain links.
Passive versus active
“Passive” tags have no battery and "broadcast" their data only when energized by a
reader. That means they must be actively polled to send information. "Active" tags are
capable of broadcasting their data using their own battery power. In general, this means that
the read ranges are much greater for active tags than they are for passive tags—perhaps a read
range of 100 feet or more, versus 15 feet or less for most passive tags. The extra capability
and read ranges of active tags, however, come with a cost; they are several times more
expensive than passive tags. Today, active tags are much more likely to be used for high-
value items or fixed assets such as trailers, where the cost is minimal compared to item value,
and very long read ranges are required. Most traditional supply chain applications, such as the
RFID-based tracking and compliance programs emerging in the consumer goods retail chain,
will use the less expensive passive tags.
Frequencies
Like all wireless communications, there are a variety of frequencies or spectra
through which RFID tags can communicate with readers. Again, there are trade-offs among
cost, performance and application requirements. For instance, low-frequency tags are cheaper
than ultra high-frequency (UHF) tags, use less power and are better able to penetrate non-
metallic substances. They are ideal for scanning objects with high water content, such as
fruit, at close range. UHF frequencies typically offer better range and can transfer data faster.
But they use more power and are less likely to pass through some materials. UHF tags are
typically best suited for use with or near wood, paper, cardboard or clothing products.
Compared to low-frequency tags, UHF tags might be better for scanning boxes of goods as
they pass through a bay door into a warehouse. While the tag requirements for compliance
mandates may be narrowly defined, it is likely that a variety of tag types will be required to
solve specific operational issues. You will want to work with a company that is very
knowledgeable in tag and reader technology to appropriately identify the right mix of RFID
technology for your environment and applications.
CIRCUIT DIAGRAM
Circuit description:
The RFID reader reads the tag if it is present near the reader and sends the 12 byte
code in the form of serial data at an baud rate of 9600 bps to the input of a level converter
which is nothing but RS 232 to TTL converter It is required since the microcontroller
operates at TTL level. The serial data is received in interrupt mode by the microcontroller.
As soon as vehicle arrives in the toll gate the RFID card in the vehicle is read by the
reader and its is processed by the microcontroller initially the microcontroller compares it
with the already stored one and detects the type of vehicle whether LMV, HMV and
STOLEN vehicle as the soon as the type is detected it displays in the LCD it also shows the
account balance of the user and charges an amount of 20Rs. For LMV and charges an amount
of 30Rs. For HMV vehicle if the account balance is insufficient then it is indicated on the
LCD to recharge the account with the help of the Keypad attached to the system.
The * button is used to cancel a letter if a letter is wrongly pressed and the # symbol
denotes the OK sign i.e. once the amount to recharge is entered then the # symbol should be
pressed and the amount is deducted and after deducting the amount the gate is opened by
turning the DC motor.
Now the IR sensor is scanned to notify whether the Vehicle has left the gate so that
the gate can be closed.
Whenever a Stolen vehicle arrives the gate it is detected since the information of the
stolen vehicle is already stored in the database by comparing with the received code of the tag
with all the code stored the stolen vehicle is identified and now the gate will not be opened
and an alarm is generated with the help of a buzzer.
Circuit diagram of Power Supply
Power supply design:
Block diagram:
Most digital logic circuits and processors need a 5 volt power supply. To use
these parts we need to build a regulated 5 volt source. Usually you start with an
unregulated power to make a 5 volt power supply, we use a LM7805 voltage regulator
IC (Integrated Circuit). The LM7805 is simple to use. You simply connect the positive
lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the
Input pin, connect the negative lead to the Common pin and then when you turn on the
power, you get a 5 volt supply from the Output pin.
CIRCUIT FEATURES:
POWER SUPPLY BLOCK DIAGRAM:
FIG 5.1: BLOCK DIAGRAM OF POWER SUPPLY
POWER SUPPLY BLOCK DIAGRAM DESCRIPTION:
The ac voltage, typically 230 Vrms, is connected to a transformer, which steps that ac
voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave
rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage.
This resulting dc voltage usually has some ripple or ac voltage variation. A regulator circuit
removes the ripples and also remains the same dc value even if the input dc voltage varies, or
the load connected to the output dc voltage changes. This voltage regulation is usually
obtained using one of the popular voltage regulator IC units.
POWER SUPPLY CIRCUIT COMPONENT DESCRIPTION:
5.1.2: TRANSFORMER:
Transformers convert AC electricity from one voltage to
another with little loss of power. Transformers work only
with AC and this is one of the reasons why mains electricity
is AC. The input coil is called the primary and
the output coil is called the secondary. There is no electrical connection between the two
coils, instead they are linked by an alternating magnetic field created in the soft-iron core
of the transformer. The two lines in the middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the power in.
Note that as voltage is stepped down current is stepped up. The ratio of the number of
turns on each coil, called the turns ratio.
turns ratio = Vp
= Np
and power out = power in
Vs Ns Vs × Is = Vp × Ip
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current
Vs = secondary (output) voltage
Ns = number of turns on secondary coil
Is = secondary (output) current
5.1.3: BRIDGE RECTIFTER:
The rectifier is nothing but a circuit which would convert ac into dc. The most commonly
used rectifier is the bridge rectifier. The bridge rectifier consists of four diodes of IN4007.
The diodes are connected in such a way that during the positive half cycle two of the diodes
that are forward biased will conduct and the other two will not conduct. And in the next half
cycle, the alternate diodes will conduct. So we get an output with fewer ripples. Now the
output must be a clear dc for which we need to further filter the ac components.
FIG 5.1.3(A): Bridge rectifier
FIG 5.1.3(B):Output: full-wave varying
5.1.4: FILTER:
The filter circuit used here is capacitive filter circuit is connected at the rectifier output, and a
DC is obtained across it. The filtered waveform is essentially a DC voltage with negligible
ripples, which is ultimately fed to the load.
FIG 5.1.4 CAPACITIVE FILTER
Smoothing significantly increases the average DC voltage to almost the peak value (1.4 ×
RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS
(1.4V is lost in the bridge rectifier), with smoothing this increases to almost the peak value
giving 1.4 × 4.6 = 6.4V smooth DC. The Smoothing is not perfect due to the capacitor
voltage falling a little as it discharges, giving a small ripple voltage. For many circuits a
ripple which is 10% of the supply voltage is satisfactory and the Equation below gives the
required value for the smoothing capacitor. A larger capacitor will give fewer ripples.
Smoothing capacitor for 10% ripple, C = 5 × Io
Vs × f
C= smoothing capacitance in farads (F)
Io = output current from the supply in amps (A)
Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC
f = frequency of the AC supply in hertz (Hz), 50Hz
5.1.5: VOLTAGE REGULATOR:
FIG 5.1.5: IC7805
FIG 5.1.5: IC7805
Pin Description:
Pin No Function Name
1 Input voltage (5V-18V) Input
2 Ground (0V) Ground
3 Regulated output; 5V (4.8V-5.2V) Output
The series 78 regulators provide fixed regulated voltages from 5V to 24V shows how one
such IC, a 7805, is connected to provide voltage regulation with output from this unit of +5V
dc. An unregulated input voltage Vi is filtered by capacitor C1 and connected to the IC‘s IN
terminal. The IC‘s OUT terminal provides a regulated + 5V which is filtered by capacitor C2
(mostly for any high-frequency noise). The third IC terminal is connected to ground (GND).
While the input voltage may vary over some permissible voltage range, and the output load
may vary over some acceptable range, the output voltage remains constant within specified
voltage variation limits.
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not
give the fixed voltage output. The voltage regulator IC maintains the output voltage at a
constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide.
7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at
input and output pins depending upon the respective voltage levels.
RFID MODULE:
Radio-frequency identification (RFID) is a technology that uses communication
through the use of radio waves to transfer data between a reader and an electronic tag attached
to an object for the purpose of identification and tracking. RFID makes it possible to give each
product in a grocery store its own unique identifying number, to provide assets, people, work
in process, medical devices etc. all with individual unique identifiers - like the license plate on
a car but for every item in the world. This is a vast improvement over paper and pencil
tracking or bar code tracking that has been used since the 1970s. With bar codes, it is only
possible to identify the brand and type of package in a grocery store, for instance.
Furthermore, passive RFID tags (those without a battery) can be read if passed
within close enough proximity to an RFID reader. It is not necessary to "show" the tag to the
reader device, as with a bar code. In other words it does not require line of sight to "see" an
RFID tag, the tag can be read inside a case, carton, box or
other container, and unlike barcodes RFID tags can be read hundreds at a time. Bar codes can
only read one at a time.
Some RFID tags can be read from several meters away and beyond the line of sight
of the reader. The application of bulk reading enables an almost-parallel reading of tags.
Radio-frequency identification involves the hardware known as interrogators (also
known as readers), and tags (also known as labels), as well as RFID software or RFID
middleware.
Most RFID tags contain at least two parts: one is an integrated circuit for storing
and processing information, modulating and demodulating a radio-frequency (RF) signal, and
other specialized functions; the other is an antenna for receiving and transmitting the signal.
RFID can be either passive (using no battery), active (with an on-board battery that
always broadcasts or beacons its signal) or battery assisted passive (BAP) which has a small
battery on board that is activated when in the presence of an RFID reader. Passive tags in 2011
start at $ .05 each and for special tags meant to be mounted on metal, or withstand gamma
sterilization go up to $5. Active tags for tracking containers, medical assets, or monitoring
environmental conditions in data centers all start at $50 and can go up over $100 each. BAP
tags are in the $3–10 range and also have sensor capability like temperature and humidity.
The term RFID refers to the technology. The tags should properly be called "RFID
tags" not "RFIDs".Fixed RFID and Mobile RFID: Depending on mobility, RFID readers are
classified into two different types: fixed RFID and mobile RFID. If the reader reads tags in a
stationary position, it is called fixed RFID. These fixed readers are set up specific
interrogation zones and create a "bubble" of RF energy that can be tightly controlled if the
physics
is well engineered.
This allows a very definitive reading area for when tags go in and out of the
interrogation zone.On the other hand, if the reader is mobile when the reader reads tags, it is
called mobile RFID. Mobile readers include hand helds, carts and vehicle mounted RFID
readers from manufacturers such as Motorola, Intermec, Impinj, Sirit, etc.
Fig.5.2.:RFID tag
125KHz readers are high performance proximity readers featuring long range and
small dimensions. The readers run from any voltage from 5 to 12.5 VDC and feature
high read range at as low as 5 volts making it ideally suited to a wide variety of
applications, particularly access control. The same basic unit can be configured to
output most of the common interface formats, including Wiegand, Magstripe, Clock/
Data and RS-232 serial ASCII output, making it easy to upgrade existing installations.
Readers are RF detectors that can read tags to obtain the information
stored within them. It has an antenna that sends and receives signals.A reader
generates an RF field. When a tag passes through the field, the information stored on
the chip in the tag is decoded by the reader and sent to the server.
RFID tag used is passive tag.It provides best reading range with 125KHz
RFID readers. RFID tags contain a memory chip and RF antenna that can send and
receive several bits of data. Such RFID tags are known as smart labels or digital
identification tags.The microchips on the RFID tags can be programmed electronically.
Similarly a reader (technically known as an interrogator) has to be
programmed to send and receive correct information from a tag. passive RFID tags,
which have no battery and require an external source to provoke signal transmission.
Passive tags generally operate at a maximum distance of 3 meters or less,
and have power only when in communication with an RFID reader. 125Khz RFID
Clamshell cards are water proof and provide best reading range with 125KHz RFID
readers. Clamshell cards are very popular in Access control applications but can be
used in wide range of RFID applications. They are lowest cost RFID cards available
currently in the market.
They have 26-bit factory written ID that cannot be changed, though selected
number sequences can be supplied for volume orders. These are Read only tags.
FEATURES OF RFID READER:
Low cost
Long read range
Small outline
Wide voltage range
Potted for environmental protection
Externally programmable interface.
MICROCONTROLLER (AT89S52)
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes
of in-system programmable Flash memory. The device is manufactured using Atmel’s high-
density nonvolatile memory technology and is compatible with the indus-try-standard 80C51
instruction set and pinout. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications.
Features:
8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 10,000
Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal
32 Programmable I/O
Three 16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Block diagram of AT89s52:
Pin Details:
AT89S52 is 40 pin IC with four ports. Pin diagram of microcontroller is shown in Fig.
VCC - - Supply voltage..
VSS - - Ground.
Port 0Port 0
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port
0 may also be configured to be the multiplexed low order address/data bus during accesses to
external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the
code bytes during Flash programming, and outputs the code bytes during program verification.
External pull-ups are required during program verification.
Port 1 Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address
bytes during Flash programming and verification.
Port 2Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data memory that
uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI),
Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
Port 3Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will
source Current (IIL) because of the pull-ups. Port 3 also serves the functions of various special
features of the AT89V51RD2 as listed:
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Port 3 also receives some control signals for Flash programming and verification.
RST –RST –
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device.
ALE/ PROGALE/ PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash programming. In
normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used
for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during
each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of
SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSENPSEN
Program Store Enable is the read strobe to external program memory. When the
89V51RD2FA is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external data
memory.
EA/VPP EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note, however, that
if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC
for internal program executions. This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming, for parts that require 12-volt VPP.
3.1.4 Oscillator and Clock Details:3.1.4 Oscillator and Clock Details:
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,
which can be configured for use as an on-chip oscillator, as shown in Figs 6.1 Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2. There are
no requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage
high and low time specifications must be observed.
Fig 6.1 Oscillator Connections Fig 6.2 External Clock Drive Configuration
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
3.1.5 Transmission in 89V51RD2:3.1.5 Transmission in 89V51RD2:
89V51RD2 has a serial data communication circuit that uses register SBUF to hold data.
Register SCON controls data communication. Register PCON controls data rates. Pins RxD (p3.0)
and TxD(3.1) connect to serial data network. SBUF is physically two registers, one is writing only
i.e. to hold data to be transmitted out of microcontroller via TxD. The other is read only and holds
received data from an external transmitting source via RxD.
Whenever a data byte is transmitted T1 flag is set and so program is interrupted to transmit
another byte of data. The main program is interrupted only serial port interrupt is 1E SFR is enable.
The data transmission steps are:
Initially the T1 flag is reset.
Data to be transmitted must be written into SBUF.
As soon as data is transmitted the T1 flag is set and main program is interrupted to execute
ISR.
In the ISR T1 flag is reset .another data is written in SBUF register.
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program executions. This pin also receives
the 12-volt programming enable voltage (VPP) during Flash programming, for parts that
require 12-volt VPP.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
Output from the inverting oscillator amplifier.
RAM memory space allocation in the 8051
There are 128 bytes of RAM in the 8051. The 128 bytes of RAM inside the 8051 are
assigned addresses 00 to7FH. These 128 bytes are divided into three different groups as
follows:
1. A total of 32 bytes from locations 00 to 1FH hex are set aside for register banks
and the stack.
2. A total of 16 bytes from locations 20 to 2FH hex are set aside for bit-addressable
read/write memory.
3. A total of 80 bytes from locations 30H to 7FH are used for read and write storage,
or what is normally called Scratch pad. These 80 locations of RAM are widely
used for the purpose of storing data and parameters nu 8051 programmers.
Default register bank
Register bank 0; that is, RAM locations 0, 1,2,3,4,5,6, and 7 are accessed with the
names R0, R1, R2, R3, R4, R5, R6, and R7 when programming the 8051.
FIG 8: RAM Allocation in the 8051
PSW Register (Program Status Word)
This is one of the most important SFRs. The Program Status Word (PSW) contains several
status bits that reflect the current state of the CPU. This register contains: Carry bit, Auxiliary
Carry, two register bank select bits, Overflow flag, parity bit, and user-definable status flag.
The ALU automatically changes some of register’s bits, which is usually used in regulation
of the program performing.
P - Parity bit. If a number in accumulator is even then this bit will be automatically set (1),
otherwise it will be cleared (0). It is mainly used during data transmission and receiving via
serial communication.
OV Overflow occurs when the result of arithmetical operation is greater than 255 (decimal),
so that it cannot be stored in one register. In that case, this bit will be set (1). If there is no
overflow, this bit will be cleared (0).
RS0, RS1 - Register bank select bits. These two bits are used to select one of the four
register banks in RAM. By writing zeroes and ones to these bits, a group of registers R0-R7
is stored in one of four banks in RAM.
RS1 RS2 Space in RAM
0 0 Bank0 00h-07h
0 1 Bank1 08h-0Fh
1 0 Bank2 10h-17h
1 1 Bank3 18h-1Fh
F0 - Flag 0. This is a general-purpose bit available to the user.
AC - Auxiliary Carry Flag is used for BCD operations only.
CY - Carry Flag is the (ninth) auxiliary bit used for all arithmetical operations and shift
instructions.
DPTR Register (Data Pointer)
These registers are not true ones because they do not physically exist. They consist of two
separate registers: DPH (Data Pointer High) and (Data Pointer Low). Their 16 bits are used
for external memory addressing. They may be handled as a 16-bit register or as two
independent 8-bit registers. Besides, the DPTR Register is usually used for storing data and
intermediate results, which have nothing to do with memory locations.
SP Register (Stack Pointer)
The stack is a section of RAM used by the CPU to store information temporily. This
information could be data or an address. The CPU needs this storage area since there are
only a limited number of registers.
How stacks are accessed in the 8051
If the stack is a section of RAM, there must be registers inside the CPU to point to it.
The register used to access the stack is called the SP (Stack point) Register. The stack pointer
in the 8051 is only 8 bits wide; which means that it can take values of 00 to FFH. When the
8051 is powered up, the SP register contains value 07. This means that RAM location 08 is
the first location used for the stack by the 8051. The storing of a CPU register in the stack is
called a PUSH, and pulling the contents off the stack back into a CPU register is called a
POP. In other words, a register is pushed onto the stack to save it and popped off the stack to
retrieve it. The job of the SP is very critical when push and pop actions are performed.
Program counter:
The important register in the 8051 is the PC (Program counter). The program counter
points to the address of the next instruction to be executed. As the CPU fetches the opcode
from the program ROM, the program counter is incremented to point to the next instruction.
The program counter in the 8051 is 16bits wide. This means that the 8051 can access
program addresses 0000 to FFFFH, a total of 64k bytes of code. However, not all members
of the 8051 have the entire 64K bytes of on-chip ROM installed, as we will see soon.
Serial Communication:
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers a block of data at a time, while the asynchronous method
transfers a single byte at a time.
In data transmission if the data can be transmitted and received, it is a duplex
transmission. This is in contrast to simplex transmissions such as with printers, in which the
computer only sends data. Duplex transmissions can be half or full duplex, depending on
whether or not the data transfer can be simultaneous. If data is transmitted one way at a time,
it is referred to as half duplex. If the data can go both ways at the same time, it is full duplex.
Of course, full duplex requires two wire conductors for the data lines, one for transmission
and one for reception, in order to transfer and receive data simultaneously.
Asynchronous serial communication and data framing
The data coming in at the receiving end of the data line in a serial data transfer is all
0s and 1s; it is difficult to make sense of the data unless the sender and receiver agree on a set
of rules, a protocol, on how the data is packed, how many bits constitute a character, and
when the data begins and ends.
Start and stop bits
Asynchronous serial data communication is widely used for character-oriented
transmissions, while block-oriented data transfers use the synchronous method. In the
asynchronous method, each character is placed between start and stop bits. This is called
framing. In the data framing for asynchronous communications, the data, such as ASCII
characters, are packed between a start bit and a stop bit. The start bit is always one bit, but the
stop bit can be one or two bits. The start bit is always a 0 (low) and the stop bit (s) is 1
(high).
Data transfer rate
The rate of data transfer in serial data communication is stated in bps (bits per
second). Another widely used terminology for bps is baud rate. However, the baud and bps
rates are not necessarily equal. This is due to the fact that baud rate is the modem
terminology and is defined as the number of signal changes per second. In modems a single
change of signal, sometimes transfers several bits of data. As far as the conductor wire is
concerned, the baud rate and bps are the same, and for this reason we use the bps and baud
interchangeably.
RS232 Standards
To allow compatibility among data communication equipment made by various
manufacturers, an interfacing standard called RS232 was set by the Electronics Industries
Association (EIA) in 1960. In 1963 it was modified and called RS232A. RS232B AND
RS232C were issued in 1965 and 1969, respectively. Today, RS232 is the most widely used
serial I/O interfacing standard. This standard is used in PCs and numerous types of
equipment. However, since the standard was set long before the advert of the TTL logic
family, its input and output voltage levels are not TTL compatible. In RS232, a 1 is
represented by -3 to -25V, while a 0 bit is +3 to +25V, making -3 to +3 undefined. For this
reason, to connect any RS232 to a micro controller system we must use voltage converters
such as MAX232 to convert the TTL logic levels to the RS232 voltage levels, and vice versa.
MAX232 IC chips are commonly referred to as line drivers.
RS232 pins
RS232 cable, commonly referred to as the DB-25 connector. In labeling, DB-25P refers to the plug connector (male) and DB-25S is for the socket connector (female). Since not all the pins are used in PC cables, IBM introduced the DB-9 Version of the serial I/O standard, which uses 9 pins only, as shown in table.(Out of computer and exposed end of cable)
Pin Functions:
Pin Description
1 Data carrier detect (DCD)
2 Received data (RXD)
3 Transmitted data (TXD)
4 Data terminal ready(DTR)
5 Signal ground (GND)
6 Data set ready (DSR)
7 Request to send (RTS)
8 Clear to send (CTS)
9 Ring indicator (RI)
Note: DCD, DSR, RTS and CTS are active low pins.
The method used by RS-232 for communication allows for a simple connection of three
lines: Tx, Rx, and Ground. The three essential signals for 2-way RS-232
8051 connection to RS232
The RS232 standard is not TTL compatible; therefore, it requires a line driver such as
the MAX232 chip to convert RS232 voltage levels to TTL levels, and vice versa. The
interfacing of 8051 with RS232 connectors via the MAX232 chip is the main topic.
The 8051 has two pins that are used specifically for transferring and receiving data
serially. These two pins are called TXD and RXD and a part of the port 3 group (P3.0 and
P3.1). pin 11 of the 8051 is assigned to TXD and pin 10 is designated as RXD. These pins
are TTL compatible; therefore, they require a line driver to make them RS232 compatible.
One such line driver is the MAX232 chip.
Since the RS232 is not compatible with today’s microprocessors and
microcontrollers, we need a line driver (voltage converter) to convert the RS232’s signals to
TTL voltage levels that will be acceptable to the 8051’s TXD and RXD pins. One example
of such a converter is MAX232 from Maxim Corp. The MAX232 converts from RS232
voltage levels to TTL voltage levels, and vice versa.
Fig 11: Interfacing of MAX-232 to controller
Interrupts in the 8051:
In reality, only five interrupts are available to the user in the 8051, but many manufacturers’
data sheets state that there are six interrupts since they include reset .the six interrupts in the
8051 are allocated as above.
1. Reset. When the reset pin is activated, the 8051 jumps to address location 0000.this is
the power-up reset.
2. Two interrupts are set aside for the timers: one for Timer 0 and one for Timer
1.Memory location 000BH and 001BH in the interrupt vector table belong to Timer 0
and Timer 1, respectively.
3. Two interrupts are set aside for hardware external harder interrupts. Pin number
12(P3.2) and 13(P3.3) in port 3 is for the external hardware interrupts INT0 and
INT1, respectively. These external interrupts are also referred to as EX1 and
EX2.Memory location 0003H and 0013H in the interrupt vector table are assigned to
INT0 and INT1, respectively.
4. Serial communication has a single interrupt that belongs to both receive and transmit.
The interrupt vector table location 0023H belongs to this interrupt.
Interrupt Enable Register
D7 D6 D5 D4 D3 D2 D1 D0
EA IE.7 disables all interrupts. If EA=0, no interrupts is acknowledged.
If EA=1, each interrupt source is individually enabled disabled
By setting or clearing its enable bit.
-- IE.6 Not implemented, reserved for future use.*
ET2 IE.5 Enables or disables Timer 2 overflow or capture interrupt (8052
only).
ES IE.4 Enables or disables the serial ports interrupt.
ET1 IE.3 Enables or disables Timers 1 overflow interrupt
EX1 IE.2 Enables or disables external interrupt 1.
ET0 IE.1 Enables or disables Timer 0 overflow interrupt.
EX0 IE.0 Enables or disables external interrupt 0.
LCD (16X2)
The output section consists of the
LCD Display which is a
16character X 2line display
used to indicate the modes selected,
the clock time, room
temperature. Etc.
The LCD Display mainly consists of two RAM
1) Display Data RAM (DDRAM)
EA -- ET2 ES ET1 EX1 ET0 EX0
2) Character Generator RAM (CGRAM)-User defined character RAM
Display Data RAM (DDRAM)
Display data RAM (DDRAM) is where you send the characters (ASCII code) you
want to see on the LCD screen. It stores display data represented in 8-bit character codes. Its
capacity is 80 characters (bytes). Below you see DD
RAM address layout of a 2*16 LCD.
In the above memory map, the area shaded in black is the visible display (For 16x2
display).
For first line addresses for first 15 characters is from 00h to 0Fh. But for second line
address of first character is 40h and so on up to 4Fh for the 16th character.
So if you want to display the text at specific positions of LCD, we require to
manipulate address and then to set cursor position accordingly.
Character Generator RAM (CGRAM)-User defined character RAM
In the character generator RAM, we can define our own character patterns by program. CG
RAM is 64 bytes, allowing for eight 5*8 pixel, character patterns to be defined. However
how to define this and use it is out of scope of this tutorial. So I will not talk any more about
CGRAM
Registers
The HD44780 has two 8-bit registers, an instruction register (IR) and a data register (DR).
The IR stores instruction codes. The DR temporarily stores data to be written into DDRAM
or CGRAM and temporarily stores data to be read from DDRAM or CGRAM. Data written
into the DR is automatically written into DDRAM or CGRAM by an internal operation. .
These two registers can be selected by the register selector (RS) signal. See the table below:
Register Selection
RS R/W Operation
0 0 IR write as an internal operation (display clear, etc.)
0 1 Read busy flag (DB7) and address counter (DB0 to DB6)
1 0 DR write as an internal operation (DR to DDRAM or CGRAM)
1 1 DR read as an internal operation (DDRAM or CGRAM to DR)
Busy Flag (BF)
When the busy flag is 1, the LCD is in the internal operation mode, and the next
instruction will not be accepted. When RS = 0 and R/W = 1 (see the table above), the busy
flag is output to DB7 (MSB of LCD data bus). The next instruction must be written after
ensuring that the busy flag is 0.
LCD Commands
The LCD’s internal controller accept several commands and modify the display
accordingly. These commands would be things like:
– Clear screen
– Return home
– Shift display right/left
Instruction Decimal HEX
Function set (8-bit interface, 2 lines, 5*7 Pixels) 56 38
Function set (8-bit interface, 1 line, 5*7 Pixels) 48 30
Function set (4-bit interface, 2 lines, 5*7 Pixels) 40 28
Function set (4-bit interface, 1 line, 5*7 Pixels) 32 20
Scroll display one character right (all lines) 28 1E
Scroll display one character left (all lines) 24 18
Home (move cursor to top/left character position) 2 2
Move cursor one character left 16 10
Move cursor one character right 20 14
Turn on visible underline cursor 14 0E
Turn on visible blinking-block cursor 15 0F
Make cursor invisible 12 0C
Blank the display (without clearing) 8 08
Restore the display (with cursor hidden) 12 0C
Clear Screen 1 01
Set cursor position (DDRAM address) 128 + addr 80+ addr
Set pointer in character-generator RAM (CG RAM address) 64 + addr 40+ addr
Entry mode set
This command sets cursor move direction and display shift ON/OFF. There are 4
possible function set commands;04, 05, 06, and 07. This command changes the direction the
cursor moves by setting the address counter to increment or decrement. This command is
very important. If you do not understand it you may not see anything or what you actually
wanted to see on LCD screen.
Set cursor position (DDRAM address)
As said earlier if we want to display the text at specific positions of LCD, we require
to manipulate address and then to set cursor position accordingly.
Converter TTL to RS232 (MAX 232)
Meets or Exceeds TIA/EIA-232-F and ITU
Recommendation V.28
Operates From a Single 5-V Powere Supply
With 1.0-_F Charge-Pump Capacitors
Operates Up To 120 kbit/s
Two Drivers and Two Receivers 30-V Input Levels
Low Supply Current . . . 8 mA Typical
ESD Protection Exceeds JESD 22 2000-V Human-Body Model (A114-A)
Upgrade With Improved ESD (15-kV HBM) and 0.1-_F Charge-Pump Capacitors is
Available With the MAX202
Applications -TIA/EIA-232-F, Battery-Powereed Systems,
Terminals, Modems, and Computers
Description
The MAX232 is a dual driver/receiver that includes a capacitive voltage
generator to supply TIA/EIA-232-F voltage levels from a single 5-V supply. Each receiver
converts TIA/EIA-232-F inputs to 5-V TTL/CMOS level. These receivers have a typical
threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept 30-V inputs. Each driver
converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and
voltage-generator functions are available as cells in the Texas Instruments Lin ASIC
library.
Input supply voltage range, VCC (see Note 1) . . . . . . . . . . . . . . . . −0.3 V to 6 V
Positive output supply voltage range, VS+ . . . . . . . . . . . . VCC − 0.3 V to 15 V
Negative output supply voltage range, VS− . . . . . . . . . . . . . . . . −0.3 V to −15 V
Input voltage range, VI: Driver . . . . . . . . . . . . . . . . . . . . −0.3 V to VCC + 0.3 V
Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 V
Output voltage range, VO: T1OUT, T2OUT . . . . .VS− − 0.3 V to VS+ + 0.3 V
R1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to VCC + 0.3 V
Short-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . Unlimited
Package thermal impedance, JA (see Notes 2 and 3): D package . . . 73C/W
DW package . . . . . . . . . . . . . . . . . . . . . . . . . . ……………………57C/W
N package . . . . . . . . . . . . . . . . . . . . . . . . . . . ……………………. 67C/W
NS package . . . . . . . . . . . . . . . . . . . . . . . . . . ……………………. 64C/W
Operating virtual junction temperature, TJ . . . . . . . . . . . . . . . . . . . . . . . . . .150C
Storage temperature range, Tstg . . . . . . . . . . . . . . . . . . . . . . . . −65C to 150C
DC MOTOR: A DC motor is designed to run on DC electric power. Two examples of pure
DC designs are Michael Faraday's homopolar motor (which is uncommon), and the ball
bearing motor, which is (so far) a novelty. By far the most common DC motor types are
the brushed and brushless types, which use internal and external commutation respectively to
reverse the current in the windings in synchronism with rotation.
Permanent-magnet electric motor
A permanent-magnet motor does not have a field winding on the stator frame,
instead relying on permanent magnets to provide the magnetic field against which the rotor
field interacts to produce torque. Compensating windings in series with the armature may be
used on large motors to improve commutation under load. Because this field is fixed, it
cannot be adjusted for speed control. Permanent-magnet fields (stators) are convenient in
miniature motors to eliminate the power consumption of the field winding.
Most larger DC motors are of the "dynamo" type, which have stator windings.
Historically, permanent magnets could not be made to retain high flux if they were
disassembled; field windings were more practical to obtain the needed amount of flux.
However, large permanent magnets are costly, as well as dangerous and difficult to assemble;
this favors wound fields for large machines.
To minimize overall weight and size, miniature permanent-magnet motors may
use high energy magnets made with neodymium or other strategic elements; most such are
neodymium-iron-boron alloy. With their higher flux density, electric machines with high
energy permanent magnets are at least competitive with all optimally designed singly
fed synchronous andinduction electric machines. Miniature motors resemble the structure in
the illustration, except that they have at least three rotor poles (to ensure starting, regardless
of rotor position) and their outer housing is a steel tube that magnetically links the exteriors
of the curved field magnets.
Some of the problems of the brushed DC motor are eliminated in the brushless
design. In this motor, the mechanical "rotating switch" or commutator/brushgear assembly is
replaced by an external electronic switch synchronised to the rotor's position. Brushless
motors are typically 85–90% efficient or more, efficiency for a brushless electric motor, of up
to 96.5% was reported[19] whereas DC motors with brushgear are typically 75–80% efficient.
Midway between ordinary DC motors and stepper motors lies the realm of
the brushless DC motor. Built in a fashion very similar to stepper motors, these often use a
permanent magnet external rotor, three phases of driving coils, may use Hall effect sensors to
sense the position of the rotor, and associated drive electronics. The coils are activated, one
phase after the other, by the drive electronics as cued by the signals from either Hall effect
sensors or from the back EMF (electromotive force) of the undriven coils. In effect, they act
as three-phase synchronous motors containing their own variable-frequency drive electronics.
A specialized class of brushless DC motor controllers utilize EMF feedback
through the main phase connections instead of Hall effect sensors to determine position and
velocity. These motors are used extensively in electric radio-controlled vehicles. When
configured with the magnets on the outside, these are referred to by modelers as out runner
motors.
Brushless DC motors are commonly used where precise speed control is
necessary, as in computer disk drives or in video cassette recorders, the spindles
within CD, CD-ROM (etc.) drives, and mechanisms within office products such as fans, laser
printers and photocopiers. They have several advantages over conventional motors:
Compared to AC fans using shaded-pole motors, they are very efficient, running much cooler
than the equivalent AC motors. This cool operation leads to much-improved life of the fan'.
Without a commutator to wear out, the life of a DC brushless motor can be
significantly longer compared to a DC motor using brushes and a commutator. Commutation
also tends to cause a great deal of electrical and RF noise; without a commutator or brushes, a
brushless motor may be used in electrically sensitive devices like audio equipment or
computers.
PCB DESIGNING AND LAYOUT
7.1PCB DESIGNING:
PCB FABRICATION:
Printed circuit boards, or PCBs, form the core of electronic equipment domestic and
industrial. Some of the areas where PCBs are intensively used are computers, process control,
telecommunications and instrumentation.
MANUFATCURING:
The manufacturing process consists of two methods; print and etch, and print, plate and etch.
The single sided PCBs are usually made using the print and etch method. The double sided
plate through hole (PTH) boards are made by the print plate and etch method. The production
of multi layer boards uses both the methods. The inner layers are printed and etch while the
outer layers are produced by print, plate and etch after pressing the inner layers.
PANELISATION:
Here the schematic transformed in to the working positive/negative films. The circuit is
repeated conveniently to accommodate economically as many circuits as possible in a panel,
which can be operated in every sequence of subsequent steps in the PCB process. This is
called penalization. For the PTH boards, the next operation is drilling.
DRILLING:
PCB drilling is a state of the art operation. Very small holes are drilled with high speed CNC
drilling machines, giving a wall finish with less or no smear or epoxy, required for void free
through hole plating.
PLATING:
The heart of the PCB manufacturing process. The holes drilled in the board are treated both
mechanically and chemically before depositing the copper by the electro less copper platting
process.
ETCHING:
Once a multiplayer board is drilled and electro less copper deposited, the image available in
the form of a film is transferred on to the outside by photo printing using a dry film printing
process. The boards are then electrolytic plated on to the circuit pattern with copper and tin.
The tin-plated deposit serves an etch resist when copper in the unwanted area is removed by
the conveyor‘s spray etching machines with chemical etch ants. The etching machines are
attached to an automatic dosing equipment, which analyses and controls etch ants
concentrations
SOLDER MASK:
Since a PCB design may call for very close spacing between conductors, a solder mask has to
be applied on the both sides of the circuitry to avoid the bridging of conductors. The solder
mask ink is applied by screening. The ink is dried, exposed to UV, developed in a mild
alkaline solution and finally cured by both UV and thermal energy.
HOT AIR LEVELLING:
After applying the solder mask, the circuit pads are soldered using the hot air leveling
process. The bare bodies fluxed and dipped in to a molten solder bath. While removing the
board from the solder bath, hot air is blown on both sides of the board through air knives in
the machines, leaving the board soldered and leveled. This is one of the common finishes
given to the boards. Thus the double sided plated through whole printed circuit board is
manufactured and is now ready for the components to be soldered.
7.2: Design Rule:
Rules followed while selecting artwork symbol are,
1. Minimum spacing between conductor and pad should be 0 .35 mm in 1:1 scale.
2. Minimum spacing between parallel conductors should be 0.4 mm in 1:1 scale.
3. The area of non-PTH solder pad should not be less than (5 sq.mm.).
4. The width of current carrying conductors should be determined for maximum temperature,
rise of 20 ْ�C.
General art work rules:
1. When there is higher conductor density assumes the conductors parallel to any one of the
edge of the board
2. When conductors have to be placed in other direction preference should be given to the 45
direction or to the 30 � / 60 � direction.
3. Whenever there is sufficient space available the conductors can be run in any direction so
as to achieve sorted possible interconnection.
4. As far as possible, design and the conductor on the solder pad. Conductor forming sharp
internal angles must be avoided.
5. When a member of conductor has to run between two pads the conductor lines are run
perpendicular w.r.to the center-to-center line of pair of pads.
6. Equally distributed spacing is to be provided when three or more conductors run along a
direction and / or between two pads.
7. Minimum spacing is provided when three or more lines run along a direction and / or
between two pads.
8. The diameter of solder pad should be approximately 8 times the drilled hole diameter.
7.3: TESTING:
Cold Test:
1. The first step was to carry out the visual inspection of the PCB. This means to check any
short or cut in the tracks on PCB. Find any missing pads if any where found on it. We did
mechanical repair of the same.
2. The second step involved the continuity testing. This means to check that the current is
flowing through all the tracks.
3. Thirdly testing solder of socket crystal & reset circuitry.
Test Result
[1] Give VCC and GND to microcontroller.
[2] Check voltage between 18 & 19 pins (XTAL 1, XTAL 2). It should be 2.5.
[3] Check available voltage pin 3.0-1.4. If all these voltage are coming then the
microcontroller is working properly.
[4] Check VCC and GND of LCD & write a RTN for display any message on LCD if the
message does not come check the supply again also check the data lines for any opens or
short.
µC Testing
Initially the µC is given the power supply. All the respective ports and port pins were
checked when the signals were proper, it means that all the µC signal were correct. If these
signals are not proper, we can check the signals from VCC ground, reset, circuit respectively.
Even after the above test if the signals are not proper it means that the purchased CPU is not
functioning properly & must be thrown.
1. We can put latch and memory in their respective sockets we wrote a small program
for the same then checked for numbers on port pin.
2. For the transmission of data stored in memory of µC. Various parameters of
communication port such as parity, data type baud rate were checked before the
transmission.
3. Accepting the data next step was to check that all the devices that are connected and
the program that was written to accept the data from the µC is successful or not. ff not
then the further modifications were done in the program.
The fig. below shows the layout of Microcontroller PCB
The fig. below shows the layout of Motor driver (L293D) and Power supply (5v & 12v)
The fig. below shows the layout of RS232 to TTL converter
SOFTWARE INTRODUCTION & CODING
6.1 INTRODUCTION TO KEIL MICRO VISION (IDE)
Keil an ARM Company makes C compilers, macro assemblers, real-time kernels,
debuggers, simulators, integrated environments, evaluation boards, and emulators for
ARM7/ARM9/Cortex-M3, XC16x/C16x/ST10, 251, and 8051 MCU families.
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 development. When starting a new project, simply select the
microcontroller you use from the Device Database and the µVision IDE sets all compiler,
assembler, linker, and memory options for you.
Keil is a cross compiler. So first we have to understand the concept of compilers and
cross compilers. After then we shall learn how to work with keil.
6.2 CONCEPT OF COMPILER
Compilers are programs used to convert a High Level Language to object code.
Desktop compilers produce an output object code for the underlying microprocessor, but not
for other microprocessors. I.E the programs written in one of the HLL like ‘C’ will compile
the code to run on the system for a particular processor like x86 (underlying microprocessor
in the computer). For example compilers for Dos platform is different from the Compilers for
Unix platform So if one wants to define a compiler then compiler is a program that translates
source code into object code.
The compiler derives its name from the way it works, looking at the entire piece of
source code and collecting and reorganizing the instruction. See there is a bit little difference
between compiler and an interpreter. Interpreter just interprets whole program at a time while
compiler analyses and execute each line of source code in succession, without looking at the
entire program.
The advantage of interpreters is that they can execute a program immediately.
Secondly programs produced by compilers run much faster than the same programs executed
by an interpreter. However compilers require some time before an executable program
emerges. Now as compilers translate source code into object code, which is unique for each
type of computer, many compilers are available for the same language.
6.3 CONCEPT OF CROSS COMPILER
A cross compiler is similar to the compilers but we write a program for the target
processor (like 8051 and its derivatives) on the host processors (like computer of x86). It
means being in one environment you are writing a code for another environment is called
cross development. And the compiler used for cross development is called cross compiler. So
the definition of cross compiler is a compiler that runs on one computer but produces object
code for a different type of computer.
6.4 KEIL C CROSS COMPILER
Keil is a German based Software development company. It provides several
development tools like
• IDE (Integrated Development environment)
• Project Manager
• Simulator
• Debugger
• C Cross Compiler, Cross Assembler, Locator/Linker
The Keil ARM tool kit includes three main tools, assembler, compiler and linker. An
assembler is used to assemble the ARM assembly program. A compiler is used to compile the
C source code into an object file. A linker is used to create an absolute object module suitable
for our in-circuit emulator.
6.5 Building an Application in µVision2
To build (compile, assemble, and link) an application in µVision2, you must:
1. Select Project -(forexample,166\EXAMPLES\HELLO\HELLO.UV2).
2. Select Project - Rebuild all target files or Build target.µVision2 compiles, assembles,
and links the files in your project.
6.6 Creating Your Own Application in µVision2
To create a new project in µVision2, you must:
1. Select Project - New Project.
2. Select a directory and enter the name of the project file.
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the
Device Database™.
4. Create source files to add to the project.
5. Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the
source files to the project.
6. Select Project - Options and set the tool options. Note when you select the target
device from the Device Database™ all special options are set automatically. You
typically only need to configure the memory map of your target hardware. Default
memory model settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
6.7 Debugging an Application in µVision2
To debug an application created using µVision2, you must:
1. Select Debug - Start/Stop Debug Session.
2. Use the Step toolbar buttons to single-step through your program. You may enter G,
main in the Output Window to execute to the main C function.
3. Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
6.8 Starting µVision2 and Creating a Project
µVision2 is a standard Windows application and started by clicking on the program
icon. To create a new project file select from the µVision2 menu Project – New Project….
This opens a standard Windows dialog that asks you for the new project file name. We
suggest that you use a separate folder for each project. You can simply use the icon Create
New Folder in this dialog to get a new empty folder. Then select this folder and enter the file
name for the new project, i.e. Project1. µVision2 creates a new project file with the name
PROJECT1.UV2 which contains a default target and file group name. You can see these
names in the Project.
6.9 Window – Files.
Now use from the menu Project – Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the µVision2 device data base. Just select the
microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This
selection sets necessary tool Options for the 80C51RD+ device and simplifies in this way the
tool Configuration.
6.10 Building Projects and Creating a HEX Files
Typical, the tool settings under Options – Target are all you need to start a new
application. You may translate all source files and line the application with a click on the
Build Target toolbar icon. When you build an application with syntax errors, µVision2 will
display errors and warning messages in the Output Window – Build page. A double click on
a message line opens the source file on the correct location in a µVision2 editor window.
Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. µVision2 creates HEX
files with each build process when Create HEX files under Options for Target – Output is
enabled. You may start your PROM programming utility after the make process when you
specify the program under the option Run User Program #1.
6.11 CPU Simulation
µVision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access. The µVision2 simulator traps
and reports illegal memory accesses. In addition to memory mapping, the simulator also
provides support for the integrated peripherals of the various 8051 derivatives. The on-chip
peripherals of the CPU you have selected are configured from the Device.
6.12 Database selection
You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using
the controls in the dialog boxes.
6.13 Start Debugging
You start the debug mode of µVision2 with the Debug – Start/Stop Debug
Session Command. Depending on the Options for Target – Debug Configuration, µVision2
will load the application program and run the startup code µVision2 saves the editor screen
layout and restores the screen layout of the last debug session. If the program execution stops,
µVision2 opens an editor window with the source text or shows CPU instructions in the
disassembly window. The next executable statement is marked with a yellow arrow. During
debugging, most editor features are still available.
For example, you can use the find command or correct program errors. Program
source text of your application is shown in the same windows. The µVision2 debug mode
differs from the edit mode in the following aspects:
_ The “Debug Menu and Debug Commands” described on page 28 are available. The
additional debug windows are discussed in the following.
_ The project structure or tool parameters cannot be modified. All build commands are
disabled.
6.14 Disassembly Window
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may be
displayed with Debug – View Trace Records. To enable the trace history, set Debug –
Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step
commands work on CPU instruction level rather than program source lines. You can select a
text line and set or modify code breakpoints using toolbar buttons or the context menu
commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target program you
are debugging. Numerous example programs are included to help you get started with the
most popular embedded 8051 devices.
The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN,
UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of
your 8051 device. Simulation helps you understand hardware configurations and avoids time
wasted on setup problems. Additionally, with simulation, you can write and test applications
before target hardware is available.
ALGORITHM
Start
Wait for RFID tag in the Vehicle
As soon as the tag reaches the toll gate
The reader reads the RFID tag and sends it to the microcontroller
Microcontroller compares it with the already stored number of the vehicle
After comparison it determines the type of vehicle
If the type of vehicle is LMV deduct 20Rs.
If the type of vehicle is HMV deduct 30Rs.
If the type of vehicle is STOLEN then generate a buzzer sound.
After deducting the amount from the user now the gate is opened.
Now the IR sensor is scanned to check whether the vehicle left the gate.
As soon the vehicle lefts the gate the Gate is closed.
The same thing is repeated forever
SOFTWARE (code)
#include <p89v51rx2.h>#include"lcd.h"#include"serial.h"#include"string.h"sbit col1=P1^4;sbit col2=P1^5;sbit col3=P1^6;sbit row1=P1^0;sbit row2=P1^1;sbit row3=P1^2;sbit row4=P1^3;
sbit mot_ina=P0^0;sbit mot_inb=P0^1;sbit sensor = P0^2;sbit buzzer = P1^7;//for storing the card id of the vehiclescode unsigned char card_lmv[12]="8400855A3F64";code unsigned char card_hmv[12]="8400855AB4EF";code unsigned char card_stolen[12]="8400855D663A";
unsigned char card_id[12]; //for storing the card id during serial receptionunsigned char recv_count=0; //no. of characters received
unsigned int balance_lmv=50;unsigned int balance_hmv=100;unsigned int balance_stolen=0;
unsigned char money[6]; //storing the recharge amount in the arrayunsigned int amount_cal=0; //interger value of the array moneyunsigned int multiplier=1;unsigned char lcd_pos=0;bit recharge_flag=0;//function for generating the delay of 1 msecvoid delay_ms(unsigned int msec){
unsigned int i;TMOD|=0X01;
for(i=0;i<msec;i++){
TH0=0XFC;TL0=0X77;TR0=1;while(!TF0);TR0=0;TF0=0;
}}//ISR for serial receptionvoid serial_isr(void) interrupt 4 using 2{
if(RI){
RI=0;card_id[recv_count++]=SBUF;
}}
unsigned char keypad(void){
//scanning the first rowrow1=row2=row3=row4=1;row1=0;if(col1==0){
delay_ms(32);if(col1==0){
while(!col1);return(1);
}}if(col2==0){
delay_ms(32);if(col2==0){
while(!col2);return(2);
}
}if(col3==0){
delay_ms(32);if(col3==0){
while(!col3);return(3);
}}//scanning the second rowrow1=row2=row3=row4=1;row2=0;if(col1==0){
delay_ms(32);if(col1==0){
while(!col1);return(1);
}}if(col2==0){
delay_ms(32);if(col2==0){
while(!col2);return(5);
}}if(col3==0){
delay_ms(32);if(col3==0){
while(!col3);return(6);
}}//scanning the third rowrow1=row2=row3=row4=1;row3=0;
if(col1==0){
delay_ms(32);if(col1==0){
while(!col1);return(7);
}}if(col2==0){
delay_ms(32);if(col2==0){
while(!col2);return(8);
}}if(col3==0){
delay_ms(32);if(col3==0){
while(!col3);return(9);
}}//scanning the fourth rowrow1=row2=row3=row4=1;row4=0;if(col1==0){
delay_ms(32);if(col1==0){
while(!col1);return('*');
}}if(col2==0){
delay_ms(32);if(col2==0)
{while(!col2);return(0);
}}if(col3==0){
delay_ms(32);if(col3==0){
while(!col3);return('#');
}}return('$');
}void lcd_display(unsigned int val,unsigned char x,unsigned char y){
unsigned char flg=0;unsigned char lcd;gotoxy(x,y);if(val==0)
lcd_data('0');while(val>0){
lcd=val%10;val=val/10;gotoxy(x,(y-flg));lcd_data(lcd+'0');flg++;
}
}void lcd_keypad(unsigned char keycode){
if(keycode=='#')recharge_flag=1;
else if(keycode<=9){
if(lcd_pos<6){
money[lcd_pos++]=keycode;
gotoxy(2,lcd_pos);lcd_data((money[lcd_pos-1]+'0'));
}}else if(keycode=='*'){
lcd_pos--;gotoxy(2,(lcd_pos+1));lcd_data(' ');gotoxy(2,(lcd_pos+1));
} }void disable_serial(void){
SCON=0X00;TH1=0x00;TR1=0;EA=0;ES0=0;
}void enable_serial(void){
SCON=0x50;TH1=-3;TR1=1;EA=1;ES0=1;
}void amount_convert(void){
unsigned char i;for(i=0;i<lcd_pos;i++){
amount_cal = amount_cal+money[(lcd_pos-1)-i]*multiplier;multiplier *= 10;
}}void recharge(unsigned char vehicleid){
unsigned char keycode;switch(vehicleid){
case 0: //for vehicle type LMV
while(!recharge_flag){
keycode=keypad();if(keycode!='$'){
lcd_keypad(keycode);}
}amount_convert();balance_lmv=balance_lmv+amount_cal;
// case 1: //for vehicle type HMV
}}void compare(void){
unsigned char i;for(i=0;i<12;i++){
if(card_id[i]!=card_lmv[i])break;
}if(i==12){
lclrscr();lprintf(" Thank You ");gotoxy(2,1);lprintf(" USER 1 ");delay_ms(1500);lclrscr();lprintf(" Vehicle Type ");gotoxy(2,1);lprintf(" LMV ");delay_ms(1500);lclrscr();lprintf(" Account Bal. ");lcd_display(balance_lmv,2,13);gotoxy(2,14);lprintf(".001");delay_ms(1500);if(balance_lmv<20)
{lclrscr();lprintf(" Recharge ");gotoxy(2,1);lprintf("Your account now");delay_ms(1500);lclrscr();lprintf("Recharge Amount");recharge(0);delay_ms(1000);lclrscr();lprintf(" Account Bal. ");lcd_display(balance_lmv,2,13);gotoxy(2,14);lprintf(".001");delay_ms(1500);
}balance_lmv-=20;lclrscr();lprintf("Charge 20.00");gotoxy(2,1);lprintf("Amt. left");lcd_display(balance_lmv,2,13);gotoxy(2,14);lprintf(".001");delay_ms(1500);
}else{
for(i=0;i<12;i++){
if(card_id[i]!=card_hmv[i])break;
}if(i==12){
lclrscr();lprintf("HMV VEHICLE");
}else{
for(i=0;i<12;i++){
if(card_id[i]!=card_stolen[i])break;
}if(i==12){
lclrscr();lprintf("STOLEN VEHICLE");
}else{
lclrscr();lprintf("Unknown Card ID");
}}
}}void main(void){
lcd_init();lprintf(" Welcome To ");gotoxy(2,1);lprintf("Vidyalankar Poly");delay_ms(1500);lclrscr();lprintf("RFID BASED TOLL");gotoxy(2,1);lprintf(" TAX SYSTEM ");delay_ms(1500);lclrscr();lprintf("Project Done By:");gotoxy(2,1);lprintf("****************");delay_ms(1500);lclrscr();lprintf("1. Shruthi ");gotoxy(2,1);lprintf("2. Tejas ");delay_ms(1500);lclrscr();lprintf("3. Gaurav ");delay_ms(1500);lclrscr();lprintf("Under Guidance..");
gotoxy(2,1);lprintf("Prof. Sandhya ");delay_ms(1500);lclrscr();lprintf("RFID Card No.");serial_init(9600);EA=1;ES0=1;P1=0xff;while(1){
if(recv_count==12){
recv_count=0;disable_serial();compare();enable_serial();
}}
}
Advantages:
No "line of sight" requirements: Bar code reads can sometimes be limited or
problematic due to the need to have a direct "line of sight" between a scanner and a
bar code. RFID tags can be read through materials without line of sight.
More automated reading: RFID tags can be read automatically when a tagged product
comes past or near a reader, reducing the labor required to scan product and allowing
more proactive, real-time tracking.
Improved read rates: RFID tags ultimately offer the promise of higher read
rates than bar codes, especially in high-speed operations such as carton sortation.
Greater data capacity: RFID tags can be easily encoded with item details such as lot
and batch, weight, etc.
Reducing human efforts.
Faster in process.
It eliminates non value added operator task for data collection.
It replaces redundant.
provides security for vehicle
It is consistent 24 hours a day without additional mechanical or human i/p.
The tags can be rewritten repeatedly or use for permanent data storage.
The stored information can be protected with a range of security options.
RFID functions through both natural & man-made non-metallic materials.
Adaptability :
The tags can work in various environments, in different sizes and shapes,
without modification.
Disadvantages:
Some common problems with RFID are reader collision and tag collision. Reader
collision occurs when the signals from two or more readers overlap.
The tag is unable to respond to simultaneous queries. Systems must be carefully set
up to avoid this problem.
Tag collision occurs when many tags are present in a small area; but since the read
time is very fast, it is easier for vendors to develop systems that ensure that tags respond one
at a time.
Applications:
It can be used in TOLL GATE.
It can also be used for license recognition
Future Expansion:
We can also add a GSM modem to the system which can be used as an
acknowledgement as soon the amount is detected the vehicle owner is informed regarding the
deduction of amount with the help of a SMS.
By Implementing the GSM modem we can also inform the user if the stolen car has
reached the TOLL tax system by sending a SMS indicating that the stolen vehicle has
reached the Toll tax system
BILL OF MATERIAL
SR NO COMPONENT QTY COST1 RFID READER MODULE 1 1500
2 MICROCONTROLLER AT 89S52
1 120
3 LCD DISPLAY 1 1504 REGULATOR ICS 2 20
5 RESISTORS 10 106 CAPACITORS 20 807 Diode In 4007 4 48 Transformer 1 1409 IC L293D 1 8010 IC MAX232 1 1511 IC SOCKET 3 4012 PCB DEVELOPMENT 4 120013 DC MOTORS 1 35014 KEYPAD 4X3 1 16015 CRYSTAL 1 516 SWITCHES 2 1017 IR Sensor Module 1 15018 Miscellaneous 1000
TOTAL 5034
REFERENCES
Tedjasaputra, Adi (2007-07-14). Sustainable Growth of RFID Supply Chain Markets. RFID Asia. Retrieved on 2007-08-03.
Radio Frequency Identification: An Introduction for Library Professionals. Alan Butters. Australasian Public Libraries v19.n4(2006) pp.2164–174.
The State of RFID Applications in Libraries." Jay Singh et al. Information Technology & Libraries no.1(Mar.2006) pp.24–32.
Blanchard, D. (2005), "Rfid Is Off and Running at Wal-Mart," Logistics Today, 46 (2), pp. 1, 10.
Davis, H. E. and M. S. Luehlfing (2004), "Radio Frequency Identification: The Wave of the Future," Journal of Accountancy, 198 (5), pp. 43-49.
"Rfid Journal," (2006), www.rfidjournal.com, Retrieved 2006.
RFID - International Symposium on Communications and Information Technologies, 2007. ISCIT '07.
BOOKS
8051 Microcontroller - by Kenneth J. Ayala
8051 Microcontroller – by Predko
Linear Integrated Circuits – by Ramakant Gayakwad
Visual Basic.Net – by Jeffrey R. Shapiro
Let us C – by Yeshwant Kanetkar
RFID Handbook Fundamentals and Applications in Contactless Smart Cards and
Identification by Klaus Finkenzeller, Wiley and Sons publications.