Вы находитесь на странице: 1из 101

RFID BASED SHOPPING TROLLEY

RFID Based Shopping Trolley

SYNOPSIS:

The objective of this project is to improve the speed of purchase

by using RFID. This project is designed to use the RFID based security

system application in the shopping trolley.

This project is used in shopping complex for purchase the

products. In this project RFID card is used as security access for product. If

the product is put in to the trolley means it will shows the amount and also

the total amount. But in this project RFID card is used for accessing the

products. So this project improves the security performance and also the

speed.

~1~
RFID BASED SHOPPING TROLLEY

CHAPTER – I
1.1. INTRODUCTION:

RFID is the special type wireless card which has inbuilt the
embedded chip along with loop antenna. The inbuilt embedded chip
represents the 12 digit card number. RFID reader is the circuit which
generates 125KHZ magnetic signal. This magnetic signal is transmitted by
the loop antenna connected along with this circuit which is used to read the
RFID card number.
In this project RFID card is used as security access card. So each
product has the individual RFID card which represents the product name.
RFID reader is interfaced with microcontroller. Here the microcontroller is
the flash type reprogrammable microcontroller in which we already
programmed with card number. The microcontroller is interfaced with
keypad.

~2~
RFID BASED SHOPPING TROLLEY

1.2.

~3~
RFID BASED SHOPPING TROLLEY

This project is designed with

 RFID tag

 RFID reader

 Microcontroller

 Driver circuit

 Alarm

 Relay.

~4~
RFID BASED SHOPPING TROLLEY

1.3. CIRCUIT DIAGRAM

RF RX

MA
X PC
232

~5~
1.4. HISTORY:

In 1946 Léon Theremin invented an espionage tool for the Soviet Union
which retransmitted incident radio waves with audio information. Sound
waves vibrated a diaphragm which slightly altered the shape of the resonator,
which modulated the reflected radio frequency. Even though this device was
a passive covert listening device, not an identification tag, it has been
attributed as a predecessor to RFID technology. The technology used in
RFID has been around since the early 1920s according to one source
(although the same source states that RFID systems have been around just
since the late 1960s)

Similar technology, such as the IFF transponder invented in the United


Kingdom in 1939, was routinely used by the allies in World War II to
identify aircraft as friend or foe. Transponders are still used by most powered
aircraft to this day.

Another early work exploring RFID is the landmark 1948 paper by


Harry Stockman, titled "Communication by Means of Reflected Power"
(Proceedings of the IRE, pp 1196–1204, October 1948). Stockman predicted
that "…considerable research and development work has to be done before
the remaining basic problems in reflected-power communication are solved,
and before the field of useful applications is explored."

Mario Cardullo's U.S. Patent 3,713,148 in 1973 was the first true
ancestor of modern RFID; a passive radio transponder with memory. The
initial device was passive, powered by the interrogating signal, and was
demonstrated in 1971 to the New York Port Authority and other potential
users and consisted of a transponder with 16 bit memory for use as a toll
device. The basic Cardullo patent covers the use of RF, sound and light as
transmission media. The original business plan presented to investors in
~4~
1969 showed uses in transportation (automotive vehicle identification,
automatic toll system, electronic license plate, electronic manifest, vehicle
routing, vehicle performance monitoring), banking (electronic check book,
electronic credit card), security (personnel identification, automatic gates,
surveillance) and medical (identification, patient history).

A very early demonstration of reflected power (modulated


backscatter) RFID tags, both passive and semi-passive, was performed by
Steven Depp, Alfred Koelle and Robert Freyman at the Los Alamos National
Laboratory in 1973[2]. The portable system operated at 915 MHz and used
12-bit tags. This technique is used by the majority of today's UHFID and
microwave RFID tags.

The first patent to be associated with the abbreviation RFID was granted to
Charles Walton in 1983

1.5. INTRODUCTION TO RIFD

Libraries began using RFID systems to replace their electro-magnetic


and bar code systems in the late 1990s. Approximately 130 libraries in North
America are using RFID systems, but hundreds more are considering it
(Molnar, Wagner, 2004). The primary cost impediment is the price of each
individual tag. Today, tags cost approximately seventy-five cents but prices
continue to fall. However, privacy concerns associated with item-level
tagging is another significant
Impediment to library use of RFID tags. The problem with today’s library
RFID systems is that the tags contain static information that can be relatively
easily read by unauthorized tag readers. This allows for privacy issues
described as “tracking” and “hot listing.” Tracking refers to the ability track
the movement of a book (or person carrying the book) by “correlating
multiple observations of the book’s bar code” (Molnar and Wagner, 2004) or
RFID tag. Hot listing refers to process of building a database of books and
~5~
their associated tag numbers (the holist) and then using an unauthorized
reader to determine, who is checking out items on the hot list.
Current standards (ISO 15693) apply to container-level tagging used
in supply chain applications, and do not address problems of tracking and
hot listing. Next generation tags (ISO 18000) are designed for item-level
tagging. The newer tags are capable of resolving many of privacy problems
of today’s tags. However, no library RFID products are currently available
using the new standard. Libraries implementing RFID systems today are
using tags unsuited for item-level tagging and the cost of upgrading to newer
tags when they become available is well beyond the reach of most library
budgets. This chapter addresses many of the specific issues and privacy
concerns associated with RFID technology in libraries, and suggest best
RFID-implementation practices for librarians. Finally, we explore the larger
responsibilities of libraries in regards to RFID, public policy, privacy and the
changing world of technology.

i. RFID System Components and Their Effects in Libraries


An RFID system consists of three components: the tag, the reader and
the application that makes use of the data the reader reads on the tag. Tag
Also known as a transponder, the tag consists of an antenna and silicon chip
encapsulated in glass or plastic (Want, 2004). The tags contain a very small
amount of information. For example, many tags contain only a bar code
number and security bit (128 bits) but some tags contain as much as 1,024
bits (Boss, 2003). Tags range in size from the size of a grain of rice to two
inch squares depending on their application. Researchers are now working
on tags as small as a speck of dust (Cavoukian, February 2004). Tags can be
passive, active or semi-active. An active tag contains some type of power
source on the tag, whereas the passive tags rely on the radio signal sent by
the reader for

~6~
Power. Most RFID applications today utilize passive tags because they are so
much cheaper to manufacture. However, the lack of power poses significant
restrictions on the tag’s ability to perform computations and communicate
with the reader. It must be within range of the reader to function. Semi-active
tags are not yet commercially available but will use a battery to run the
microchip’s circuitry but not to communicate with the reader. Semi-active
tags rely on
Capacitive coupling and carbon ink for the antennas rather than the
traditional inductive coupling and silver or aluminum antenna used in
passive tags (Collins, 2004). Tags operate over a range of frequencies.
Passive tags can be low frequency (LF) or high frequency (HF). LF tags
operate at 125 KHz, are relatively expensive, and have a low read range (less
than 0.5 meters). HF tags operate at 13.56 MHz, have a longer read range
(approximately 1 meter) and are less expensive that LF tags. Most library
applications use HF tags (Allied Business Intelligence [ABI], 2002). Tags
can be Read Only (RO), Write Once Read Many (WORM) or Read Write
(RW) (Boss, 2003). RO tags are preprogrammed with a unique number like a
serial number (or perhaps eventually an ISBN number). WORM tags are
preprogrammed but additional information can be added if space permits.
RW tags can be updated dynamically. Sometimes space on the RW tags is
locked where permanent data is kept and the rest of the tag is writable.
According to Sharma et al. (2002), RFID readers or receivers are
composed of a radio frequency module, a control unit and an antenna to
interrogate electronic tags via radio frequency (RF) communication. Many
also include an interface that communicates with an application (such as the
library’s circulation system). Readers can be hand-held or mounted in
strategic locations so as to ensure they are able to read the tags as the tags
pass through an “interrogation zone.” The interrogation zone is the area
within which a reader can read the tag. The size of the interrogation zone
varies depending on the type of tag and the power of the reader. Passive tags,
~7~
with shorter read ranges, tend to operate within a smaller interrogation zone
(Sarma, et al., 2002). Most RFID readers in libraries can read tags up to 16
inches away (Boss, 2003). 1. Conversion station – Where library data is
written to the tags
2. Staff workstation at circulation – Used to check-in and check-out
materials
3. Patron self check-out station – Used to check-out books without staff
assistance
4. Exit sensors – Verify that all books leaving the library have been checked
out
5. Patron self check-in station – Used to check in books without staff
assistance
6. Book drop reader – Checks in books when patrons drop them in the book
drop
7. Sorter – Automated system for returning books to proper area of library
8. Portable reader – Hand-held reader for inventorying and verifying that
items are shelved correctly.
II. APPLICATION
Once the reader reads the tag, the information is passed on to an
“application” that makes use of the information. Examples of applications
and their uses fall into at least six categories:
1. Access control (keyless entry)
2. Asset tracking (self check-in and self check-out)
3. Asset tagging and identification (inventory and shelving)
4. Authentication (counterfeit prevention)
5. Point-of-sale (POS) (FastTrak)
6. Supply chain management (SCM)
(tracking of containers, pallets or individual items from manufacturer to
retailer) RFID is most pervasive in the SCM market. ABI (2002) reports that
by 2007, SCM and asset management applications will account for more
~8~
than 70% of all transponder (tag) shipments. In the SCM market, items are
tracked by pallet or container, not by individual item. Once the individual
items are removed from the pallet, they are no longer tagged. In contrast,
library applications require that each individual item contain a tag that
uniquely identifies the item (book, CD, DVD, etc). The tag contains some
amount of static data (bar code number, manufacturer ID number) that is
permanently affixed to the library item. This information is conveyed, via
reader, to the library’s security, circulation and inventory applications.

1.6. RFID TAGS

RFID tags come in three general varieties:- passive, active, or semi-


passive (also known as battery-assisted or semi-active) and beacon types.
Passive tags require no internal power source, thus being pure passive
devices (they are only active when a reader is nearby to power them by
wireless illumination), whereas semi-passive and active tags require a power
source, usually a small battery. Beacon tags transmit autonomously with a
certain blink pattern and do not respond to interrogation.

To communicate, tags respond to queries generating signals that must


not create interference with the readers, as arriving signals can be very weak
and must be differentiated. Besides backscattering, load modulation
techniques can be used to manipulate the reader's field. Typically,
backscatter is used in the far field, whereas load modulation applies in the
near field, within a few wavelengths from the reader.

I. PASSIVE

Passive RFID tags have no internal power supply. The minute electrical
current induced in the antenna by the incoming radio frequency signal
provides just enough power for the CMOS integrated circuit in the tag to
power up and transmit a response. Most passive tags signal by backscattering

~9~
the carrier wave from the reader. This means that the antenna has to be
designed both to collect power from the incoming signal and also to transmit
the outbound backscatter signal. The response of a passive RFID tag is not
necessarily just an ID number; the tag chip can contain non-volatile data,
possibly writable EEPROM for storing data.

Passive tags have practical read distances ranging from about 11 cm (4 in)
with near-field (ISO 14443), up to approximately 10 meters (33 feet) with
far-field (ISO 18000-6) and can reach up to 183 meters (600 feet) [5] when
combined with a phased array. Basically, the reading and writing depend on
the chosen radio frequency and the antenna design/size. Due to their
simplicity in design they are also suitable for manufacture with a printing
process for the antennas. The lack of an onboard power supply means that
the device can be quite small: commercially available products exist that can
be embedded in a sticker, or under the skin in the case of low frequency
(LowFID) RFID tags.

In 2007, the Danish Company RFIDsec developed a passive RFID with


