Project report On RFID based Security System
Sep 01, 2014
Project report
On
RFID based
Security System
Index
1 Introduction ----------------------------------------------------------------------------------------- 3
2 Abstract ---------------------------------------------------------------------------------------------- 4
3 Block Diagram -------------------------------------------------------------------------------------- 5
4 Block Diagram Description ----------------------------------------------------------------------- 6
5 Power supply design ----------------------------------------------------------------------------- 13
6 Circuit diagram ----------------------------------------------------------------------------------- 15
7 PCB Layout --------------------------------------------------------------------------------------- 16
8 Applications -------------------------------------------------------------------------------------- 17
9 Future scope -------------------------------------------------------------------------------------- 17
10 Component List ---------------------------------------------------------------------------------- 17
11 Bibliography --------------------------------------------------------------------------------------- 17
12 Datasheets --------------------------------------------------------------------------------------- 17
1 Introduction
Most educational institutions' administrators are concerned about student security. The
conventional method allowing access to students inside a college/educational campus is by
showing photo i-cards to security guard is very time consuming and insecure, hence inefficient.
Radio Frequency Identification (RFID) based security system is one of the solutions to
address this problem. This system can be used to allow access for student in school, college, and
university. It also can be used to take attendance for workers in working places. Its ability to
uniquely identify each person based on their RFID tag type of ID card make the process of
allowing security access easier, faster and secure as compared to conventional method.
Students or workers only need to place their ID card on the reader and they will be
allowed to enter the campus. And if any invalid card is shown then the buzzer is turned on.
2 Abstract
The Security system is basically an embedded one. Embedded stands for hardware
controlled by software. Here, the software using a Microcontroller controls all the hardware
components. The microcontroller plays an important role in the system.
The main objective of the system is to uniquely identify and to make Security for a
person. This requires a unique product, which has the capability of distinguishing different
person. This is possible by the new emerging technology RFID (Radio Frequency Identification).
The main parts of an RFID system are RFID tag (with unique ID number) and RFID reader (for
reading the RFID tag). In this system, RFID tag and RFID reader used are operating at 125 KHz.
The microcontroller internal memory is used for storing the details. The PC can be used for
restoring all the details of Security made.
This report provides a clear picture of hardware and software used in the system. It also
provides an overall view with detailed discussion of the operation of the system.
3 Block Diagram
4 Block Diagram Description
1) Microcontroller
This is the most important segment of the project, i.e. the microcontroller 8051. The
controller is responsible for detection and polling of the peripherals status. It is responsible for
making decisions for the connected devices. It is responsible for prioritizing all the slaves
attached to it.
We have used the ATMEL 89S51 microcontroller. The AT89S51 is a low-power, high-
performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash
memory. It has got 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters,
six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and a
clock circuitry.
It is the major part of the system which controls all the operation of the circuit such as
LCD interfacing, square wave generation. It also decides the messages to be displayed on the
LCD along with the time duration for which they should be displayed on the LCD.
Microcontroller also decides the frequency of square wave output.
Figure: Photograph of an 89s51 microcontroller.
2) Liquid Crystal Display (LCD):
Liquid Crystal Display which is commonly known as Alphanumeric Display can display
Alphabets, Numbers as well as special symbols thus alphabets. Graphic display has embedded
controller for controlling different modes. Controller accepts commands and data bytes from
micro controller.
LCD display has total 16 pins for interface with processor. RS is instruction or data select
line. This pin is kept high or low by microcontroller to indicate command instruction or data
bytes on data bus db0-db7. Special feature of this LCD module is it allows reading of data bytes
stored in RAM. Pin no. 5 i.e. R/W is used for deciding read operation or write operation. Graphic
display has RAM memory for storing characters codes to be displayed on LCD.
We have used 16 x 2 Alphanumeric Display which means on this display we can display two
lines with maximum of 16 characters in one line.
Figure: Photograph of A typical 16 by 2 alphanumeric LCD display
3) RFID card reader
It reads the RFID card shown in front of it and then sends out the code of the respective card.
This code is sent through serial communication.
5 Power Supply Module
Circuit Diagram of power supply
1) Transformer:
There are two types of transformer namely Step up and Step Down. We have used Step
down transformer as we have to generate 5 V DC supply from the 230 V input AC supply
2) Rectifier:
Rectifier is used to rectify the negative half cycles of the output signal of the secondary of
the transformer. So at the input of the rectifier we have AC signal with both positive and
negative cycles and at the output of the rectifier we have signal with only positive cycles but as
this signal is pulsating DC we have to use capacitor to filter out the AC contents of the output
signal. There are mainly three types of rectifiers namely half wave, Full wave and Bridge
rectifier. Out of these three we have used Bridge rectifier since it give more efficiency.
3) Filter Capacitor:
Filter capacitor is used to remove the AC signal from the output of rectifier.
Voltage drop across IC and diode is 4.5V.So dc voltage must be 8V.
4) Voltage Regulator:
Voltage regulator is used after the filter capacitor so as to generate constant DC voltage
supply of 5 volts. We have used IC 7805 as a voltage regulator it is a three pin IC which are
namely input, ground and output. The regulator has a finger voltage of 3 volts. Hence voltage
required at input of regulator is 8 volts.
POWER SUPPLY DESIGNThe basic step in the designing of any system is to design the power supply required for
that system. The steps involved in the designing of the power supply are as follows,
1) Determine the total current that the system sinks from the supply.
2) Determine the voltage rating required for the different components.
1) TRANSFORMER :
Transformer selection we required 12V for relay.
Min Input for 7805 is
= Drop across IC 7805 + Required Output voltage
= 3 V+ 5V
= 8 V
So at Input of 7805 we required 8 V with margin
Consider drop across diode 0.7V so 2 diode conducts drop is 1.4 V
= 1.4 V +8 V
= 9.4 V
So at secondary we required 10 V
2) FILTER:
For filter capacitor design
C= (Il * t1)/Vr
Vr= ripple voltage
Il = load current
t1= time during which the capacitor being discharge by load current
θ1= sin-1[(E0 min)/ (E0 max)]
So unregulated power supply is design for 10 V
Vr = ripple voltage 10% of output voltage
Vr = 1.0 V
E0 min/E0 max = (10-0.7) / 10+0.7
= 9.3 / 10.7
θ1 = sin-1 [9.3/10.7]
= 60°
Frequency 50 HZ
T1 = 1/50 = 20 ms
T for 360° = 20ms
For 180° = 10ms
For 60° = 20ms * (60°/360)
= 3.4m
3) RECTIFIER
For bridge
T1 = [time for 90° + time for θ1]
= 5ms + 3.4ms
= 8.4ms
Il = load current supplied to various IC
Il = (O/P current of IC 89c51 + O/P current of IC 232 + Current req. for display)
= 71mA + 30mA + 15.2 mA
=116.2 mA
C = (Il * t1)/Vr
= (116.2 mA * 8.4 ms)/ 1 V
= 976.04 µf
So we select 1000 µf capacitor
For diode design
PIV = Vm
Vm = E0 max + 2 Vf
= 10.7 + 1.4 V
= 12.1 V
I0 = Il /2
= 116.2 mA/ 2
= 58.1 mA
Peak repetitive current
Ifm = [Il (t1+t2)]/t2
T2 = time for 90° - time for θ1
= 5ms - 3.4ms
=1.2ms
Ifm = 116.2mA (8.6ms+1.2ms) /1.2ms.
=833mA
From above specification diode 1N4007 is selected
PIV =100V
I = 1A
a) The TUF is increased to 0.812 as compared the full wave rectifier.
b) The PIV across each diode is the peak voltage across the load =Vm, not 2Vm as in the two
diode rectifier
Output of the bridge rectifier is not pure DC and contains some AC some AC ripples in it. To
remove these ripples we have used capacitive filter, which smoothens the rippled output that we
apply to 7805 regulators IC that gives 5V DC. We preferred to choose capacitor filters since it is
cost effective, readily available and not too bulky.
The value of the capacitor filter can be found by following formula,
IL * t1
C =
Vr
A regulator is a circuit that supplies a constant voltage regardless of changes in load current. The
regulator used in our project is IC7805, which is a three terminal voltage regulator. A heat sink is
used, so that the heat produced by the regulator dissipating power has a larger area from which to
radiate the heat into the air by holding the case temperature to a much lower value than would
result without the heat sink.
IC 7805 has an internal thermal overload protection and the internal short circuit current limiting
device.
Fig. shows the block diagram of a typical power supply. The AC mains are given to the
transformer primary to get the required voltage at the secondary. Then it is applied to the bridge
rectifier, which converts the sinusoidal input into full wave rectified output. The output of the
rectifier contains some ripple voltage. To remove this voltage filter circuit is used. A ripple
voltage is nothing but a small value of AC over DC signal. Then a pure DC is given to the
regulator. The function of the regulator is to give the constant or stable output DC in spite of
changes in the load current.
The reasons for choosing IC regulator is that they are versatile in operation and relatively
inexpensive with features like programmable output, current/voltage boosting, internal short
circuit current limiting, thermal shutdown.
The 78XX are popularly known for regulation has been used. The 78XX series is a 3-terminal
positive voltage regulator and 79XX series is a 3-terminal negative voltage regulator.
As name suggests it transforms the voltage level from one level to another. Transformer
used is the step down transformer to step 230 V to +9 V.
It provides isolation too from the mains.
Filter Capacitor
Transformer Rectifier (Bridge)
Voltage Regulator
5VDC
230v AC
6 MICROCONTROLLERS
6.1 Introduction
Circumstances that we find ourselves in today in the field of microcontrollers had their
beginnings in the development of technology of integrated circuits. This development has made
it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for
production of microprocessors, and the first computers were made by adding external peripherals
such as memory, input-output lines, timers and other. Further increasing of the volume of the
package resulted in creation of integrated circuits. These integrated circuits contained both
processor and peripherals. That is how the first chip containing a microcomputer, or what would
later be known as a microcontroller came about.
6.2 History
It was year 1969, and a team of Japanese engineers from the BUSICOM Company
arrived to United States with a request that a few integrated circuits for calculators be made using
their projects. The proposition was set to INTEL, and Marcian Hoff was responsible for the
project. Since he was the one who has had experience in working with a computer (PC) PDP8, it
occurred to him to suggest a fundamentally different solution instead of the suggested
construction. This solution presumed that the function of the integrated circuit is determined by a
program stored in it. That meant that configuration would be simpler, but that it would require
far more memory than the project that was proposed by Japanese engineers would require. After
a while, though Japanese engineers tried finding an easier solution, Marcian's idea won, and the
first microprocessor was born. In transforming an idea into a readymade product, Frederico
Faggin was a major help to INTEL. He transferred to INTEL, and in only 9 months had
succeeded in making a product from its first conception. INTEL obtained the rights to sell this
integral block in 1971. First, they bought the license from the BUSICOM Company who had no
idea what treasure they had. During that year, there appeared on the market a microprocessor
called 4004. That was the first 4-bit microprocessor with the speed of 6 000 operations per
second. Not long after that, American company CTC requested from INTEL and Texas
Instruments to make an 8-bit microprocessor for use in terminals. Even though CTC gave up this
idea in the end, Intel and Texas Instruments kept working on the microprocessor and in April of
1972, first 8-bit microprocessor appeared on the market under a name 8008. It was able to
address 16Kb of memory, and it had 45 instructions and the speed of 300 000 operations per
second. That microprocessor was the predecessor of all today's microprocessors. Intel kept their
developments up in April of 1974, and they put on the market the 8-bit processor under a name
8080 which was able to address 64Kb of memory, and which had 75 instructions, and the price
began at $360.
In another American company Motorola, they realized quickly what was happening, so they put
out on the market an 8-bit microprocessor 6800. Chief constructor was Chuck Peddle, and along
with the processor itself, Motorola was the first company to make other peripherals such as 6820
and 6850. At that time many companies recognized greater importance of microprocessors and
began their own developments. Chuck Peddle leaved Motorola to join MOS Technology and
kept working intensively on developing microprocessors.
At the WESCON exhibit in United States in 1975, a critical event took place in the history of
microprocessors. The MOS Technology announced it was marketing microprocessors 6501 and
6502 at $25 each, which buyers could purchase immediately. This was so sensational that many
thought it was some kind of a scam, considering that competitors were selling 8080 and 6800 at
$179 each. As an answer to its competitor, both Intel and Motorola lowered their prices on the
first day of the exhibit down to $69.95 per microprocessor. Motorola quickly brought suit against
MOS Technology and Chuck Peddle for copying the protected 6800. MOS Technology stopped
making 6501, but kept producing 6502. The 6502 was an 8-bit microprocessor with 56
instructions and a capability of directly addressing 64Kb of memory. Due to low cost, 6502
becomes very popular, so it was installed into computers such as: KIM-1, Apple I, Apple II,
Atari, Commodore, Acorn, Oric, Galeb, Orao, Ultra, and many others. Soon appeared several
makers of 6502 (Rockwell, Sznertek, GTE, NCR, Ricoh, and Comodore takes over MOS
Technology) which was at the time of its prosperity sold at rate of 15 million processors a year!
Others were not giving up though. Frederico Faggin leaves Intel, and starts his own Zilog Inc. In
1976 Zilog announced the Z80. During the making of this microprocessor, Faggin made a pivotal
decision. Knowing that a great deal of programs have been already developed for 8080, Faggin
realized that many would stay faithful to that microprocessor because of great expenditure which
redoing of all of the programs would result in. Thus he decided that a new processor had to be
compatible with 8080, or that it had to be capable of performing all of the programs which had
already been written for 8080. Beside these characteristics, many new ones have been added, so
that Z80 was a very powerful microprocessor in its time. It was able to address directly 64 Kb of
memory, it had 176 instructions, a large number of registers, a built in option for refreshing the
dynamic RAM memory, single-supply, greater speed of work etc. Z80 was a great success and
everybody converted from 8080 to Z80. It could be said that Z80 was without a doubt
commercially most successful 8-bit microprocessor of that time. Besides Zilog, other new
manufacturers like Mostek, NEC, SHARP, and SGS also appeared. Z80 was the heart of many
computers like Spectrum, Partner, TRS703, and Z-3.
In 1976, Intel came up with an improved version of 8-bit microprocessor named 8085.
However, Z80 was so much better that Intel soon lost the battle. Although a few more processors
appeared on the market (6809, 2650, SC/MP etc.), everything was actually already decided.
There weren't any more great improvements to make manufacturers convert to something new,
so 6502 and Z80 along with 6800 remained as main representatives of the 8-bit microprocessors
of that time.
6.3 Definition of a Microcontroller
Microcontroller, as the name suggests, are small controllers. They are like single chip
computers that are often embedded into other systems to function as processing/controlling unit.
For example, the remote control you are using probably has microcontrollers inside that do
decoding and other controlling functions. They are also used in automobiles, washing machines,
microwave ovens, toys ... etc, where automation is needed.
The key features of microcontrollers include:
High Integration of Functionality
Microcontrollers sometimes are called single-chip computers because they have on-chip
memory and I/O circuitry and other circuitries that enable them to function as small
standalone computers without other supporting circuitry.
Field Programmability, Flexibility
Microcontrollers often use EEPROM or EPROM as their storage device to allow field
programmability so they are flexible to use. Once the program is tested to be correct then
large quantities of microcontrollers can be programmed to be used in embedded systems.
Easy to Use
Assembly language is often used in microcontrollers and since they usually follow RISC
architecture, the instruction set is small. The development package of microcontrollers
often includes an assembler, a simulator, a programmer to "burn" the chip and a
demonstration board. Some packages include a high level language compiler such as a C
compiler and more sophisticated libraries.
Most microcontrollers will also combine other devices such as:
A Timer module to allow the microcontroller to perform tasks for certain time periods.
A serial I/O port to allow data to flow between the microcontroller and other devices such
as a PC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
Figure 6.1: Showing a typical microcontroller device and its different subunits
The heart of the microcontroller is the CPU core. In the past this has traditionally been based on
an 8-bit microprocessor unit.
6.4 Microcontrollers versus Microprocessors
Microcontroller differs from a microprocessor in many ways. First and the most important is its
functionality. In order for a microprocessor to be used, other components such as memory, or
components for receiving and sending data must be added to it. In short that means that
microprocessor is the very heart of the computer. On the other hand, microcontroller is designed
to be all of that in one. No other external components are needed for its application because all
necessary peripherals are already built into it. Thus, we save the time and space needed to
construct devices.
6.5 Memory unit
Memory is part of the microcontroller whose function is to store data.
The easiest way to explain it is to describe it as one big closet with lots of drawers. If we suppose
that we marked the drawers in such a way that they cannot be confused, any of their contents will
then be easily accessible. It is enough to know the designation of the drawer and so its contents
will be known to us for sure.
Figure6.2: Simplified model of a memory unit
Memory components are exactly like that. For a certain input we get the contents of a
certain addressed memory location and that's all. Two new concepts are brought to us:
addressing and memory location. Memory consists of all memory locations, and addressing is
nothing but selecting one of them. This means that we need to select the desired memory
location on one hand, and on the other hand we need to wait for the contents of that location.
Besides reading from a memory location, memory must also provide for writing onto it. This is
done by supplying an additional line called control line. We will designate this line as R/W
(read/write). Control line is used in the following way: if r/w=1, reading is done, and if opposite
is true then writing is done on the memory location. Memory is the first element, and we need a
few operation of our microcontroller.
The amount of memory contained within a microcontroller varies between different
microcontrollers. Some may not even have any integrated memory (e.g. Hitachi 6503, now
discontinued). However, most modern microcontrollers will have integrated memory. The
memory will be divided up into ROM and RAM, with typically more ROM than RAM.
Typically, the amount of ROM type memory will vary between around 512 bytes and 4096
bytes, although some 16 bit microcontrollers such as the Hitachi H8/3048 can have as much as
128 Kbytes of ROM type memory.
ROM type memory, as has already been mentioned, is used to store the program code. ROM
memory can be ROM (as in One Time Programmable memory), EPROM, or EEPROM.
The amount of RAM memory is usually somewhat smaller, typically ranging between 25 bytes
to 4 Kbytes.
RAM is used for data storage and stack management tasks. It is also used for register stacks (as
in the microchip PIC range of microcontrollers).
6.6 Central Processing Unit
Let add 3 more memory locations to a specific block that will have a built in capability to
multiply, divide, subtract, and move its contents from one memory location onto another. The
part we just added in is called "central processing unit" (CPU). Its memory locations are called
registers.
Figure6.3: Simplified central processing unit with three registers
Registers are therefore memory locations whose role is to help with performing various
mathematical operations or any other operations with data wherever data can be found. Look at
the current situation. We have two independent entities (memory and CPU) which are
interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for
example, we wish to add the contents of two memory locations and return the result again back
to memory, we would need a connection between memory and CPU. Simply stated, we must
have some "way" through data goes from one block to another.
6.7 Bus
That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires.
There are two types of buses: address and data bus. The first one consists of as many lines as the
amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or
the connection line. First one serves to transmit address from CPU memory, and the second to
connect all blocks inside the microcontroller.
Figure6.4: Showing connection between memory and central unit using buses
As far as functionality, the situation has improved, but a new problem has also appeared:
we have a unit that's capable of working by itself, but which does not have any contact with the
outside world, or with us! In order to remove this deficiency, let's add a block which contains
several memory locations whose one end is connected to the data bus, and the other has
connection with the output lines on the microcontroller which can be seen as pins on the
electronic component.
6.8 Input-output unit
Those locations we've just added are called "ports". There are several types of ports:
input, output or bidirectional ports. When working with ports, first of all it is necessary to choose
which port we need to work with, and then to send data to, or take it from the port.
Figure6.5: Simplified input-output unit communicating with external world
When working with it the port acts like a memory location. Something is simply being written
into or read from it, and it could be noticed on the pins of the microcontroller.
6.9 Serial communication
Beside stated above we've added to the already existing unit the possibility of
communication with an outside world. However, this way of communicating has its drawbacks.
One of the basic drawbacks is the number of lines which need to be used in order to transfer data.
What if it is being transferred to a distance of several kilometers? The number of lines times’
number of kilometers doesn't promise the economy of the project. It leaves us having to reduce
the number of lines in such a way that we don't lessen its functionality. Suppose we are working
with three lines only, and that one line is used for sending data, other for receiving, and the third
one is used as a reference line for both the input and the output side. In order for this to work, we
need to set the rules of exchange of data. These rules are called protocol. Protocol is therefore
defined in advance so there wouldn't be any misunderstanding between the sides that are
communicating with each other. For example, if one man is speaking in French, and the other in
English, it is highly unlikely that they will quickly and effectively understand each other. Let's
suppose we have the following protocol. The logical unit "1" is set up on the transmitting line
until transfer begins. Once the transfer starts, we lower the transmission line to logical "0" for a
period of time (which we will designate as T), so the receiving side will know that it is receiving
data, and so it will activate its mechanism for reception. Let's go back now to the transmission
side and start putting logic zeros and ones onto the transmitter line in the order from a bit of the
lowest value to a bit of the highest value. Let each bit stay on line for a time period which is
equal to T, and in the end, or after the 8th bit, let us bring the logical unit "1" back on the line
which will mark the end of the transmission of one data. The protocol we've just described is
called in professional literature NRZ (Non-Return to Zero).
Figure6.6: Serial unit sending data through three lines only
As we have separate lines for receiving and sending, it is possible to receive and send
data (info.) at the same time. So called full-duplex mode block which enables this way of
communication is called a serial communication block. Unlike the parallel transmission, data
moves here bit by bit, or in a series of bits what defines the term serial communication comes
from. After the reception of data we need to read it from the receiving location and store it in
memory as opposed to sending where the process is reversed. Data goes from memory through
the bus to the sending location, and then to the receiving unit according to the protocol.
6.10 Timer unit
Since we have the serial communication explained, we can receive, send and process data.
Figure6.7: Timer unit generating signals in regular time intervals
However, in order to utilize it in industry we need a few additionally blocks. One of those is the
timer block which is significant to us because it can give us information about time, duration,
protocol etc. The basic unit of the timer is a free-run counter which is in fact a register whose
numeric value increments by one in even intervals, so that by taking its value during periods T1
and T2 and on the basis of their difference we can determine how much time has elapsed. This is
a very important part of the microcontroller whose understanding requires most of our time.
7. INTRODUCTION TO 16X2 LCD DISPLAY
LCD stands for Liquid Crystal Display. The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters.
4.1 Pin Description
Most LCDs with two controllers has 16 Pins. Pin description is shown in the table below.
Pin no Symbol Description1 VSS Power supply (GND)2 VCC Power supply (+5V)3 VEE Contrast adjust
4 RS0 = Instruction input1 = Data input
5 R/W0 = Write to LCD module1 = Read from LCD module
6 EN1 Enable signal7 D0 Data bus line 0 (LSB)8 D1 Data bus line 19 D2 Data bus line 210 D3 Data bus line 311 D4 Data bus line 412 D5 Data bus line 513 D6 Data bus line 614 D7 Data bus line 7 (MSB)15 LED+ Backlight VCC16 LED- Backlight VSS
Table No.4.1: Pin description of the LCD
4.2 DDRAM - Display Data RAM
Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever you send on the DDRAM is actually displayed on the LCD.
4.3 BF - Busy Flag
Busy Flag is a status indicator flag for LCD. When we send a command or data to the LCD for processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount of delay which is required for the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will not accept next command or data and BF = 0 means LCD is ready for the next command or data to process.
4.4 Instruction Register (IR) and Data Register (DR)
There are two 8-bit registers controller Instruction and Data register. Instruction register corresponds to the register where you send commands to LCD e.g. LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data which is to be displayed on LCD. When send the enable signal of the LCD is asserted, the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM and hence is displayed on the LCD.
4.5 Commands and Instruction set
only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the MCU. Before starting the internal operation of the LCD, control information is temporarily stored into these registers to allow interfacing with various MCUs, which operate at different speeds, or various peripheral control devices. The internal operation of the LCD is determined by signals sent from the MCU.
4.6 Sending Commands to LCD
To send commands we simply need to select the command register. Everything is same as we have done in the initialization routine. But we will summarize the common steps and put them in a single subroutine.
Following are the steps:
Move data to LCD port Select command register Select write operation Send enable signal Wait for LCD to process the command
7 Circuit diagram
MICROCONTROLLER
The main controlling unit of this all is microcontroller. This microcontroller counts the
number of persons entering into the room and displays it on the LCD.
The main circuitries involved in it are: -
1) Crystal circuit: -
This circuit gives the required clock pulses to the microcontroller to give it the sense of the
reference time.
2) Reset circuit: -
This circuit gives the microcontroller the starting pulse required to start the operation from the
start. Unless this pulse is given, the microcontroller doesn’t start functioning.
3) Pull-up resistors: -
The pull-up resistors are required to source the required current to the 7-segment display, which
the microcontroller alone is not capable of.
BASIC CIRCUIT OPERATION
CRYSTAL CIRCUIT: -
Diagram: -
Working: - The circuit consists of one crystal and two capacitors. The crystal is used to give the
microcontroller the required periodic pulses to make it function properly. The crystal used in the
project is of 12 MHz The two capacitors are connected to two pins of the crystal and are
grounded at the other ends
RESET CIRCUIT: -
Diagram: -
Working: - The circuit gives the required starting pulse to the microcontroller to start the
operation from the very beginning. The 89S51 microcontroller requires the active high reset
pulse. So the capacitor is connected to positive supply and the resistor is grounded.
Pull Up Resistors:
Diagram: -
Working: - The microcontroller pins cannot be connected to the LCD directly because the
microcontroller cannot supply all the required current. So the required remaining current is
provided through the pull-up resistors. They are designed to supply just the enough current to the
motor driver circuit.
8 PCB Layout
PCB DESIGN
A printed circuit board, or PCB, is used to mechanically support and electrically
connect electronic components using conductive pathways, tracks or traces etched from copper
sheets laminated onto a non-conductive substrate. It is also referred to as printed wiring board
(PWB) or etched wiring board. A PCB populated with electronic components is a printed circuit
assembly (PCA), also known as a printed circuit board assembly (PCBA).
BOARD DESIGN:
PCB designing is the most important and requires great care during work. Because once
PCB is designed, it is virtually impossible to alter it. While designing a circuit, designer should
take care to avoid crossing of conducting paths (tracks) as possible. Crossovers are unavoidable
then only of the jumper can be used. A circuit board carrying copper on both sides can also help
to solve this problem when circuit is complicated.
THE MASTER DIAGRAM:
1. The next stage lies in proportion to designing i.e. to prepare “Master Diagram” which is
commonly made twice as the finished circuit, since this makes the working on that much
easier , especially when circuit is complicated photography eventually reduces the size of
diagram to that of the circuit, before proceeding we must know some rules regarding the
designing:-
2. The space between the conductors must be strictly controlled to avoid the possibility of
electrical discharge or unwanted capacitance. The amount by which the master diagram is
to reduce in size is thus a critical design feature.
3. The conductor must be wider in those parts of the circuits that are going to handle large
currents must be handle without undue temperature of conductors.
4. The minimum width of copper should not generally be less than about 1.5mm. This is
related to mechanical strength rather than electrical properties and it also ensures that
strips remain securely bounded to the base material.
5. The points where the component holes for component lead wire occurs must be sited to
suit the dimensions of the component and dimensions between lead-out wires, so that, the
components can be situated correctly on finished board. The conductor is also men large at
the point of holes.
P.C.B. MAKING:
When the master diagram probable twice the size of real PCB has been evolved, the text major
step consists of etching or dissolving the unwanted metal from copper claded board to create the
circuit as depicted by master diagram. It must be stressed that very accurate checking of master
is essential at this stage. Then, the master point is mounted on a special frame on easy facing of a
larger camera and with the aid of the very powerful illumination a master diagram is clearly
photographed on a glass sensitive plate. This is developed to give photographic negative. In case
of simple & need of number of less PCB, economic & advisable touse the following lab method
of PCB making
1. PLANNING THE CIRCUIT:-There are several important factors that need not be
taken into account, if the finished device is to work properly we must consider gain
factor & ensure that the input & output parts are sufficiently well isolated to avoid the
possibility. We are also to make sure that all components need to return to earth are
properly connected & that possibility of common impedance arising in earth returned.
Other factors that have to successfully studied include availability of adequate return
points on board & its mounting from accessibility of switch connection made for
mechanical fixing ventilation effect of vibration
2. CLEANING THE BOARD:-The copper side of the board must be thoroughly
cleaned before circuit plan is transferred to it. This is very important because even
slightest trace of graze ( from figure of instance)will impure the etching process &
when the circuit plan has been neatly transferred to copper in this manner the board is
held under , running tap & the allowed to dry before resist is applied .
3. TRANSFORMING THE PLAN --Now, once cleaning is done plan has to transfer on
copper surface of PCB material .A convenient way to do this is simply put a carbon
paper between a copper surface of the board & working plan & carefully trace the
lines of original plan with a ball pen.
4. RESIST --Resist is nothing more than a substrate that is unaffected by presence
etching chemicals. It is usually colored so that, it can be easily seen the copper surface.
It is essential to resist through hardening before etching is started. Nail polished are
better as they quickly & are less difficult to remove. To overcome this drying effect &
to the sharp edges of the trace on PCB. Now -a-days etching taps along with IC pads
are commonly used. To this, changes of short circulating due to paints are completely
the avoid etching taps & pads are available in different sizes
5. ETCHING: - Next comes etching of unwanted copper & whether a small single is all
that required as quantity of board to be produce certain precautions must be taken
before operation is commenced the most use etch ant I ferric chloride & too this is
added small quantity of HCL to accelerate. Mixing 10 Grams of ferric Chloride & 25
grams of HCL with 15 grams of water can produced a good enchant.
6. AGITATION: - Small plastic bath is ideal for storing the etchant process. The depth
of liquid must be sufficient to completely cover eliminates, the laminated board
carrying the resist pattern circuit is then dropped into etchant bath gentle agitation
takes 5 to 20 minutes to complete depending on the strength of the etchant temperature
&thickness of copper foil.
7. FINNISHING OFF: - When all unwanted copper is dissolved from areas between
conductors, board should be taken from an etchant & washed in water. The resist must
be removed using proper solvent. After this the copper surface must be polished with
any kind of cleaner. It should be seen that there is no slight incomplete etching
between the conducting paths of the PCB. The PCB's coated coating material for
protection in lab coating material itself is a soldier. This process is called Tinning.
This process of coating involves s tracks with soldier. Advantages of tinning the effect
of environment of conductors, then PCB is drilled i.e. holes for fillings & mounting
the components on PCB are drilled with suitable drill bit.
8. ASSEMBLING OF PCB :-After the holes are drilled , the components have to be
assembled on PCB before assembling the components it is necessary to clean
soldering iron in order to get easy & accurate soldering. Removing impurity particles
that are gathered on iron bit due to repetitive use clean soldering iron.
9. TESTING AND TROUBLE SHOOTING
9.1 problem crop up
• Microcontroller at AT89C51 was not providing the results or was giving errors
• The pot used in the op-amp circuit for adjusting the gain was not giving the appropriate
results. The readings were varying.
9.2 How problems are rectified
• The microcontroller was replaced by the AT89S51 as the AT89C51 does not have In
System Programmer.
• Another resistor of 10K was connected in series with the pot to get the required gain.
9.3 testing procedure
Once the hardware has been assembled, it is necessary to verify that, the design is correct
& the prototype is built to the design drawing. This verification of the design is done by writing
several small programs, beginning with the most basic program & building on the demonstrated
success of each.
9.3.1 Crystal test:
The initial test is to ensure that, both, the crystal & the reset circuit are working. The
micro-controller is inserted in the circuit, & the ALE pulse is checked, with an oscilloscope, to
verify that the ALE frequency is 1/6th of the crystal frequency. Next, the reset button is pushed
& all ports are checked to see that, they are in the high input state.
9.3.2 PCB testing:
The PCB was tested, by tracing the tracks from the net list & the artwork of the PCB. The
errors in the artwork were eliminated while testing & after that it was given for PCB
manufacturing.
The PCB was tested using the DMM & the continuity of the tracks was tested using the
DMM, in the diode mode. The positive terminal was connected to the terminals of the other IC’s
to show the negligible resistance, if the track is continuous.
9.3.3 Software testing:
While designing the software for our project, we considered the following points: Firstly
in the software, all the IC’s were initialized. After all the subroutines for each module were
executed, they were displaying the proper results.
9 Applications
1) In Educational institutes
It is used for the Security in colleges, schools and universities.
2) In Companies / Industries
It is used for the Security in software companies, industries.
10 Future scope
1) Data can be sent through sms.
2) Same system can be used as a security system by little bit modification.
11 Component List
11.1 Integrated circuits
Sr No. COMPONENT VALUE UNIT QUANTITY COST 1 AT89s52 - - 1 55/-
3 MAX232 - - 1 15/-
4 7805 - - 1 15/-
5 7812 - - 1 15/-
6 555 - - 1 15/-
Table 7.1 list of integrated circuits
11.2 Power supplySr No. COMPONENT VALUE UNIT QUANTITY COST
1 TRANSFORMER0-15V /
1AVOLTS AMPS
1 60/-
2 CAPACITOR 2200 µF 1 25/-
3 CAPACITOR 100 µF 2 4/-
4 DIODES(1N4007) - - 4 2/-
5 CAPACITOR 0.1 µF 1 2/-
Table 7.2 list of power supply components
11.3 Other components
Sr No. COMPONENT VALUE UNIT QUANTITY COST 1 RESISTORS 10 KOHMS 12 0.25/-
2 RESISTORS 1 KOHMS 7 0.25/-
3 RESISTORS 22 KOHMS 2 0.25/-
4 RESISTORS 4.7 KOHMS ARRAY 0.25/-
5 CAPACITOR 10 µF 5 2/-
6 CAPACITOR 0.1 µF 2 2/-
7 PAPER CAPACITOR 22 PF 2 1/-
8 LCD - - 1 300/-
12 CRYSTAL 3.5 MHz 1 8/-
13 LED - - 7 1.5/-
15 POT 10 KOHMS 2 8/-
Table 7.3 list of other components
10.4 Miscellaneous
Sr No. COMPONENT VALUEUNIT
QUANTITY COST
1 LCD CONNECTOR - - 1 30/-
2 40 PIN IC SOCKET - - 1 5/-
3 OTHER IC SOCKETS - - 4 3/-
4 2 PIN CONNECTOR - - 6 8/-
5 3 PIN CONNECTOR - - 1 5/-
6 MAINS CHORD - - 1 10/-
7 SERIAL PORT - - 1 35/-
CONNECTOR
8 RFID Card reader 1 3500/-
9 RFID Cards 3 300/-
Table 7.4 list of list of miscellaneous components
12 Bibliography
Books: -
The 8051 microcontroller - Kenneth J. Ayala
The 8051 microcontroller and Embedded systems –Muhammad Ali Mazidi
Electronic Control System in Mechanical & Electrical Engineering- Alcitore and Bolten
Linear integrated circuits – Ramakant Gaikwad
Websites: -
www.google.com
www.national.com
www.atmel.com
www.vishay.com
www.amazon.com
13 Datasheets
List of Datasheets:
1. 89s51
2. LCD
3. Max232
4. RFID Card reader