privacy enhancing technologies built-in including built-in firewall access
controls, communication encryption and a silent mode ensuring that the
consumer at point of sales can get exclusive control of the key to control the
RFID. The RFID will not respond unless the consumer authorizes it, the
consumer can validate presence of a specific RFID without leaking
identifiers and therefore the consumer can make use of the RFID without
being trackable or otherwise leak information that represents a threat to
consumer privacy.

In 2006, Hitachi, Ltd. developed a passive device called the µ-Chip


measuring 0.15×0.15 mm (not including the antenna), and thinner than a
sheet of paper (7.5 micrometers).Silicon on insulator (SOI) technology is
used to achieve this level of integration. The Hitachi µ-Chip can wirelessly
~ 10 ~
transmit a 128-bit unique ID number which is hard-coded into the chip as
part of the manufacturing process. The unique ID in the chip cannot be
altered, providing a high level of authenticity to the chip and ultimately to
the items the chip may be permanently attached or embedded into. The
Hitachi µ-Chip has a typical maximum read range of 30 cm (1 ft). In
February 2007 Hitachi unveiled an even smaller RFID device measuring
0.05×0.05 mm, and thin enough to be embedded in a sheet of paper. The new
chips can store as much data as the older µ-chips, and the data contained on
them can be extracted from as far away as a few hundred meters. The
ongoing problems with all RFIDs are that they need an external antenna
which is 80 times bigger than the chip in the best version thus far developed.
Further, the present costs of manufacturing the inlays for tags have inhibited
broader adoption. As silicon prices are reduced and new more economic
methods for manufacturing inlays and tags are perfected in the industry,
broader adoption and item level tagging along with economies of scale
production scenarios; it is expected to make RFID both innocuous and
commonplace much like barcodes are presently.

Alien Technology's Fluidic Self Assembly and HiSam machines, Smart


code’s Flexible Area Synchronized Transfer (FAST) and Symbol
Technologies' PICA process are alleged to potentially further reduce tag
costs by massively parallel production[citation needed]
. Alien Technology and
Smart Code are currently using the processes to manufacture tags while
Symbol Technologies' PICA process is still in the development phase.
Symbol was acquired by Motorola in 2006. Motorola however has since
made agreements with Avery Dennison for supply of tags, meaning their
own tag production and PICA process may have been abandoned. [9]
Alternative methods of production such as FAST, FSA, HiSam and possibly
PICA could potentially reduce tag costs dramatically, and due to volume
capacities achievable, in turn be able to also drive the economies of scale

~ 11 ~
models for various silicon fabricators as well. Some passive RFID vendors
believe that industry benchmarks for tag costs can be achieved eventually as
new low-cost volume production systems are implemented more broadly.
(For example, see [4])

Non-silicon tags made from polymer semiconductors are currently being


developed by several companies globally. Simple laboratory-printed polymer
tags operating at 13.56 MHz were demonstrated in 2005 by both PolyIC
(Germany) and Philips (The Netherlands). If successfully commercialized,
polymer tags will be roll-printable, like a magazine, and much less expensive
than silicon-based tags. The end game for most item-level tagging over the
next few decades may be that RFID tags will be wholly printed – the same
way that a barcode is today – and be virtually free, like a barcode. However,
substantial technical and economic hurdles must be surmounted to
accomplish such an end: hundreds of billions of dollars have been invested
over the last three decades in silicon processing, resulting in a per-feature
cost which is actually less than that of conventional printing.

II. ACTIVE

Unlike passive RFID tags, active RFID tags have their own internal power
source, which is used to power the integrated circuits and to broadcast the
response signal to the reader. Communications from active tags to readers is
typically much more reliable (i.e. fewer errors) than those from passive tags
due to the ability for active tags to conduct a "session" with a reader.

Active tags, due to their onboard power supply, also may transmit at higher
power levels than passive tags, allowing them to be more robust in "RF
challenged" environments with humidity and spray or with RF-dampening
targets (including humans and cattle, which contain mostly water), reflective
targets from metal (shipping containers, vehicles), or at longer distances. In

~ 12 ~
turn, active tags can be larger (due to battery size) and more expensive to
manufacture (due to price of the battery). However, the potential shelf life of
an active tag can be many years.

Many active tags today have operational ranges of hundreds of meters, and a
battery life from several months to 10 years. Active tags may include larger
memories than passive tags, and may include the ability to store additional
information received from the reader.

Special active RFID tags may include specialized sensors. For example, a
temperature sensor can be used to record the temperature profile during the
transportation and storage of perishable goods. Other sensor types used
include humidity, shock/vibration, light, nuclear radiation, pressure and
concentrations of gases such as ethylene.

Increasingly, active tags on the market today are internationally standardized


according to the ISO 18000-7 air interface standard, which operates at the
433 MHz frequency. In addition, active tags that are sold in the form of an
electronic seal are standardized according to the ISO 18185 standard.

The United States Department of Defense (DoD) has successfully used


active tags to reduce search and loss in logistics and to improve supply chain
visibility for more than 15 years (concept of in-transit-visibility, ITV[5]).
The DoD is increasingly relying on active tags to monitor the environmental
status of assets and material using onboard sensors.

Extended capability

Extended capability RFID defines a category of RFID that goes beyond the
basic capabilities of standard RFID as merely a "license plate" or barcode
replacement technology. Key attributes of extended capability RFID include
the ability to read at longer distances and around challenging environments,

~ 13 ~
to store large amounts of data on the tag, to integrate with sensors, and to
communicate with external devices.

Examples of extended capability RFID tag technologies include EPC C1G2


with extended memory (e.g. 64Kb), battery-assisted passive, and active
RFID. Battery-assisted passive, also known as semi-passive or semi-active,
has the ability to extend the read range of standard passive technologies to
well over 50 meters, to read around challenging materials such as metal, to
withstand outdoor environments, to store an on-tag database, to be able to
capture sensor data, and to act as a communications mechanism for external
devices. Also, battery-assisted passive only transmits a signal when
interrogated, thus extending battery life. Active RFID, which can have some
of the features of battery-assisted passive, is commonly used for even longer
distances and real-time locationing. It also actively transmits a signal, which
often results in shorter battery life.

Common applications of extended capability RFID include Yard


Management, Parts Maintenance and Repair Operations, Cold-Chain
Management, Reusable Transport Items tracking, High Value/High Security
Asset tracking, and other applications where extended capabilities are
needed.

1.7. WORKING PRINCIPLE

i. RFID DETAILS

Radio frequency identification (commonly abbreviated to RFID) is so-named

because it relates to the identification of objects using EM radiation at radio

frequencies. In Table 2 we saw that a large range of frequencies within the

EM spectrum are referred to as radio


~ 14 ~
Frequencies (RF), which results in a number of different forms of RFID.

Once again, RFID systems may be categorized based on the band of the EM

spectrum that they operate in. RFID systems in the same band will generally

display similar characteristics; those in other bands may well operate very

differently and therefore be more or less suitable for a given application. An

RFID system comprises two components – an RFID reader and an RFID tag.

Despite its name, the RFID reader is really the transmitter in an RFID

system. The electronics in the reader uses an external power source to

generate the signal that drives the reader’s antenna and which in turn creates

the appropriate radio wave. This radio wave may be received by an RFID

tag, which in turn ‘reflects’ some of the energy it receives in a particular way

(based on the identity of the tag). Whilst this reflection is going on, the RFID

reader is also acting as a radio receiver, so that it can detect and decode the

reflected signal in order to identify the tag.

~ 15 ~
An RFID system is specifically designed to be asymmetric – the

reader is big, expensive and power hungry compared to the RFID tag. There

are a number of different types of RFID system, but one basic categorization

is based on the power source used by the tag

1. Passive tag RFID systems require no power source at the tag – there

is no battery. Instead, the tag uses the energy of the radio wave to power its

operation, much like a crystal radio. This results in the lowest tag cost, but at

the expense of performance.

2. Semi-passive tag RFID systems rely on a battery built into the tag

in order to achieve better performance (typically in terms of operating

range). The battery powers the internal circuitry of the tag during

communication, but is not used to generate radio waves.

~ 16 ~
3. Active tag systems use batteries for their entire operation, and can

therefore generate radio waves proactively, even in the absence of an RFID

reader.

Passive tag RFID systems are the most common type, and are often referred

to simply as ‘RFID systems’.

1.8. RANGE OF RFID SYSTEMS

With an RFID system, the term range naturally refers to the maximum

operating distance between the reader antenna and the tag, and the field of

the reader is the specific operating area. The frequency of operation used for

an RFID system has a big effect on the operating range. Analysis of the

physics of RFID communications shows that the optimum frequency is

around 400-500MHz [9]. Such analysis cannot be made generically - there

are a number of factors to take into account and these will have different

effects based on the intended application. Example factors that will be

affected

by the choice of frequency include: size of tag antenna, ease of power

delivery to the tag, ease of communication of tag back to reader, cost and

speed of communication.

The range of RFID systems operating in the UHF band is governed largely

by the principles outlined. This means that the ability of the reader to power

and communicate to the tag is based on the inverse square law (1/r ), as will

the return path of reflected signals from the tag to the reader. Operation will

~ 17 ~
also be affected by environmental conditions and interference from other

radio sources at the same frequency. RFID systems that operate in the HF

band of the spectrum work in a very different way to those using the UHF

band and it is useful to understand this fundamental difference and the effect

it has on operating range. If communication occurs over a short distance,

relative to the wavelength of the radio wave, this is said to be near-field

operation. Since HF (3-30MHz) RFID systems use waves with a wavelength

of around

10-100m, if the distance of the communication is much less than this (which

is the case in RFID) then this is a near-field communication. Near-field

communication is based on a magnetic field effect, which has an inverse

sixth power (1/r ) relationship with range.

Of course, if a directional antenna is used, its radiation pattern will also

affect the reader field.

CHAPTER – 2

2.1 CONCEPTS OF MICROCONTROLLER:


The AT89V51 is a low-power, high-performance CMOS
8-bit microcomputer with 8K bytes of Flash programmable and erasable read only
memory (PEROM). The on-chip Flash allows the program memory to be reprogrammed
in-system or by a Conventional nonvolatile memory programmer.

~ 18 ~
FIGURE 2.5

Features:
 Compatible with MCS-51™ Products
 8K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz

~ 19 ~
 Three-level Program Memory Lock
 256 x 8-bit Internal RAM
 32 Programmable I/O Lines
 Three 16-bit Timer/Counters
 Eight Interrupt Sources
 Full Duplex Serial port.
 On chip oscillator and clock circuitry.
 Low-power Idle and Power-down Modes.

2.1.2.1 Pin Description

VCC - Supply voltage.

GND - Ground.

Port 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 can 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 pullups. Port
0 also receives the code bytes during Flash programming and outputs the code bytes
during program verification. External pullups are required during program verification.

Port 1 - Port 1 is an 8-bit bi-directional I/O port with internal pullups. 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 pullups 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 pullups.

In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively.Port 1
also receives the low-order address bytes during Flash programming and verification.

Port 2 - Port 2 is an 8-bit bi-directional I/O port with internal pullups. 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 pullups 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 pullups.

~ 20 ~
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that use 16-bit address. In this application,
Port 2 uses strong internal pullups when emitting 1s. During accesses to external data
memory that use 8-bit addresses, 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 3 - Port 3 is an 8-bit bi-directional I/O port with internal pullups. 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 pullups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pullups. Alternate.
functions of PORT 3 are as shown in the table

Port 3 pins Alternate Functions

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)

TABLE 2.2

Port 3 Alternate Functions

~ 21 ~
RFID BASED SHOPPING
TROLLEY

AT89S52 SFR map and reset values

RST - Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.

ALE/PROG - Address Latch Enable is an 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.

PSEN - Program Store Enable is the read strobe to external program memory. When the
AT89C52 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 - 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. EA should be strapped to VCC for internal program executions.

~ 22 ~
RFID BASED SHOPPING
TROLLEY

This pin also receives the 12-volt programming enable voltage (V PP) during Flash
programming when 12-volt programming is selected.

XTAL1 - Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.

XTAL2 - Output from the inverting oscillator amplifier

2.1.2.2 Absolute maximum ratings of AT89c52

TABLE 2.3
2.1.2.2 DC Characteristics

~ 23 ~
RFID BASED SHOPPING
TROLLEY

TABLE 2.4

2.3 AT89V51 MICROCONTROLLER

2.3.1 FEATURES

 Internal Timers/Event Counters


 2-Level Interrupt Priority Structure

 32 I/O Lines (Four 8-Bit Ports)

 64K Program Memory Space

 Security Features Protects EPROM Parts Against Software Piracy

 Boolean Processor

 Bit-Addressable RAM

~ 24 ~
RFID BASED SHOPPING
TROLLEY
 Programmable Full Duplex Serial Channel

 111 Instructions (64 Single-Cycle)

 64K Data Memory Space

Block Diagram of AT89V51

~ 25 ~
RFID BASED SHOPPING
TROLLEY

Figure 2.11 Internal Block Diagram of AT89S52

~ 26 ~
RFID BASED SHOPPING
TROLLEY

2.3.3 Types of Memory

The 8051 has three very general types of memory. To effectively program the 8051
it is necessary to have a basic understanding of these memory types.
 On-Chip Memory refers to any memory (Code, RAM, or other) that
physically exists on the microcontroller itself. On-chip memory can be of
several types, but we'll get into that shortly.
 External Code Memory is code (or program) memory that resides off-chip.
This is often in the form of an external EPROM.
 External RAM is RAM memory that resides off-chip. This is often in the
form of standard static RAM or flash RAM.

FIGURE 2.12 Memory Types

 Code Memory

~ 27 ~
RFID BASED SHOPPING
TROLLEY
Code memory is the memory that holds the actual 8051 program that is to be
run. This memory is limited to 64K and comes in many shapes and sizes: Code
memory may be found
on-chip, either burned into the microcontroller as ROM or EPROM. Code may also
be stored

completely off-chip in an external ROM or, more commonly, an external EPROM.


Flash RAM is also another popular method of storing a program. Various
combinations of these memory types may also be used--that is to say, it is possible to
have 4K of code memory on-chip and 64k of code memory off-chip in an EPROM.
When the program is stored on-chip the 64K maximum is often reduced to
4k, 8k, or 16k. This varies depending on the version of the chip that is being used.
Each version offers specific capabilities and one of the distinguishing factors from
chip to chip is how much ROM/EPROM space the chip has.

 External RAM

As an obvious opposite of Internal RAM, the 8051 also supports what


is called External RAM. As the name suggests, External RAM is any random
access memory which is found off-chip. Since the memory is off-chip it is
not as flexible in terms of accessing, and is also slower. For example, to
increment an Internal RAM location by 1 requires only 1 instruction and 1
instruction cycle. To increment a 1-byte value stored in External RAM
requires 4 instructions and 7 instruction cycles. In this case, external memory
is 7 times slower! What External RAM loses in speed and flexibility it gains
in quantity. While Internal RAM is limited to 128 bytes the 8051 supports
External RAM up to 64K.

 On-Chip Memory
As mentioned at the beginning of this chapter, the 8051 includes a certain
amount of on chip memory. On-chip memory is really one of two (SFR)
memory. The layout of the 8051's internal memory is presented in the following
memory map: The 128 bytes of internal ram is subdivided as shown on the
memory map. The first 8 bytes (00h - 07h) are "register bank 0". By

~ 28 ~
RFID BASED SHOPPING
TROLLEY
manipulating certain SFRs, a program may choose to use register banks 1, 2, or
3. These alternative register banks are located in internal RAM in addresses 08h
through 1Fh.
Bit memory actually resides in internal RAM, from addresses 20h through
2Fh. The 80 bytes remaining of Internal RAM, from addresses 30h through 7Fh,
may be used by user variables that need to be accessed frequently or at high-
speed. This area is also utilized by the microcontroller as a storage area for the
operating stack. This fact severely limits the 8051’s stack since, as illustrated in
the memory map, the area reserved for the

stack is only 80 bytes--and usually it is less since this 80 bytes has to be shared
between the stack and user variables.

3.3 Serial communication

In some cases, such as printers, the information is simply grabbed from the 8
bit data bus and presented to the 8 bit data bus of the printer. This can work only if
the is not too long, since long cables diminish and even distort
signals.Furthermore,an 8 bit data bus is expensive. For these reasons, serial
communication is used for transferring data between two systems located at
distances of hundreds of feet to millions of miles apart. The fact that serial;
communication uses a single data line instead of 8 bit data line of parallel
communication not only makes it cheaper but also enables two computers located in
two different cities to communicate over the telephone.

For serial data communication to work, the byte of data must be converted to
serial bits using parallel-in-serial out shift register. then it can transmitted over a
single line. In the receiving end there must be a serial-in-parallel out shift register to
receive serial data and pack them in to bytes.

~ 29 ~
RFID BASED SHOPPING
TROLLEY
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.

3.3.1 Half and full duplex transmission

In data transmission if the data can be transmitted and received, it is a duplex


transmission. This is in contrast to simplex transmission such as with printers, in
which the computer only sends the data. If data is transmitted one way at a time, it is
referred to as half duplex. If the data can go both the ways at the same time, it is full
duplex.

3.3.2 Asynchronous serial communication and data framing

The data coming in at 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 the
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.
Asynchronous serial data transmission is widely used for character oriented
transmission, while block oriented transmission use synchronous method. In
asynchronous method, each character is placed between start and stop bits. This is
called framing. In data framing 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 stop bit(s) is 1(high).When there is no
transfer of data, the signal is 1(high),which is referred to as mark. The low is
referred to as space. The transmission begins with a start bit followed by D0,which
is LSB,then the rest of the bits until MSB(D7),and finally, one or two stop bits
indicating the end of the character.

Assuming that we are transferring a text file of ASCII characters using one
stop bit, we have a total of 10 bits for each charcter; 8bits for the ASCII code and
one bit each for start and stop bits which gives 20% overhead.

~ 30 ~
RFID BASED SHOPPING
TROLLEY

3.3.3 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. Baud rate is defined
as the number of signal changes per second.

3.3.4 RS232 standards

Today,RS232 is the most widely used serial I/O interfacing standard. This
standard is used in PCs and numerous types of equipments. Since the standard was
set long before the advent of TTL logic family, its input and output voltage levels are
not TTL compatible. In RS232,a 1 is represented by -3 to -25 V, while a 0 bit is +3
to +25V.For this reason, to connect any RS232 to a microcontroller 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 chip are commonly referred to
as line drivers.
The RS232 cables are also referred to as DB-25 connector. Since not all the
pins are used in PC cables, IBM introduces the DB-9 version of serial I/O standard,
which uses 9 pins only.

~ 31 ~
RFID BASED SHOPPING
TROLLEY

Fig 3.7: Db-9 connector

Pin Description

~ 32 ~
RFID BASED SHOPPING
TROLLEY
1 Data carrier detect
2 Received data(RXD)
3 Transmitted data(TXD)
4 Data terminal ready
5 Signal ground(GND)
6 Data set ready
7 Request to send
8 Clear to send
9 Ring indicator

Table 3.2 IBM PC DB-9 Signals

The simplest connection between a PC and microcontroller requires a


minimum of three pins, TxD, RxD, and ground.

3.3.5 Microcontroller connection to RS232


The microcontroller has two pins that are used specifically for transferring
and receiving data serially. These two pins are called TxD and RxD and are the part
of the port 3 group(P3.0 and P3.1).Pin 11 of 89S52 (P3.1) is assigned to TxD and
Pin 10(P3.0) 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
MAX232.

The MAX232 converts from RS232 voltage levels to TTL voltage levels, and
vice versa.One advantage of the MAX232 is that it uses a +5V power source which
is same as the source voltage for the 89S52.
The MAX232 has two sets of line drivers for transferring and receiving data,
as shown in the figure. The line drivers used for TxD are called T1 and T2, while the
line drivers for RxD are designated as R1 and R2.In many applications only one of
them is used.ie T1 and R1 or T2 and R2.

~ 33 ~
RFID BASED SHOPPING
TROLLEY

fig 3.8 Inside MAX 232

The T1in pin is the TTL side and is connected to TxD of the microcontroller,
while the T1out is the RS232 side that is connected to the RxD pin of the RS232 DB
coonector.The R1in (pin 13)is the RS232 side that is connected to the TxD pin of the
RS232 DB-connector, and R1out (pin 12)is the TTL side that is connected to the
RxD pin of the microcontroller. MAX 232 requires 4 capacitors ranging from 1 to
22 micro farad. The most widely used is 22 micro farad.

fig 3.9 : it’s connection to 89s52

~ 34 ~
RFID BASED SHOPPING
TROLLEY

2.6.2 Serial Pin outs (D25 and D9 Connectors)

Table 2.8 Serial Pin outs of D25 and D9 connectors

~ 35 ~
RFID BASED SHOPPING
TROLLEY

2.6.3 Pin Functions

Table 2.9 Pin Functions of DB Connectors

3.3.6 89S52 Serial port programming


To allow data transfer between the PC and a microcontroller without any
error, we must make sure that the baud rate of the microcontroller matches the baud
rate of PC’s COM port.
The baud rate in the 89S52 is programmable. This is done with the help of
timer1.
The 89S52 divides the crystal frequency by 12 to get the machine cycle frequency.
In the case of XTAL=11.0592MHz,the machine cycle frequency is 921.6kHz.The
microcontroller’s UART circuitry divides the machine cycle frequency of 921.6kHz
by 32 once more before it is used by Timer1 to set the baud rate. Therefore,

~ 36 ~
RFID BASED SHOPPING
TROLLEY
921.6kHz divided by 32 gives 28,800Hz. When Timer1 is used to set the baud rate it
must be programmed in mode 2,that is 8 bit auto reload.

3.3.7 SBUF register


SBUF is an 8 bit register used solely for serial communication in 89S52.For
a byte of data to be transferred via TxD line, it must be placed in SBUF register.
Similarly, SBUF holds the byte of data when it is received by the RxD line. The
moment a byte is written into SBUF,it is framed with start and stop bits and
transferred serially via TxDpin.Similarly,when
the bits are received serially via RxD,the microcontroller deframes it by eliminating
the stop and start bits ,making a byte out of the data received, and then placing it in
the SBUF.

3.3.8 SCON register (serial control)


The SCON register is an 8 bit register used to program the start bit, stop bit,
and data bits of data framing, among other things. Table 3.2 describes various bits of
the SCON register.
SM0, SM1
SM0 and SM1 are D7 and D6 of the SCON register. These two bits
determine the framing of data by specifying the number of bits per character, and
start and stop bits. Of the a modes , only mode 1 is of interest to us. In SCON
register, when mode 1 is chosen, the data framing is 8bits,1 stop and 1 start
bits,which makes it compatible with the COM port of PCs.

Serial mode 1 allows the baud rate to be variable and is set by the Timer1 of
89S52.In serial mode 1 for each character, 10 bits are transferred in total.

~ 37 ~
RFID BASED SHOPPING
TROLLEY
BitNameBit Explanation of Function
Addres
7 SM0 9Fh Serial port mode bit 0
6 SM1 9Eh Serial port mode bit 1.
5 SM2 9Dh Multiprocessor Communications Enable (explained later)
4 REN 9Ch Receiver Enable. This bit must be set in order to receive
characters.
3 TB8 9Bh Transmit bit 8. The 9th bit to transmit in mode 2 and 3.
2 RB8 9Ah Receive bit 8. The 9th bit received in mode 2 and 3.
1 TI 99h Transmit Flag. Set when a byte has been completely
transmitted.
0 RI 98h Receive Flag. Set when a byte has been completely received.
Table 3.3 Each bit of the SCON register

SM0SM1Serial ModeExplanation Baud Rate


0 0 0 8-bit Shift RegisterOscillator / 12
0 1 1 8-bit UART Set by Timer 1 (*)
1 0 2 9-bit UART Oscillator / 64 (*)
1 1 3 9-bit UART Set by Timer 1 (*)

SM2
This bit enables the multiprocessing capability of microcontroller.
REN
When REN is high, it allows the microcontroller to receive the data on
RxDpin of 89S52.If we want the microcontroller to both transfer and receive the
data,REN must be set to 1.By making REN=0,the receiver is disabled, which can be
achieved by the instructions “SETB SCON.4” and “CLR SCON.4”.
TB8
It is used in serial modes 2 and 3. we will make it 0 since it is not used in our
programme.
RB8
In serial mode 1,this gets a copy of the stop bit when an 8 bit data is
received.This is rarely used. Hence we will make it 0.

TI
When the 89s52 finishes the transfer of 8 bit character, it raises the TI flag to
indicate that it is ready to transfer another byte. This is raised at the beginning of the
stop bit.

~ 38 ~
RFID BASED SHOPPING
TROLLEY

RI
When the 89s52 receives the data serially via RxD, it gats rid of start and
stop bits and places the byte in the SBUF register. Then it raises the RI flag bit to
indicate that a byte has been received and should be picked up before it is lost. It is
raised halfway through the stop bit.

3.3.9 Setting the serial port baud rate


To determine the value that must be placed in TH1 to generate the given
baud rate, we may follow the following steps.
1) The machine cycle frequency=(crystal oscillator frequency)/12
2) The frequency provided by UART to timer1 to set the baud rate=(Machine
cycle
Frequency) /32 .
3) The value obtained in step 2 is divided by the required baud rate which gives
the value to be loaded in to TH1.For example if the value is 3,we can load
the value in to TH1 as -3 directly or we can convert it in to HEX value by
using (FF+1)-3.
We can also calculate the value to be loaded in to TH1 as
TH1=256-((crystal/384)/Baud)
If PCON.7 ie SMOD=1 then the baud rate is effectively doubled. Thus the above
equation becomes, TH1=256-((crystal/192)/Baud).
For example , if we want to configure the serial port to 19,200 baud, if we use first
equation, then we get TH1=254.5
Here if we set it to 254, then we will have only 14,400 baud and if we set it to
255,then we will get 28,800 baud,which is very high.
Hence to achieve a baud rate of 19,200 we need to simply set the PCON.7 or
SMOD=1.When we do this,we can double the baud rate and utilize the second
equation.
Then we get TH1=253 ie (FD h).

~ 39 ~
RFID BASED SHOPPING
TROLLEY

3.3.10 Programming the 89s52 to transfer the data serially


The following steps must be taken.
1) The TMOD register is loaded with the value 20H,indicating the use of
Timer1 in mode2 (8 bit auto reload) to set the baud rate.
2) The TH1 is loaded with the required value to set the baud rate for serial data
transfer.
3) The SCON register is loaded with the value 50h,indicating serial
mode1,where an 8 bit data is framed with start and stop bits.
4) TR1 is set to 1 to start the timer1.
5) TI is cleared by CLR TI instruction.
6) The character byte to be transferred serially is written in to SBUF register.

7) The TI flag is monitored with the use of instruction”JNB TI,XX to see if the
character
Has been transferred completely.
8) To transfer the next character, go to step5.
The importance of TI flag is as given below,
1) The byte character to be transmitted is written in to SBUF register.
2) The star bit is transferred.
3) The 8 bit character is transferred one bit at a time.
4) The stop bit is transferred. It is during the transfer of stop bit the
microcontroller will raise the TI flag, indicating that the last character was
transmitted and it is ready to transfer the next character.
5) By monitoring the TI flag, we make sure that we are not overloading the
SBUF register. If we write another byte in to the SBUF register before TI is
raised, the untransmitted portion of the previous byte will be lost. In other
words, when the microcontroller finishes transferring a byte, it raises the TI
flag to indicate it is ready for the next character.
6) After SBUF is loaded with a new byte,TI flag bit must be forced to 0 by
“CLR TI”
7) instruction in order for this new byte to be transmitted.

~ 40 ~
RFID BASED SHOPPING
TROLLEY

3.3.11 Programming the 89s52 to receive data serially


The following steps must be taken,
1) The TMOD register is loaded with the value 20H, indicating the use of
Timer1 in
mode2 (8 bit auto reload) to set the baud rate.
2) The TH1 is loaded with the required value to set the baud rate for serial data
transfer.
3) The SCON register is loaded with the value 50h,indicating serial
mode1,where an 8
bit data is framed with start and stop bits and receive enable is turned on.
4) TR1 is set to 1 to start the timer1.
5) RI is cleared by CLR RI instruction.
6) The RI flag is monitored with the use of instruction”JNB RI, XX” to see if
the
character has been received yet.
7) When RI is raised,SBUF has the byte. Its contents are moved in to safe
place.
8) To receive the next character , go to step 5

Importance of the RI flag bit,


In receiving bits via RxD pin, microcontroller goes through the following
steps.
1) It receives the star bit indicating that the next bit is the first bit of the
character byte it is about to receive.
2) The 8 bit character is received in bit at a time. When the last bit is received,
a byte is formed and placed in SBUF.
3) The stop bit is received. When receiving the stop bit, the microcontroller
makes RI=1,indicating that an character byte has been received and must be
picked up before it gets overwritten by an incoming character.

~ 41 ~
RFID BASED SHOPPING
TROLLEY
4) By checking the RI flag bit when it is raised,we know that a character has
been received and is sitting in the SBUF register. We copy the SBUF
contents to a safe place in some other register or memory before it is lost.
5) After the SBUF contents are copied to a safe place, the RI flag must be
forced to 0 by the CLR RI instruction in order to allow the next received
character byte to be placed in SBUF.Failure to do this causes loss of received
character.

4.5.1 Flow chart for serial communication

START

TMOD=20H

SCON=50H

TR1 = 1

RI = 0

No If Yes
RI=1 Save contents of SBUF

~ 42 ~
RFID BASED SHOPPING
TROLLEY

3.3.12 Role of RS 232


The ultrasonic sensor continually measures the range between the vehicle
and the opposite obstacle. This range information is transmitted serially through RS
232 to the microcontroller for further processing.

MAX 232

The MAX232 is a dual driver/receiver that includes a capacitive


voltage generator to supply RS 232 voltage levels from a single 5V supply. Each
receiver converts RS 232 inputs to 5V TTL/CMOS levels. Each driver converts
TTL/CMOS input levels into RS 232 levels.

2.1.4.1 Pin out of MAX 232

~ 43 ~
RFID BASED SHOPPING
TROLLEY

FIGURE 2.8

Function Table for each driver Function Table for each


receiver

Input Output Input Output


Tin Tout Rin Rout
L H L H

H L H L

TABLE 2.6

2.1.4.2 Serial communication using MAX 232

FIGURE 2.9

~ 44 ~
RFID BASED SHOPPING
TROLLEY

3.2 Liquid Crystal Display

In recent years the LCD is finding widespread use replacing LEDs This is
due to following reasons
1) The declining prices of LCDs
2) The ability to display numbers, characters and graphics. This is in contrast to
LEDs, which are limited to numbers and few characters.
3) Incorporation of a refreshing controller in to LCD, there by relieving the
CPU of the task of refreshing the LCD. In contrast LCD must be refreshed
by CPU to keep displaying the data.

Figure 2.27 LCD display

3.2.1 Basic reading


This section deals with the character based LCD module which use Hitachi
HD44780 controller chip. These modules are not quite as advanced as the latest
generation, full size, full color, back lit types used in today’s laptop computers, but
far from being “phased out”, Character based LCDs, are still used extensively in
commercial and industrial equipment ,particularly where display requirements are
reasonably simple.

3.2.2 Shapes and sizes

~ 45 ~
RFID BASED SHOPPING
TROLLEY
Even limited to character based modules, there is still a wide variety of
shapes and
Sizes available. Line lengths 8, 16,2,024,32 and 40 character are all standard, in
one, two and 4 lines versions.
Several different liquid crystal technologies based exist. ”Supertwist” types,
for
Example, offer improved contrast and viewing angle over the older “twisted
nematic” types. Some modules are available with backlighting, so that they can
viewed in dimly lit conditions.

3.2.3 Connections
A 14 pin access is provided having 8 data lines,3 control lines and 3 power
lines. The connections are laid out in one of two common configurations, either two
row of seven pins, or a single row of 14 pins. The two layout alternatives are
displayed in fig3.3

~ 46 ~
RFID BASED SHOPPING
TROLLEY

Fig3.2: Pin out of the 2 basic LCD formats.


On most displays, the pins are numbered on the LCD’s PCB, but if not, it is
quite easy to locate pin1.Since this pin is connected to ground, it often has a thicker
PCB track
connected to it and it is generally connected to the metal work at some point.
The block diagram of an LCD module with all the pin details is shown in
figure 2.
The function of each of the connections is shown in table 1.Pin 1 and 2 are the
power supply lines, Vss and Vdd. The Vdd pin should be connected to positive
supply and Vss to 0V supply or ground. Although the LCD module data sheets
specify a 5VDC supply,

~ 47 ~
RFID BASED SHOPPING
TROLLEY
Supplies of 6V and 4-5V both work well, and even 3V is sufficient for some
modules.
Pin 3 is a control pin ,Vee , which is used to alter the contrast of the display.
Ideally, this pin should be connected to a variable voltage supply.

Pin 4 is the (RS)register select line. When this line is low, data bytes
transferred to the display are treated as commands and data bytes read from the
display indicate its status.
By setting the RS line high, character data can be transferred to and from the
module.
Pin 5 is read/write line. this line is pulled low in order to write commands
or
character data to the module, or pulled high to read character data or status
information from its registers.

~ 48 ~
RFID BASED SHOPPING
TROLLEY
Fig 3.3: pin details on an LCD module

Table 3.1:Pin out functions for all the LCD types

Pin 6 is the enable line. this input is used to initiate the actual transfer of
commands or character data between the module and the data lines. When writing to
the display, data is transferred only on high to low transition of this signal.
Pin 7 to 14 are data bus lines (D0 to D7).data can be transferred to and from
the display either as a single 8 bit byte or two 4 bit nibbles. The other two pins
LED+ and LED- is used for back light of the LCD.
Now let us try to display a single character on LCD. When powered up ,the
display should show a series of dark squares, possibly on a part of the display. These
character cells are actually in their off state, so the contrast control should be
adjusted anti clock wise until the squares are only just visible.
The display module resets itself to an initial state when power is applied, which

~ 49 ~
RFID BASED SHOPPING
TROLLEY
curiously has the display blanked off, so that even if the characters are entered, they
cannot be seen. it is therefore necessary to issue a command at this point, to switch
the display on.
The display on/off and cursor command turns on the display, but also
determines the
cursor style at the same time.
Initially it is better to select a blinking cursor with under line, so that its
position
can be clearly seen. ie code 00001111(0F).set the data switches (s1 to s8)to
00001111(0F)

and ensure that RS switch (S10)is “down”(logic 0).so that the device is in command
mode.
Now press E switch (S9) momentarily, which enables the chip to accept the
data. Now set RS switch to “up” position (logic 1), switching the chip from
command mode to character mode and enter the binary value 01000001(41)on data
switches. This is ASCII code for a capital A. Press the switch and marvel as the
display fills up with capital As . Clearly,
something is not right.

3.2.5 The internal structure of LCD module.


LCD is connected to the microcontroller through the controller interface.
LCD has an internal memory which stores the lookup table for all the characters.
Any ASCII value of a character that is passed to the LCD module is compared with
the lookup table in the memory and that value is displayed

~ 50 ~
RFID BASED SHOPPING
TROLLEY

Fig 3.5 : Internal structure of LCD module.

Liquid crystal
Liquid crystals are substances that exhibit a phase of matter that has
properties
Between those of a conventional liquid, and those of a solid crystal. For instance, a
liquid
Crystal (LC) may flow like a liquid, but have the molecules in the liquid arranged
and/or
Oriented in a crystal-like way.

~ 51 ~
RFID BASED SHOPPING
TROLLEY

Each pixel of an LCD typically consists of a layer of molecules aligned


between two transparent electrodes, and two polarizing filters, the axes of
transmission of which are (most of the cases) perpendicular to each other. The
surfaces of the electrodes, that are in contact with the liquid crystal material, are
treated so as to align the liquid crystal molecules in a particular direction. This
treatment typically consists of a thin polymer layer that is unidirectional rubbed
using, for example, a cloth. The direction of the liquid crystal alignment is then
defined by the direction of rubbing. Electrodes are made of a transparent conductor
called Indium Tin Oxide (ITO).

Fig 3.6 liquid crystal molecule alignment

Definitions
1) Resolution: The horizontal and vertical size expressed in pixels (e.g.,
1024x768).
2) Dot pitch: The distance between the centers of two adjacent pixels. The
smaller the dot pitch size, the less granularity is present, resulting in a
sharper image. Dot pitch may be the same both vertically and horizontally, or
different (less common).
3) Viewable size: The size of an LCD panel measured on the diagonal (more
specifically known as active display area).
4) Response time: The minimum time necessary to change a pixel's color or
brightness.

~ 52 ~
RFID BASED SHOPPING
TROLLEY

Interfacing LCD with microcontroller


Interfacing LCD with microcontroller is very easy task. You just have to
know the proper LCD programming algorithm. LCD used here has HD44780u dot
matrix LCD controller. LCD module has 8-bit data interface and control pins. One
can send data as 8-bit or in pair of two 4-bit nibbles.

To display any character on LCD micro controller has to send its ASCII value
to the data bus of LCD. For e.g. to display 'AB' microcontroller has to send two hex
bytes 41h and 42h respectively. LCD display used here is having 16x2 size. It means
2 lines each with 16 characters.

~ 53 ~
RFID BASED SHOPPING
TROLLEY

LCD Initialization

This is the pit fall for beginners. Proper working of LCD depend on the how
the LCD is initialized. We have to send few command bytes to initialize the lcd.
Simple steps to initialize the LCD

1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character
format.

2. Display On-Off control: Send 0FH for display and blink cursor on.

3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position

Role of LCD
The LCD module is used in the vehicle anti-collision system to display the
range information which is calculated by LV Max Sonar-EZ1 and also to display one
of the three zones in which the vehicle is present. If the distance displayed is above
20 inches it displays “safe” zone. If the distance is between 15 and 19 inches , then
it displays “alert” zone. If the distance is below 15 inches , the LCD will display “
stop” zone.

16X2 LCD

This LCD can be used to display 16 characters in 2 rows. It has the ability to display
numbers, characters and graphics. It has an inbuilt refreshing circuit, thereby
relieving the CPU from the task of refreshing. LCD discussed has total of 14 pins.

2.1.6.1 Pin out of a generic 16x 2 LCD

~ 54 ~
RFID BASED SHOPPING
TROLLEY

DO
D1
D2
D3
D4
D5
D6
D7
VSS VCC VEE RS R/W EN

FIGURE 2.11

LCD pin Description

Pin Symbol I/O Description


1 Vss - Ground
2 Vcc - +5V Power Supply
3 Vee - Power Supply to contrast
4 RS I RS = 0 to select command register
5 R/W I RS = 1 to select data register
6 EN I/O Enable
7 to 14 D0 to D8 I/O 8 bit data bus

TABLE 2.7

LCD Command Codes

Code(HEX) Command to LCD Instruction Register


1 Clear display screen
2 Return home
4 Decrement cursor (shift cursor to left)
6 Increment cursor (shift cursor to right)
80 Force cursor to the beginning of first line
C0 Force cursor to the beginning of second line
38 2 lines and 5x7 matrix

~ 55 ~
RFID BASED SHOPPING
TROLLEY
TABLE 2.8

Liquid Crystal Display

In recent years the LCD is finding widespread use replacing LEDs This is
due to following reasons
4) The declining prices of LCDs
5) The ability to display numbers, characters and graphics. This is in contrast to
LEDs, which are limited to numbers and few characters.
6) Incorporation of a refreshing controller in to LCD, there by relieving the
CPU of the task of refreshing the LCD. In contrast LCD must be refreshed
by CPU to keep displaying the data.

Basic reading
This section deals with the character based LCD module which use Hitachi
HD44780 controller chip. These modules are not quite as advanced as the latest
generation, full size, full color, back lit types used in today’s laptop computers, but
far from being “phased out”, Character based LCDs, are still used extensively in
commercial and industrial equipment ,particularly where display requirements are
reasonably simple.

Shapes and sizes


Even limited to character based modules, there is still a wide variety of
shapes and
Sizes available. Line lengths 8, 16,2,024,32 and 40 character are all standard, in
one, two and 4 lines versions.
Several different liquid crystal technologies based exist. ”Supertwist” types,
for

~ 56 ~
RFID BASED SHOPPING
TROLLEY
Example, offer improved contrast and viewing angle over the older “twisted
nematic” types. Some modules are available with backlighting, so that they can
viewed in dimly lit conditions.

Connections
A 14 pin access is provided having 8 data lines,3 control lines and 3 power
lines. The connections are laid out in one of two common configurations, either two
row of seven pins, or a single row of 14 pins. The two layout alternatives are
displayed in fig3.3

Fig3.2: Pin out of the 2 basic LCD formats.

~ 57 ~
RFID BASED SHOPPING
TROLLEY
On most displays, the pins are numbered on the LCD’s PCB, but if not, it is
quite easy to locate pin1.Since this pin is connected to ground, it often has a thicker
PCB track
connected to it and it is generally connected to the metal work at some point.
The block diagram of an LCD module with all the pin details is shown in
figure 2.
The function of each of the connections is shown in table 1.Pin 1 and 2 are the
power supply lines, Vss and Vdd. The Vdd pin should be connected to positive
supply and Vss to 0V supply or ground. Although the LCD module data sheets
specify a 5VDC supply,
Supplies of 6V and 4-5V both work well, and even 3V is sufficient for some
modules.
Pin 3 is a control pin ,Vee , which is used to alter the contrast of the display.
Ideally, this pin should be connected to a variable voltage supply.

Pin 4 is the (RS)register select line. When this line is low, data bytes
transferred to the display are treated as commands and data bytes read from the
display indicate its status.
By setting the RS line high, character data can be transferred to and from the
module.
Pin 5 is read/write line. this line is pulled low in order to write commands
or
character data to the module, or pulled high to read character data or status
information from its registers.

~ 58 ~
RFID BASED SHOPPING
TROLLEY

Fig 3.3: pin details on an LCD module

~ 59 ~
RFID BASED SHOPPING
TROLLEY

Table 3.1:Pin out functions for all the LCD types

Pin 6 is the enable line. this input is used to initiate the actual transfer of
commands or character data between the module and the data lines. When writing to
the display, data is transferred only on high to low transition of this signal.
Pin 7 to 14 are data bus lines (D0 to D7).data can be transferred to and from
the display either as a single 8 bit byte or two 4 bit nibbles. The other two pins
LED+ and LED- is used for back light of the LCD.
Now let us try to display a single character on LCD. When powered up ,the
display should show a series of dark squares, possibly on a part of the display. These
character cells are actually in their off state, so the contrast control should be
adjusted anti clock wise until the squares are only just visible.
The display module resets itself to an initial state when power is applied, which
curiously has the display blanked off, so that even if the characters are entered, they
cannot be seen. it is therefore necessary to issue a command at this point, to switch
the display on.
The display on/off and cursor command turns on the display, but also
determines the
cursor style at the same time.
Initially it is better to select a blinking cursor with under line, so that its
position
can be clearly seen. ie code 00001111(0F).set the data switches (s1 to s8)to
00001111(0F)

and ensure that RS switch (S10)is “down”(logic 0).so that the device is in command
mode.
Now press E switch (S9) momentarily, which enables the chip to accept the
data. Now set RS switch to “up” position (logic 1), switching the chip from
command mode to character mode and enter the binary value 01000001(41)on data
switches. This is ASCII code for a capital A. Press the switch and marvel as the
display fills up with capital As . Clearly,

~ 60 ~
RFID BASED SHOPPING
TROLLEY
something is not right.

3.2.4 Bounce
The problem here is contact bounce. Practically every time the E switch is
closed, its contact will bounce that although, occasionally only one character
appears, most attempts will result in 10 or 20 characters coming up on the display.
what is needed is a de-bounce circuit.
But what about the commands entered earlier, why didn’t contact bounce
interfere? In fact it did, but it doesn’t matter whether a command is entered just once
or several times, It gets executed any way. A solution to the bounce problem is in fig
3.5
Here a couple of NAND gates are cross coupled to form a set reset latch(or
flip flop)which flips over and latches. So that the contact bounce is eliminated.
Either a TTL
74LS00 or CMOS &74HC00can be used in this circuit. The switch must be an
S.P.D.T
(single pole double throw) type, a micro switch is ideal.

Fig 3.4 : de-bounce circuit

After modifying the circuit, the screen full of As can be cleared using the
Clear
Display command. Put binary value 00000001 ($01) on the data switches, set the RS

~ 61 ~
RFID BASED SHOPPING
TROLLEY
switch to the ‘‘down’’ position and press the new modified E switch. The display is
cleared. Note that the output of the ‘‘de-bounce’ circuit is high when the switch is
pressed and low when the switch is released. Since it is the high to low transition that
actually be observed that characters appear on the display, not when the button is
pressed, but when it is released.

3.2.5 The internal structure of LCD module.


LCD is connected to the microcontroller through the controller interface.
LCD has an internal memory which stores the lookup table for all the characters.
Any ASCII value of a character that is passed to the LCD module is compared with
the lookup table in the memory and that value is displayed

Fig 3.5 : Internal structure of LCD module.

~ 62 ~
RFID BASED SHOPPING
TROLLEY

3.2.6 Liquid crystal


Liquid crystals are substances that exhibit a phase of matter that has
properties
Between those of a conventional liquid, and those of a solid crystal. For instance, a
liquid
Crystal (LC) may flow like a liquid, but have the molecules in the liquid arranged
and/or
Oriented in a crystal-like way.

Each pixel of an LCD typically consists of a layer of molecules aligned


between two transparent electrodes, and two polarizing filters, the axes of
transmission of which are (most of the cases) perpendicular to each other. The
surfaces of the electrodes, that are in contact with the liquid crystal material, are
treated so as to align the liquid crystal molecules in a particular direction. This
treatment typically consists of a thin polymer layer that is unidirectional rubbed
using, for example, a cloth. The direction of the liquid crystal alignment is then
defined by the direction of rubbing. Electrodes are made of a transparent conductor
called Indium Tin Oxide (ITO).

Fig 3.6 liquid crystal molecule alignment

~ 63 ~
RFID BASED SHOPPING
TROLLEY

3.2.7 Definitions
5) Resolution: The horizontal and vertical size expressed in pixels (e.g.,
1024x768).
6) Dot pitch: The distance between the centers of two adjacent pixels. The
smaller the dot pitch size, the less granularity is present, resulting in a
sharper image. Dot pitch may be the same both vertically and horizontally, or
different (less common).
7) Viewable size: The size of an LCD panel measured on the diagonal (more
specifically known as active display area).
8) Response time: The minimum time necessary to change a pixel's color or
brightness.

3.2.8 Interfacing LCD with microcontroller


Interfacing LCD with microcontroller is very easy task. You just have to
know the proper LCD programming algorithm. LCD used here has HD44780u dot
matrix LCD controller. LCD module has 8-bit data interface and control pins. One
can send data as 8-bit or in pair of two 4-bit nibbles.

To display any character on LCD micro controller has to send its ASCII value
to the data bus of LCD. For e.g. to display 'AB' microcontroller has to send two hex
bytes 41h and 42h respectively. LCD display used here is having 16x2 size. It means
2 lines each with 16 characters.

3.2.9 Algorithm to send data to LCD

1) Make R/W low

~ 64 ~
RFID BASED SHOPPING
TROLLEY
2) Make RS=0 ;if data byte is command

3) RS=1 ; if data byte is data (ASCII value)

4) Place data byte on data register

5) Pulse E (HIGH to LOW)

6) Repeat the steps to send another data byte

3.2.10 LCD Initialization

This is the pit fall for beginners. Proper working of LCD depend on the how
the LCD is initialized. We have to send few command bytes to initialize the lcd.
Simple steps to initialize the LCD

1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character
format.

2. Display On-Off control: Send 0FH for display and blink cursor on.

3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position
The LCD module is used in the vehicle anti-collision system to display the range
information which is calculated by LV Max Sonar-EZ1 and also to display one of
the three zones in which the vehicle is present. If the distance displayed is above 20
inches it displays “safe” zone. If the distance is between 15 and 19 inches , then it
displays “alert” zone. If the distance is below 15 inches , the LCD will display “
stop” zone.

4.5.2 Flow chart for LCD


Start

Connect RS to P1.0
En to P1.1

Give commands to initialize LCD

~ 65 ~
RFID BASED SHOPPING
TROLLEY
Make RS =0

Mask lower 4 bits by multiplying by F0H


Shift right by 2 positions

Send it to P1

EN =1,Give some delay,


EN =0

Reset P1

Mask upper 4 bits by multiplying by 0FH


Shift left by 2 positions

Send it to P1

EN =1,Give some delay,


EN =0

Reset P1

RS=1 If given byte is


to be printed
RS=0

Stop

VOLTAGE REGULATOR LM7805

The LM78XX series of three terminal positive regulators are


available in the TO-220/D-PAK package and with several fixed output voltages,
making them useful in a wide range of applications. Each type employs internal
current limiting, thermal shut down and safe operating area protection, making it

~ 66 ~
RFID BASED SHOPPING
TROLLEY
essentially indestructible. If adequate heat sinking is provided, they can deliver over
1A output current. Although designed primarily as fixed voltage regulators, these
devices can be used with external components to obtain adjustable voltages and
currents.

2.1.3.1 Internal block diagram

FIGURE 2.6
Internal Block Diagram of LM 7805

2.1.3.2 Pin out of LM 7805 (TO – 220 PACKAGE)

~ 67 ~
RFID BASED SHOPPING
TROLLEY

1. INPUT

2. GROUND

3. OUTPUT

FIGURE 2.7

2.1.3.3 Electrical Characteristics of LM 7805

TABLE 2.5

~ 68 ~
RFID BASED SHOPPING
TROLLEY

CHAPTER 3

1.1. RELAY

A relay is an electrically operated switch. Current flowing through


the coil of the relay creates a magnetic field which attracts a lever and
changes the switch contacts. The coil current can be on or off so relays
have two switch positions and they are double throw (changeover)
switches.

Relays allow one circuit to switch a second circuit which can be


completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.

The coil of a relay passes a relatively large current, typically


30mA for a 12V relay, but it can be as much as 100mA for relays
designed to operate from lower voltages. Most ICs (chips) cannot
provide this current and a transistor is usually used to amplify the small
IC current to the larger value required for the relay coil. The maximum
output current for the popular 555 timer IC is 200mA so these devices
can supply relay coils directly without amplification.

~ 69 ~
RFID BASED SHOPPING
TROLLEY

Relays are usually SPDT or DPDT but they can have many more sets of
switch contacts, for example relays with 4 sets of changeover contacts
are readily available. For further information about switch contacts and
the terms used to describe them please see the page on switches.

Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the plastic
case of the relay.

The supplier's catalogue should show you the relay's connections. The
coil will be obvious and it may be connected either way round. Relay
coils produce brief high voltage 'spikes' when they are switched off and
this can destroy transistors and ICs in the circuit. To prevent damage
you must connect a protection diode across the relay coil.

The animated picture shows a working relay with its coil and
switch contacts. You can see a lever on the left being attracted by
magnetism when the coil is switched on. This lever moves the switch
contacts. There is one set of contacts (SPDT) in the foreground and
another behind them, making the relay DPDT.

The relay's switch connections are usually labeled COM, NC and NO:

COM - Common, always connect to this; it is the moving part of the


switch.

NC - Normally Closed, COM is connected to this when the relay


coil is off.

NO - Normally Open, COM is connected to this when the relay


coil is on.

Connect to COM and NO if you want the switched circuit to be on


when the relay coil is on.

Connect to COM and NC if you want the switched circuit to be on


when the relay coil is off.

i. CHOOSING A RELAY
You need to consider several features when choosing a relay:

~ 70 ~
RFID BASED SHOPPING
TROLLEY

1. Physical size and pin arrangement:


If you are choosing a relay for an existing PCB you will
need to ensure that its dimensions and pin arrangement are
suitable. You should find this information in the supplier's
catalogue.
2. Coil voltage:
The relay's coil voltage rating and resistance must suit the
circuit powering the relay coil. Many relays have a coil rated for a
12V supply but 5V and 24V relays are also readily available.
Some relays operate perfectly well with a supply voltage which is
a little lower than their rated value.
3. Coil:
The circuit must be able to supply the current required by
the relay coil. You can use Ohm's law to calculate the current:
supply voltage
Relay coil current =
coil resistance
4. For example: A 12V supply relay with a coil resistance of 400
passes a current of 30mA. This is OK for a 555 timer IC
(maximum output current 200mA), but it is too much for most
ICs and they will require a transistor to amplify the current.
5. Switch ratings (voltage and current)
The relay's switch contacts must be suitable for the circuit
they are to control. You will need to check the voltage and current
ratings. Note that the voltage rating is usually higher for AC, for
example: "5A at 24V DC or 125V AC".

6. Switch contact arrangement (SPDT, DPDT etc)


Most relays are SPDT or DPDT which are often
described as "single pole changeover" (SPCO) or "double pole
changeover" (DPCO). For further information please see the page
on switches.

ii. Protection diodes for relays


Transistors and ICs (chips) must be protected from the brief high
voltage 'spike' produced when the relay coil is switched off. The
diagram shows how a signal diode (eg 1N4148) is connected across the
relay coil to provide this protection. Note that the diode is connected
'backwards' so that it will normally not conduct. Conduction only occurs

~ 71 ~
RFID BASED SHOPPING
TROLLEY

when the relay coil is switched off, at this moment current tries to
continue flowing through the coil and it is harmlessly diverted through
the diode. Without the diode no current could flow and the coil would
produce a damaging high voltage 'spike' in its attempt to keep the
current flowing.

iii. Advantages of relays:


 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.

iv. Disadvantages of relays:


1. Relays are bulkier than transistors for switching small currents.

1.2. LCD DISPLAY

Liquid crystal displays (LCDs) have materials which combine the


properties of both liquids and crystals. Rather than having a melting
point, they have a temperature range within which the molecules are
almost as mobile as they would be in a liquid, but are grouped together
in an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal
material sand witched in between them. The inner surface of the glass
plates are coated with transparent electrodes which define the character,
symbols or patterns to be displayed polymeric layers are present in
between the electrodes and the liquid crystal, which makes the liquid
crystal molecules to maintain a defined orientation angle.
One each polarisers are pasted outside the two glass panels. These
polarisers would rotate the light rays passing through them to a definite
angle, in a particular direction

~ 72 ~
RFID BASED SHOPPING
TROLLEY

When the LCD is in the off state, light rays are rotated by the two
polarisers and the liquid crystal, such that the light rays come out of the
LCD without any orientation, and hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid
crystal molecules would be aligned in a specific direction. The light rays
passing through the LCD would be rotated by the polarisers, which
would result in activating / highlighting the desired characters.
The LCD’s are lightweight with only a few millimeters thickness.
Since the LCD’s consume less power, they are compatible with low
power electronic circuits, and can be powered for long durations.
The LCD does don’t generate light and so light is needed to read
the display. By using backlighting, reading is possible in the dark. The
LCD’s have long life and a wide operating temperature range.
Changing the display size or the layout size is relatively simple
which makes the LCD’s more customer friendly.
The LCDs used exclusively in watches, calculators and measuring
instruments are the simple seven-segment displays, having a limited
amount of numeric data. The recent advances in technology have
resulted in better legibility, more information displaying capability and a
wider temperature range. These have resulted in the LCDs being
extensively used in telecommunications and entertainment electronics.
The LCDs have even started replacing the cathode ray tubes (CRTs)
used for the display of text and graphics, and also in small TV
applications.

~ 73 ~
RFID BASED SHOPPING
TROLLEY

1.3. RCM2034R:
The RCM2034R is a reflective TN type liquid crystal module with a
built-in controller / driver LSI and a display capacity of 16 characters 1
line.
Applications
Personal computers, word processors, facsimiles, telephones, etc.
Features
1) Wide viewing angle and high contrast.
2) 5_7 dot character matrix with cursor.
3) Interfaces with 4-bit or 8-bit MPUs.
4) Displays up to 226 characters and special symbols.
5) Custom character patterns are displayed with the character RAM.
6) Abundant instruction set including clear display, cursor on /off, and
character blinking.
7) Compact and light weight for easy assembly to thehost instrument.
8) Operable on single 5 V power supply.
9) Low power consumption.

~ 74 ~
RFID BASED SHOPPING
TROLLEY

1.4. OSCILLATOR
The majority of clock sources for microcontrollers can be grouped
into two types: those based on mechanical resonant devices, such as
crystals and ceramic resonators, and those based on electrical phase-
shift circuits such as RC (resistor, capacitor) oscillators. Silicon
oscillators are typically a fully integrated version of the RC oscillator
with the added benefits of current sources, matched resistors and
capacitors, and temperature-compensation circuits for increased
stability. Two examples of clock sources are illustrated in Figure 1.
Figure 1a shows a Pierce oscillator configuration suitable for use with
mechanical resonant devices like crystals and ceramic resonators, while
Figure 1b shows a simple RC feedback oscillator.

Primary Differences between Mechanical Resonators and RC


Oscillators Crystal and ceramic resonator-based oscillators (mechanical)
typically provide very high initial accuracy and a moderately low
temperature coefficient. RC oscillators, in contrast, provide fast startup
and low cost, but generally suffer from poor accuracy over temperature

~ 75 ~
RFID BASED SHOPPING
TROLLEY

and supply voltage, and show variations from 5% to 50% of nominal


output frequency. While the circuits illustrated in Figure 1 can produce
clean reliable clock signals, their performance will be heavily influenced
by environmental conditions, circuit component choice, and the layout
of the oscillator circuit. Ceramic resonators and their associated load
capacitance values must be optimized for operation with particular logic
families. Crystals, with their higher Q, are not as sensitive to amplifier
selection but are susceptible to frequency shifts (and even damage)
when overdriven. Environmental factors like electromagnetic
interference (EMI), mechanical vibration and shock, humidity, and
temperature affect oscillator operation. These environmental factors can
cause output frequency changes, increased jitter, and in severe cases, can
cause the oscillator to stop functioning.
I. OSCILLATOR MODULES :
Many of the considerations described above can be avoided
through use of oscillator modules. These modules contain all oscillator
circuit components and provide a clock signal as a low-impedance
square-wave output. Operation is guaranteed over a range of conditions.
Crystal oscillator modules and fully integrated silicon oscillators are
most common. Crystal oscillator modules provide accuracy similar to
discrete component circuits using crystals. Silicon oscillators are more
precise than discrete component RC oscillator circuits, and many
provide comparable accuracy to ceramic resonator-based oscillators.

ii. POWER CONSUMPTION :


Power consumption is another important consideration of
oscillator selection. The power consumption of discrete component
crystal-oscillator circuits is primarily determined by the feedback-
amplifier supply current and by the in-circuit capacitance values used.

~ 76 ~
RFID BASED SHOPPING
TROLLEY

The power consumption of amplifiers fabricated in CMOS is largely


proportional to the operating frequency and can be expressed as a
power-dissipation capacitance value. The power-dissipation capacitance
value of an HC04 inverter gate used as an inverting amplifier, for
example, is typically 90pF. For operation at 4MHz from a 5V supply,
this equates to a supply current of 1.8mA. The discrete component
crystal oscillator circuit will typically include an additional load
capacitance value of 20pF, and the total supply current becomes
2.2mA.Ceramic resonator circuits typically specify larger load
capacitance values than crystal circuits, and draw still more current than
the crystal circuit using the same amplifier. By comparison, crystal
oscillator modules typically draw between 10mA and 60mA of supply
current because of the temperature compensation and control functions
included. The supply current for silicon oscillators depends on type and
function, and can range from a few micro-amps for low-frequency
(fixed) devices to tens of mille-amps for programmable-frequency parts.
A low-power silicon oscillator, such as the MAX7375, draws less than
2mA when operating at 4MHz.Summary the optimal clock source for a
particular microcontroller application is determined by a combination of
factors including accuracy, cost, power consumption, and environmental
requirements. The following table summarizes the common oscillator
circuit types discussed here, together with their strengths and
weaknesses.

~ 77 ~
RFID BASED SHOPPING
TROLLEY

LCD is Stands for liquid crystal display. It is used to display the


data’s which is came from PIC. It contains the 16 pin. 8 pin is used for
data communication, read, write, enable, Brightness control and 4 pins
for power supply.
FUNDAMENTALS OF ZIGBEE TECHNOLOGY

2.1 Introduction
In 21st century, wireless sensor networks are becoming necessary and seen as

indispensible in various medical and telecommunication equipments, smart energy

resources, home automation products etc., which require monitoring and control.

Zigbee is a wireless technology, which communicates on the principle of IEEE

802.15.4 standard. IEEE 802.15.4 is a standard that states the details for the lower

layers of the communication. This standard focuses on the low-cost and low power

communication. Because of Zigbee’s low cost, low power consumption and ability

to connect in a mesh network, it is becoming more optimum solution for monitoring

and control applications.


Ability to connect in mesh network allows Zigbee to provide more range

compared to other wireless technologies such as “INFRARED”, “BLUETOOTH”

etc. In addition, it also provides high reliability of the data reproduced at receiver. It

also consumes less power in communicating data between its transmitter and

~ 78 ~
RFID BASED SHOPPING
TROLLEY
receiver, which means longer life with smaller batteries. The primary reason for low

power consumption in Zigbee devices is that they work on very small duty cycle that

helps them to have a longer life span. Variation in duty cycle depends upon the

application usage, for example, some applications need data more frequently like in

health centers compared to others such as home automation systems.

2.2 Types of Zigbee Devices


2.2.1 Zigbee Coordinator
This acts as the building block of the Zigbee communication. Zigbee

coordinator forms the root of the various topologies like mesh, star, tree topology

network etc. and communicates from one device to other. There is only one Zigbee

coordinator in the whole Zigbee environment [2].

Zigbee Zigbee Coordinator


Devices

2.2.2 Full Function Device Figure 2.1: Zigbee coordinator


Full function devices support all IEEE 802.15.4 functions and features that

are defined by the standard. They can also function as a Zigbee coordinator. More

memory and computing power availability helps them to work as router also, which

helps in transmitting data to longer distances through different networks [2].

2.2.3 Reduced Function Device


Figure just
Reduced function devices 2.2: Full
talk function
to the device
Zigbee coordinators or Full
Full Function
Devices
function devices. They cannot perform the functions of a router or coordinator [2].

Reduced Function
Devices

~ 79 ~
RFID BASED SHOPPING
TROLLEY

Figure 2.3: Reduced function device

2.3 Zigbee Network


2.3.1 Network Setup
The Zigbee coordinator does Zigbee network initialization. As soon as the

network is powered up, the coordinator starts the network initialization sequence.

After that, the coordinator starts a search for the full function devices and reduced

function devices to establish a network.


 Joining Network as a New Device
Whenever a new device either Full Function Device (FFD) or Reduced

Function Device (RFD) wants to join a network, it sends a request to all other parent

capability devices such as FFDs that it wants to join the network. Then all the parent

devices send a packet, which gives the information about their address and number

of devices already connected to it. The child device that can be either FFD or RFD

collects all the data and then selects one of the devices as a parent device, which is

best suited for it. Then that parent device is responsible to provide the child device a

unique ID [3].
 Joining Previous Network

Zigbee devices save the information in a table whenever they are connected

to a network. This table stores the information, which helps the device to reconnect

to the same network again. So next time whenever they are switched on, they first

look into that table about the previous information and try to connect to the old

network. If the table is blank then they try to connect into a network as a new

device.

2.3.2 Mechanism for Data Transfer

~ 80 ~
RFID BASED SHOPPING
TROLLEY
Whenever a device wants to send a data packet, it has to check for channel.

If the channel is idle, device can send a packet else it has to wait. If the receiver is

FFD then transmitters can send the packet any time because its transceiver always

remains ON. However if the receiver is RFD then there are chances that its

transceiver is OFF to save power. So to avoid data loss all RFDs send a packet to

their corresponding parent device as soon as there transceiver comes to ON position

to get the data packet which was send to them when they were in sleeping mode [3].
2.3.3 Zigbee Network Topology
Zigbee network topology can be divided into three types [3]:
 Star Topology
Star topology consists of one Zigbee coordinator and one or more RFDs or

FFDs. All end point devices directly communicate to coordinator. If the end point

devices want to talk to each other they have to send the information to coordinator

first and then coordinator sends that information to appropriate receiver.

Zigbee Coordinator

Full Function Device

Reduced Function Device

Figure 2.4: Star topology

 Mesh Topology
Mesh topology also consists of one Zigbee coordinator and one or more

RFDs or FFDs, but in this topology, FFDs can directly contact other FFDs to

communicate the data packet.

Zigbee Coordinator

Full Function Device


 Cluster Tree Topology
Figure 2.5: Mesh topology
Reduced Function Device

~ 81 ~
RFID BASED SHOPPING
TROLLEY
This type of topology is used when range from transmitter to receiver is large

and Zigbee coordinator has to join two or more networks.

Zigbee Device Communication Flow Chart


Figure 2.6: ClusterZigbee
tree topology
Coordinator

InitializeFull
theFunction Device
Device
Reduced Function Device
Setup a New
Network

Waiting for the


RFD/FFD to join
gure 2.7: Flow Chart showing working of Zigbee coordinator

RFD/FF
D Join?
NO
YES
Initialize the
Receive the
Device
RFD/FFD Data

Send Signal to
join network

NO
Join
Network
YES

Waiting for the data


from/to sensor/device

Figure 2.8 Flow Chart showing working of Zigbee device


Send/Receive data
to/from Coordinator

YES NO
~Suucessfull
82 ~
y
Transferred
RFID BASED SHOPPING
TROLLEY

i. POWER SUPPLIES

The present chapter introduces the operation of power supply


circuits built using filters, rectifiers, and then voltage regulators. Starting
with an ac voltage, a steady dc voltage is obtained by rectifying the ac
voltage, then filtering to a dc level, and finally, regulating to obtain a
desired fixed dc voltage. The regulation is usually obtained from an IC
voltage regulator unit, which takes a dc voltage and provides a
somewhat lower dc voltage, which remains the same even if the input dc
voltage varies, or the output load connected to the dc voltage changes.

A block diagram containing the parts of a typical power supply


and the voltage at various points in the unit is shown in fig 19.1. The ac
voltage, typically 120 V rms, is connected to a transformer, which steps
that ac voltage down to the level for 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 can use this dc input to provide a dc voltage that not
only has much less ripple voltage but also remains the same dc value
even if the input dc voltage varies somewhat, or the load connected to
the output dc voltage changes. This voltage regulation is usually
obtained using one of a number of popular voltage regulator IC units.

~ 83 ~
RFID BASED SHOPPING
TROLLEY

Transformer Rectifier Filter IC regulator Load

ii. IC VOLTAGE REGULATORS:


Voltage regulators comprise a class of widely used ICs. Regulator
IC units contain the circuitry for reference source, comparator amplifier,
control device, and overload protection all in a single IC. Although the
internal construction of the IC is somewhat different from that described

~ 84 ~
RFID BASED SHOPPING
TROLLEY

for discrete voltage regulator circuits, the external operation is much the
same. IC units provide regulation of either a fixed positive voltage, a
fixed negative voltage, or an adjustably set voltage.

A power supply can be built using a transformer connected to the


ac supply line to step the ac voltage to a desired amplitude, then
rectifying that ac voltage, filtering with a capacitor and RC filter, if
desired, and finally regulating the dc voltage using an IC regulator. The
regulators can be selected for operation with load currents from
hundreds of milli amperes to tens of amperes, corresponding to power
ratings from milliwatts to tens of watts.

iii. THREE-TERMINAL VOLTAGE REGULATORS:


Fig shows the basic connection of a three-terminal voltage
regulator IC to a load. The fixed voltage regulator has an unregulated dc
input voltage, Vi, applied to one input terminal, a regulated output dc
voltage, Vo, from a second terminal, with the third terminal connected to
ground. For a selected regulator, IC device specifications list a voltage
range over which the input voltage can vary to maintain a regulated
output voltage over a range of load current. The specifications also list
the amount of output voltage change resulting from a change in load
current (load regulation) or in input voltage (line regulation).
IV. FIXED POSITIVE VOLTAGE REGULATORS:

IN OUT
7805
GND

~ 85 ~
RFID BASED SHOPPING
TROLLEY

SOFTWARE REQUERMENT

4.1 Introduction to keil µVision3

The µVision3 IDE is a Windows-based software development platform that


combines a robust editor, project manager, and make facility. µVision3 integrates all
tools including the C compiler, macro assembler, linker/locator, and HEX file
generator. The µVision3 IDE offers numerous features and advantages that help you
quickly and successfully develop embedded applications. They are easy to use and
are guaranteed to help you achieve your design goals.

4.2 Features
1) The µVision3 Simulator is the only debugger that completely simulates all
on-chip peripherals.
2) Simulation capabilities may be expanded using the Advanced Simulation
Interface (AGSI).
3) µVision3 incorporates project manager, editor, and debugger in a single
environment.
4) The µVision3 Device Database automatically configures the development
tools for the target microcontroller.
5) The µVision3 IDE integrates additional third-party tools like VCS, CASE,
and FLASH/Device Programming.
6) The ULINK USB-JTAG Adapter supports both Debugging and Flash
programming with configurable algorithm files.
7) Identical Target Debugger and Simulator User Interface.

~ 86 ~
RFID BASED SHOPPING
TROLLEY
8) The Code Coverage feature of the µVision3 Simulator provides statistical
analysis of your program's execution.

4.3 Benefits
1) Write and test application code before production hardware is available.
Investigate different hardware configurations to optimize the hardware
design.
2) Sophisticated systems can be accurately simulated by adding your own
peripheral drivers.
3) Safety-critical systems can be thoroughly tested and validated. Execution
analysis reports can be viewed and printed for certification requirements.
4) Accelerates application development. While editing, you may configure
debugger features. While debugging, you may make source code
modifications.
5) Quickly access development tools and third-party tools. All configuration
details are saved in the µVision3 project.
6) The same tool can be used for debugging and programming. No extra
configuration time required.
7) Shortens your learning curve.
8) Mistakes in tool settings are practically eliminated and tool configuration
time is minimized.

The µVision3 screen provides you with a menu bar for command entry, a tool bar
where you can rapidly select command buttons, and windows for source files, dialog
boxes, and information displays. µVision3 lets you simultaneously open and view
multiple source files.

~ 87 ~
RFID BASED SHOPPING
TROLLEY
µVision3 has two operating modes:

1) Build Mode: Allows you to translate all the application files and to generate
executable programs. The features of the Build Mode are described under
Creating Applications.

2) Debug Mode: Provides you with a powerful debugger for testing your
application. The Debug Mode is described in Testing Programs.

In both operating modes you may use the source editor of µVision3 to modify your
source code. The Debug mode adds additional windows and stores an own screen
layout. The following picture shows a typical configuration of µVision3 in the
Debug Mode.

Fig 4.1 Keil

The tabs of the Project Workspace give you access to:

~ 88 ~
RFID BASED SHOPPING
TROLLEY
1) Files and Groups of the project.
2) CPU Registers during debugging.
3) Tool and project specific on-line Books.
4) Text Templates for often used text blocks.
5) Function in the project for quick editor navigation.

6) The tabs of the Output Window provides: Build messages and fast error
access; Debug Command input/output console; Find in Files results with
quick file access.

7) The Memory Window gives access to the memory areas in display various
formats.

8) The Watch & Call Stack Window allows you to review and modify program
variables and displays the current function call tree.

9) The Workspace is used for the file editing, disassembly output, and other
debug information.

10) The Peripheral Dialogs help you to review the status of the on-chip
peripherals in the microcontroller.

2.2.1 KEIL μVISION 3

Keil Software is a industry standard development tools for the


8051 microcontroller family. Keil C Compilers, Macro Assemblers, Debuggers,
Real-time Kernels, and Single-board Computers support ALL 8051-compatible
derivatives.

µVision3 Overview

The µVision3 IDE is a Windows-based software development platform that


combines a robust editor, project manager, and makes facility. µVision3 integrates
all tools including the C compiler, macro assembler, linker/locator, and HEX file

~ 89 ~
RFID BASED SHOPPING
TROLLEY
generator. µVision3 helps expedite the development process of your embedded
applications by providing the following:

 Full-featured source code editor.

 Device database for configuring the development tool setting.


 Project manager for creating and maintaining your projects.
 Integrated make facility for assembling, compiling, and linking your
embedded applications.
 Dialogs for all development tool settings.
 True integrated source-level Debugger with high-speed CPU and peripheral
simulator.
 Advanced GDI interface for software debugging in the target hardware and
for connection to Keil ULINK.
 Flash programming utility for downloading the application program into
Flash ROM.
 Links to development tools manuals, device datasheets & user’s guides.

3.1.2 Software Development Cycle

When you use the Keil µVision3, the project development cycle is roughly
the same as it is for any other software development project.

 Create a project, select the target chip from the device database, and
configure the tool settings.

 Create source files in C or assembly.


 Build your application with the project manager.

~ 90 ~
RFID BASED SHOPPING
TROLLEY
 Correct errors in source files.
 Test the linked application.

The following block diagram illustrates the complete µVision3 software


development cycle. Each component is described below.

Figure 3.1 Software Development Cycle using Keil µVision3

~ 91 ~
RFID BASED SHOPPING
TROLLEY
 µVision3 IDE

The µVision3 IDE combines project management, a rich-featured editor


with interactive error correction, option setup, make facility, and on-line help.
Use µVision3 to create your source files and organize them into a project that
defines your target application. µVision3 automatically compiles, assembles, and
links your embedded application and provides a single focal point for your
development efforts.

 C Compiler & Macro Assembler

Source files are created by the µVision3 IDE and are passed to the C or
EC++ Compiler or Macro Assembler. The compiler and assembler process
source files and create relocatable object files.

 Library Manager

The library manager allows you to create object library from the object
files created by the compiler and assembler. Libraries are specially formatted,
ordered program collections of object modules that may be used by the linker at
a later time. When the linker processes a library, only those object modules in
the library that are necessary to create the program are used.

 Linker/Locator

The Linker/Locator creates an executable program file using the object


modules extracted from libraries and those created by the compiler and
assembler. An executable program file (also called absolute object module)
contains no relocatable code or data. All code and data reside at fixed memory
locations.

This executable program file may be used:

 To program an Flash ROM or other memory devices,

 With the µVision3 Debugger for simulation and target debugging,

~ 92 ~
RFID BASED SHOPPING
TROLLEY
 With an in-circuit emulator for the program testing.

 µVision3 Debugger

The µVision3 symbolic, source-level debugger is ideally suited for fast,


reliable program debugging. The debugger includes a high-speed simulator that
let you simulate an microcontroller system including on-chip peripherals and
external hardware. The attributes of the chip you use are automatically
configured when you select the device from the Device Database.

3.2 Proload v5.4

Proload is a user friendly software interface for programmer boards from


Sunrom Technologies. Proload gets its name from "Program Loader" term. It takes
in compiled HEX file and loads it to the hardware. Any compiler can be used. The
source code can be in Assembly or C, as all of them generate compiled HEX files.

Embedded C:

When designing software for a smaller embedded system with the 8051, it is
very common place to develop the entire product using assembly code. With many
projects, this is a feasible approach since the amount of code that must be generated
is typically less than 8 kilobytes and is relatively simple in nature. If a hardware
engineer is tasked with designing both the hardware and the software, he or she will
frequently be tempted to write the software in assembly language.

The trouble with projects done with assembly code can is that they can be
difficult to read and maintain, especially if they are not well commented.
Additionally, the amount of code reusable from a typical assembly language project
is usually very low. Use of a higher-level language like C can directly address these
issues. A program written in C is easier to read than an assembly program.

~ 93 ~
RFID BASED SHOPPING
TROLLEY
Since a C program possesses greater structure, it is easier to understand and
maintain. Because of its modularity, a C program can better lend itself to reuse of
code from project to project. The division of code into functions will force better
structure of the software and lead to functions that can be taken from one project and
used in another, thus reducing overall development time. A high order language such
as C allows a developer to write code, which resembles a human’s thought process
more closely than does the equivalent assembly code. [25]The developer can focus
more time on designing the algorithms of the system rather than having to
concentrate on their individual implementation. This will greatly reduce
development time and lower debugging time since the code is more understandable.

By using a language like C, the programmer does not have to be intimately


familiar with the architecture of the processor. This means that someone new to a
given processor can get a project up and running quicker, since the internals and
organization of the target processor do not have to be learned. Additionally, code
developed in C will be more portable to other systems than code developed in
assembly. Many target processors have C compilers available, which support ANSI
C.

All of this is not to say that assembly language does not have its place. In
fact, many embedded systems (particularly real time systems) have a combination of
C and assembly code. For time critical operations, assembly code is frequently the
only way to go. One of the great things about the C language is that it allows you to
perform low-level manipulations of the hardware if need be, yet provides you the
functionality and abstraction of a higher order language.

POINTS TO REMEMBER

LCD

~ 94 ~
RFID BASED SHOPPING
TROLLEY

LCD is Stands for liquid crystal display. It is used to display the


data’s which is came from PIC. It contains the 16 pin. 8 pin is used for
data communication, read, write, enable, Brightness control and 4 pins
for power supply.
POWER SUPPLY
Power supply is used to give the 5V to the controller. 5V can be
received from IC voltage regulator. In side the power supply rectifier,
filter is present.
RFID READER
RFID reader is used to read the data’s present in the RFID tag.
RFID readers or receivers are composed of a radio frequency module, a
control unit and an antenna to interrogate electronic tags via radio
frequency (RF) communication. Many also include an interface that
communicates with an application. Readers can be hand-held or
mounted in strategic locations so as to ensure they are able to read the
tags as the tags pass through an “interrogation zone.”
RD2
PIC is used to receive the signal which is come from RFID
receiver. For the LCD display the data’s can be sent through RD2.

ZIGBEE TRANSMITTER
ZIGBEE transmitter is used to transmit the signal from the RFID
receiver. Inside the transmitter the encoder is present. Data’s can be sent
after the encoding. At the receiver section the DECODING process
takes place for get the original signal.

~ 95 ~
RFID BASED SHOPPING
TROLLEY

ADVANTAGE:

1. Low power consumption

2. We can access vary easily.

3. Improves security performance in the security places because we

cannot make the duplicate RFID card.

APPLICATION:

We can use RFID based security system in highly secured

areas such as

1. RFID based Bank security system.

2. RFID based door opening and closing

3. RFID based production security system

~ 96 ~
RFID BASED SHOPPING
TROLLEY

CONCLUSION

The progress in science & technology is a non-stop process. New


things and new technology are being invented. As the technology grows
day by day, we can imagine about the future in which thing we may
occupy every place. This project is used in shopping complex for
purchase the products. In this project RFID card is used as security
access for product. If the product is put in to the trolley means it will
shows the amount and also the total amount. But in this project RFID
card is used for accessing the products. So this project improves the
security performance and also the speed.

The principle of the development of science is that

“NOTHING IS IMPOSSIBLE”
So we shall look forward to a bright &
sophisticated world.

~ 97 ~
RFID BASED SHOPPING
TROLLEY

PROJECT ESTIMATE

PRICE PER TOTAL


S.NO NAME OF THE COMPONENT QUANTITY
COMPONENT PRICE

1. RFID reader 1500 2 3000

2. RFID tag 800 1 800

3. Microcontroller 850 1 850

4. L.C.D 600 1 600

5. Transformer 300 1 300

6. Driver circuit 200 1 200

7. Relay 30 1 30

8. PCB 30 1 30

9. Alarm 20 1 20

10. L.E.D 3 1 3

11. Miscellaneous 100 - 100

GRAND TOTAL 5993

~ 98 ~
RFID BASED SHOPPING
TROLLEY
REFERENCES

THROUGH WEB SITES:


1. www.rfidjournal.com
2. www.teamrfid.com
3. www.wikipedia.org
4. www.rfidjournal.com
5. www.relayband.com
6. www.microcontroller.com
7. www.instructables.com
8. www.samsung.com
9. www.futurlec.com
THROUGH BOOKS:
NAME OF THE
S.NO PUBLICATION AUTHOR
BOOK
1. MICROCONTROLLERS D.VIJAYA KUMAR

(ENGLISH) N.KARUPPIAH
JOB
J.SIVANEYA

SELAVAN
2. ELECTRICAL MACHINES G.MAHALAKSHMI
N.V
- II S.SRITHAR
3. ELECTRONIC DEVICES & M.PARASURAM
N.V
CIRCUITS
4. CONTROL OF K.SOURI RAJAN
MAHESH
ELECTRICAL MACHINES A.SHANKARA
KARTHIK
SUBRAMANIAM

~ 99 ~

Вам также может понравиться