Professional Documents
Culture Documents
This project aims at designing and executing the car parking system. This
automatic multistoried car parking system helps to minimize the car parking area.
In the modern world, where parking-space has become a very big problem and in
the era of miniaturization, it has become a very crucial necessity to avoid the
wastage of space, big companies and apartments etc. In places where more than
100 cars need to be parked, this system proves to be useful in reducing wastage
of space. This Automatic Car Parking System enables the parking of vehicles,
floor after floor and thus reducing the space used. Here any number of cars can
be parked according to the requirement. These makes the systems modernized
and even a space-saving one.
In our embedded based application we are developing an automatic
system. Here when a vehicle enter he has to enter the vehicle number by using
Hex keypad, and that vehicle will be carried to floor where the parking space is
available. There are IR sensors to sense the entry/ exit of the vehicles. While
leaving if he enters the vehicle number it shows floor number in which floor the
vehicle is parked. This can be displayed on the LCD.One more advance feature
in this project using RFID technology parking fare will be deducted from the
card.The parking area will be reserved in advance by the management using RF
wireless communication.
The programming language used for developing the software to the
microcontroller is Embedded/Assembly. The KEIL cross compiler is used to edit,
compile and debug this program. Here in our application we are using AT89C51
microcontroller which is Flash Programmable IC.AT represents the Atmel
Corporation represents CMOS technology is used for designing the IC.
INDEX
1. INTRODUCTION
OBJECTIVE OF THE PROJECT
BLOCK DIAGRAM
2. DESCRIPTION OF THE PROJECT
BLOCK DIAGRAM DESCRIPTION
SCHEMATIC
SCHEMATIC EXPLANATION
3. HARDWARE DESCRIPTION
DCMOTOR
L293D
IR SENSOR
HEX KEYPAD
MICROCONTROLLER
MAX232
RFID READER
DB9 CONNECTOR
SERIAL COMMUNICATION
LCD DISPLAY
POWER SUPPLY
PRINTED CIRCUIT BOARD
4. SOFTWARE DESCRIPTION
FLOW CHART
ASSEMBLY LANGUAGE PROGRAM
5. FUTURE ENHANCEMENTS
6. CONCLUSION
7. BIBLIOGRAPHY
INTRODUCTION
Block Diagram
Tx:
For Transmitter Selection
s1
RF
s2 Micro Transmitter
Controller Encoder
Module
HT12E
Rx:
KEYPAD
Display unit
MCU
SENSO
RFID
R
READER
Driver
DECODER Circuit
DC
MOTOR
can optimize it reducing the size and cost of the product and increasing the
processor (DSP). Embedded systems control many devices in common use today.
The Keil C51 C Compiler for the 8051 microcontroller is the most popular
8051 C compiler in the world. It provides more features than any other 8051 C
speed of assembly language. Language extensions in the C51 Compiler give you
The C51 Compiler translates C source files into relocatable object modules
which contain full symbolic information for debugging with the µVision Debugger
listing file which may optionally include symbol table and cross reference
information.
Embedded C is an extension for the programming language C to support
4K
bytes of Flash programmable and erasable read only memory (PEROM). The
device
compatible with the industry-standard MCS-51 instruction set and pinout. The on-
chip
conventional
provides
applications.
displays floor number in which floor parking space is available. It informs whether
the floors are fully filled with the cars or is it having place in a particular floor or
not. There is facility of lift to carry the car to up . Movement of Lift is controlled by
DC motor. In this project we have provided three floors of a building for car
capacity can be changed according to the requirement. Vehicles are allowed only
after entering the car number through the hex keypad. While leaving if he enters
his car number it will display the floor number in which floor his car is parked.
There are IR sensors for sensing the entry and exit of vehicles. With these sensors
the database regarding the number of cars in the building will be maintained.
When the car enters the lift it will automatically carry the car to the particular floor
where the parking space is available. After this process the lift will come back to
the normal position ie., to the ground floor. In this we are using IR transmitter and
IR receiver for sensing the entry and exit of the vehicles. The infrared frequency is
the IR frequency signals. Here we are using 16*2 LCD where 16 characters will be
The one more advanced feature in this application is to reserve the parking
MHz).Only the management has the authority to reserve the parking area in
advance. The switches are provided at the transmitter end with the encoder and
SCHEMATIC:
CAR PARKING SYSTEM
D14 D9
R10
Vcc DB9 Connector
J1 RV4 LED-BLUE
330R
LED-YELLOW
5 POT
9
D13 D7
4
R9
8
RV3 330R
3 LED-BLUE LED-YELLOW
7 POT
2
MAX232 6 D12 D6
1 3 U4 1
R8
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
21
P2.0/A8
22
P2.1/A9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
23
P2.2/A10
29 24
PSEN P2.3/A11
30 25
ALE P2.4/A12
31 26
EA P2.5/A13
27
P2.6/A14
28
keypad P2.7/A15
1 10
P1.0 P3.0/RXD
2 11
3
P1.1 P3.1/TXD
12 Vcc
P1.2 P3.2/INT0
4 13
5
P1.3 P3.3/INT1
14 16 8 U2
P1.4 P3.4/T0
6 15
7
P1.5 P3.5/T1
16 2 3 DC Motor
P1.6 P3.6/WR IN1 VSS VS OUT1
8 17 7 6
P1.7 P3.7/RD IN2 OUT2
1
1
EN1
AT89C51
A
1 2 3 9
EN2
10 11
IN3 OUT3
15 14
IN4 GND GND OUT4
B
4 5 6
L293D
C 7 8 9 L293D
D
0 #
PORT 0:
Port 0 can act as both input as well as output port also for addressing the
external memory.In this we are connecting the IR sensor receivers to sense the
entry and exit of vehicles.
PORT 2:
Port 1 can act as both input as well as output port. The 8 pins of Port 1 is
connected to the eight data pins of LCD. We are using 16 pin LCD. The data is
send through these pins if we selected the data register in LCD otherwise
command code will be send if we selected command code register.
PORT 1:
Port 2 can act as both input as well as output port. The microcontroller port 2 pins
are connected to the 4*3 hex keypad. If any key is pressed the input will be taken
by the port pin and the microcontroller will display the data according to the key
pressed.
PORT 3:
Port 3 is also called as communication port. It can be used as both input as well
as output port. The control pins of LCD are connected to Port 3 first three pins.
We have three control pins in the LCD ie. RS (register select), R/W, Enable pin.
The Register select is used to select the registers present internally to the LCD.
We are having two registers data register and command code register. If RS=0
then we are selecting data register, if RS=1 then we are going for command code
register. This RS is connected to P3.0 pin. The R/W pin is connected to P3.1.
This pin is used for reading and writing the data. Next is Enable pin which is
connected to P3.2 and it is used to latch the information present in the data pins.
In this we are also using the serial communication to interface with the RFID
reader .so, RXD and TXD pins of port3 are used for serial communication.
HEX KEYPAD
A general 3×2 matrix keypad contains only 0-9 keys.Whereas a hex keypad
contains 0-9 keys and also it contains A,B,C,D,E,F keys.So it provides more
number of combination of Passwords to the firms.
A keypad-matrix is very nice.
This code matches with the printing on the key's of a 3 X 4 keypad. These 4 bits
can be placed in the upper region of portB, so your interrupt lines (B0 and B1)
are free again. Now you don't need pullups anymore, so you can use other ports
as well for the keypad.
The Schematic
Please remember that every individual keypad can have it's own connections, so
pay attention to this !!
The PIC runs on its internal oscillator, so we spare out a crystal and 2 caps.
A 4-bit code can be taken from the middle 4 pins of J2. The outer pins must be
connected to a 5 volt supply and GND.
If no key is pressed, the output has the value 15 (bin 1111). If a key is pressed,
the output gives the corresponding value of that key. The * gets the value 10, and
the # gets the value 11. Every keypress gives a friendly beep. Additionally a
negative 1 ms pulse is given on J4. You can use this pulse as an interrupt trigger,
if you wish. This pulse is generated after the data has arrived at the port. The
data stays on the port until the key is released.
If you've chosen the serial configuration, then the data-signal can be taken from
RA0 (pin 5 of the header).
The signal has a reverse polarity, is 9600 baud, 8 bits wide, and has no parity
(9600, 8, n, 1)
There's also an interrupt pulse here, too. This is sent by RA1 (pin 4 of the
header).
This pulse is generated before the data is sent, giving the main-controller the
chance to anticipate it.
In both configurations (parallel & serial) you are free to use the interrupt pulse.
There is no requirement for it.
DC Motor
DC motors are configured in many types and sizes, including brush less, servo,
and gear motor types. A motor consists of a rotor and a permanent magnetic field
stator. The magnetic field is maintained using either permanent magnets or
electromagnetic windings. DC motors are most commonly used in variable speed
and torque.
Motion and controls cover a wide range of components that in
some way are used to generate and/or control motion. Areas within this category
include bearings and bushings, clutches and brakes, controls and drives, drive
components, encoders and resolves, Integrated motion control, limit switches,
linear actuators, linear and rotary motion components, linear position sensing,
motors (both AC and DC motors), orientation position sensing, pneumatics and
pneumatic components, positioning stages, slides and guides, power
transmission (mechanical), seals, slip rings,solenoids,springs.
Motors are the devices that provide the actual speed and torque
in a drive system. This family includes AC motor types (single and multiphase
motors, universal, servo motors, induction, synchronous, and gear motor) and
DC motors (brush less, servo motor, and gear motor) as well as linear, stepper
and air motors, and motor contactors and starters.
In any electric motor, operation is based on simple electromagnetism. A current-
carrying conductor generates a magnetic field; when this is then placed in an
external magnetic field, it will experience a force proportional to the current in the
conductor, and to the strength of the external magnetic field. As you are well
aware of from playing with magnets as a kid, opposite (North and South)
polarities attract, while like polarities (North and North, South and South) repel.
The internal configuration of a DC motor is designed to harness the magnetic
interaction between a current-carrying conductor and an external magnetic field
to generate rotational motion.
Let's start by looking at a simple 2-pole DC electric motor (here red represents a
magnet or winding with a "North" polarization, while green represents a magnet
or winding with a "South" polarization).
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and all
that Beamers will see), the external magnetic field is produced by high-strength
permanent magnets1. The stator is the stationary part of the motor -- this includes
the motor casing, as well as two or more permanent magnet pole pieces. The
rotor (together with the axle and attached commutator) rotates with respect to the
stator. The rotor consists of windings (generally on a core), the windings being
electrically connected to the commutator. The above diagram shows a common
motor layout -- with the rotor inside the stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings are such
that when power is applied, the polarities of the energized winding and the stator
magnet(s) are misaligned, and the rotor will rotate until it is almost aligned with
the stator's field magnets. As the rotor reaches alignment, the brushes move to
the next commutator contacts, and energize the next winding. Given our example
two-pole motor, the rotation reverses the direction of current through the rotor
winding, leading to a "flip" of the rotor's magnetic field, and driving it to continue
rotating.
In real life, though, DC motors will always have more than two poles (three is a
very common number). In particular, this avoids "dead spots" in the commutator.
You can imagine how with our example two-pole motor, if the rotor is exactly at
the middle of its rotation (perfectly aligned with the field magnets), it will get
"stuck" there. Meanwhile, with a two-pole motor, there is a moment where the
commutator shorts out the power supply (i.e., both brushes touch both
commutator contacts simultaneously). This would be bad for the power supply,
waste energy, and damage motor components as well. Yet another disadvantage
of such a simple motor is that it would exhibit a high amount of torque” ripple"
(the amount of torque it could produce is cyclic with the position of the rotor).
So since most small DC motors are of a three-pole design, let's tinker with the
workings of one via an interactive animation (JavaScript required):
You'll notice a few things from this -- namely, one pole is fully energized at a time
(but two others are "partially" energized). As each brush transitions from one
commutator contact to the next, one coil's field will rapidly collapse, as the next
coil's field will rapidly charge up (this occurs within a few microsecond). We'll see
more about the effects of this later, but in the meantime you can see that this is a
direct result of the coil windings' series wiring:
There's probably no better way to see how an average dc motor is put together,
than by just opening one up. Unfortunately this is tedious work, as well as
requiring the destruction of a perfectly good motor.
This is a basic 3-pole dcmotor, with 2 brushes and three commutator contacts.
PWM technique:
A pulse width modulator (PWM) is a device that may be used as an efficient light
dimmer or DC motor speed controller. A PWM works by making a square wave
with a variable on-to-off ratio; the average on time may be varied from 0 to 100
percent. In this manner, a variable amount of power is transferred to the load.
The main advantage of a PWM circuit over a resistive power controller is the
efficiency, at a 50% level, the PWM will use about 50% of full power, almost all of
which is transferred to the load, a resistive controller at 50% load power would
consume about 71% of full power, 50% of the power goes to the load and the
other 21% is wasted heating the series resistor. Load efficiency is almost always
a critical factor in solar powered and other alternative energy systems. One
additional advantage of pulse width modulation is that the pulses reach the full
supply voltage and will produce more torque in a motor by being able to
overcome the internal motor resistances more easily. Finally, in a PWM circuits,
common small potentiometers may be used to control a wide variety of loads
whereas large and expensive high power variable resistors are needed for
resistive controllers.
Pulse width modulation consists of three signals, which are modulated by a
square wave. The duty cycle or high time is proportional to the amplitude of the
square wave. The effective average voltage over one cycle is the duty cycle
times the peak-to-peak voltage. Thus, the average voltage follows a square
wave. In fact, this method depends on the motor inductance to integrate out the
PWM frequency.
A very simply off line motor drive can be built using a TRIAC and a control IC.
This circuit can control the speed of a universal motor. A universal motor is a
series wound DC motor. The circuit uses phase angle control to vary the effective
motor voltage.
A micro controller can also be used to control a triac. A PNP of transistor may be
used to drive the triac. As shown, the MCU ground is connected to the AC line.
The gate trigger current is lower if instead the MCU 5V supply is connected to the
AC line. The MCU must have some means of detecting zero crossing and a
timer, which can control the triac firing. A general-purpose timer with one input
capture and one output compare makes an ideal phase angle control.
8051 Micro controller
Architecture
Architecturally all micro controllers share certain features. They all contain a
CPU, memory and I/O on the same chip. Another common feature is the interrupt
handling capability. What sets them apart from one another is the choice of CPU,
the structure of memory, and choice of peripheral devices, I/O and interrupt
handling hardware. The major distinguishing architectural characteristic of micro
controllers is the word size. Micro-controllers are available in 4, 8, 16, or 32 bit
wide words. The width of the data path impacts several features of the micro
controller. The complexity of the instruction set (number of available instructions
and addressing modes), program efficiency (code generation and storage
space), execution speed, as well as chip implementation and interfacing
complexity are all influenced by the width of the data path.
For simple control tasks 4-bit, and for a vast number of control and measurement
applications 8-bit micro controllers would be sufficient. For higher precision and
speed applications like speech and video processing, or complex
instrumentation, 16-bit and 32-bit micro controllers are more appropriate.
Widely used group of micro controllers is Intel’s MCS51 family. These micro
controllers are also 8-bit processors, but with a separate 64Kbyte of data and
64Kbyte of program memory space. As implied by this statement, devices in the
MCS51 utilize Harvard architecture. All of I/O addresses as well as CPU registers
and various peripheral devices’ registers are mapped in the same space as the
data. The 8051, which is one of the options in this family, has 5 interrupt sources,
2 external, two timer interrupts and one serial port interrupt. Interrupt priority is
resolved through a priority scheme and ranking in the polling sequence. The
priority scheme allows each interrupt to be programmed to one of two priority
levels. Furthermore if two interrupts with the same priority occur simultaneously,
they are serviced based on their rank in the polling sequence. Other
manufacturers such as AMD, Dallas Semiconductor, Fujitsu and Philips also
supply micro controllers in the MCS51 family. Dallas Semiconductor’s DC87C550
provides increased performance over Intel’s 8051 while maintaining instruction
set compatibility. Many instructions that execute in 12 CPU clock cycles in an
8051, will execute in only 4 clocks for the DC87C550 therefore resulting in
increased execution speeds of up to three times. Additionally, the DC87C550 has
a power management mode that allows slowing of the processor in order to
reduce power consumption. This mode can be utilized in battery operated or
otherwise low power applications. The architecture of the instruction set varies
greatly from one micro controller to another. The choices made in designing the
instruction set impact program memory space usage, code execution speed, and
ease of programming.
BLOCK DIAGRAM:
Fig. 6.2.1 Block Diagram of AT89C51 Microcontroller
PIN CONFIGURATION:
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 1sare written to port 0 pins, the pins can be
used as high impedance inputs. Port 0 may also be configured to be the
multiplexed low order address/data bus during accesses to external program and
data memory. In this mode P0 has internal pull-ups. Port 0 also receives the
code bytes during Flash programming, and outputs the code bytes during
program verification. External pull-ups are required during program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
1 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
2 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memories that
use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memories that use
8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special
Function Register. Port 2 also receives the high-order address bits and some
control signals during Flash programming and verification.
Port 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 pull-ups and can be used as inputs. As inputs, Port
3 pins that are externally being pulled low will source current (IIL) because of the
pull-ups.
Port 3 also serves the functions of various special features of the AT89C51 as
listed below:
Port 3 also receives some control signals for Flash programming and verification
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG)
during Flash programming. In normal operation ALE is emitted at a constant rate
of 1/6the oscillator frequency, and may be used for external timing or clocking
purposes. Note, however, that one ALE pulse is skipped during each access to
external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH.
With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller
is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the
AT89C51 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.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset.
EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash
programming, for parts that require 12-volt VPP.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figs 6.2.3.
Either a quartz crystal or ceramic resonator may be used. To drive the device
from an external clock source, XTAL2 should be left unconnected while XTAL1 is
driven as shown in Figure 6.2.4.There are no requirements on the duty cycle of
the external clock signal, since the input to the internal clocking circuitry is
through a divide-by-two flip-flop, but minimum and maximum voltage high and
low time specifications must be observed.
Notes:
1. Under steady state (non-transient) conditions, IOL must be externally
limited as follows:
• Maximum IOL per port pin: 10 mA
• Maximum IOL per 8-bit port: Port 0: 26 mA
• Ports 1, 2, 3: 15 mA
• Maximum total IOL for all output pins: 71 mA
• If IOL exceeds the test condition, VOL may exceed the related
specification. Pins are not guaranteed to sink current greater than the
listed test conditions.
2. Minimum VCC for Power-down is 2V.
AC CHARACTERISTICS
Under operating conditions, load capacitance for Port 0, ALE/PROG, and PSEN
= 100pF; load capacitance for all other outputs = 80pF
Hardware
There are a variety of peripheral devices that are often integrated on a micro
controller chip. Many of these peripheral devices are the same as those that may
be included in a microprocessor while those that make a micro controller
distinguishable from a microprocessor are the ones that deal with external
interface and communication. Here is a brief description of the hardware
components of a micro controller:
1. Interrupt Handlers
2. I/O ports
I/O ports provide means of digital data transfer to and from the micro controller.
I/O ports are usually configured as a parallel interface where digital data can be
simultaneously written to or read from a port address. In micro controller
applications it is often possible to use the I/O ports with bit wise instructions. I/O
ports can be used for crude user interface functions such as reading of switch
settings or displaying some results using LED’s. It is also possible to use I/O
ports for more sophisticated interface options. An I2C interface, which is a serial
communications protocol, can be emulated using two bits of an I/O port.
ADC’s are used to enable the micro controller to receive continuous time signals
representing physical parameters. Temperature, sound, light intensity, color,
liquid or gas flow, position and speed are all examples physical parameters that
may be used by a micro controller. These data are first converted to a voltage or
current waveform using appropriate transducers. It is then the function of the
ADC to convert the voltage or current to digital form for processing by the
microprocessor. There are different types of ADC’s and the choice depends on
the required accuracy, sampling rate and cost.
A) Flash Converters
In a flash ADC multiple analog comparators are used to evaluate the analog
input voltage. All the bits of the output digital word are evaluated at once. The
only delay in this conversion is that of the analog comparators and the logic used
to encode the digital word. This is therefore the fastest method of analog to
digital conversion. The resolution is usually limited to 8-bits because of the large
number of comparators needed. High speed video processing is an application
where flash converters are well suited.
In this type of converter, the digital output is evaluated one-bit at a time starting
at the most significant bit. This type of ADC provides good resolution (10-12 bits)
at relatively fast conversion rate. For a 10-bit conversion, 10 clock cycles are
needed, where the maximum clock rate depends on the comparator settling and
digital delays in the SAR circuit. The ADC circuit requires a high speed precise
DAC. This is the most commonly used ADC in micro controller applications.
d) Over-sampling ADC
Through the use of serial communication the micro controller can be used with
various system level peripherals. Here is a brief description of some the serial
communication peripherals commonly integrated on a micro controller chip.
a SFRs:
The 8051 is a flexible micro controller with a relatively large number of
modes of operations. Your program may inspect and/or change the operating
mode of the 8051 by manipulating the values of the 8051's Special Function
Registers (SFRs). SFRs are accessed as if they were normal Internal RAM. The
only difference is that Internal RAM is from address 00h through 7Fh whereas
SFR registers exist in the address range of 80h through FFh. Each SFR has an
address (80h through FFh) and a name. The following chart provides a graphical
presentation of the 8051's SFRs, their names, and their address.
Tab 6.2.3a Chart of 8051 SFRs and their addresses
As we can see, although the address range of 80h through FFh offer 128
possible addresses, there are only 21 SFRs in a standard 8051. All other
addresses in the SFR range (80h through FFh) are considered invalid. Writing to
or reading from these registers may produce undefined values or behavior.
SFR Types
As mentioned in the chart itself, the SFRs that have a blue background
are SFRs related to the I/O ports. The 8051 has four I/O ports of 8 bits, for a total
of 32 I/O lines. Whether a given I/O line is high or low and the value read from
the line are controlled by the SFRs in green. The SFRs with yellow backgrounds
are SFRs which in some way control the operation or the configuration of some
aspect of the 8051.
For example, TCON controls the timers, SCON controls the serial port. The
remaining SFRs, with green backgrounds, are "other SFRs." These SFRs can be
thought of as auxiliary SFRs in the sense that they don't directly configure the
8051 but obviously the 8051 cannot operate without them. For example, once the
serial port has been configured using SCON, the program may read or write to
the serial port using the SBUF register.
SFR Descriptions
This section will endeavor to quickly overview each of the standard SFRs
found in the above SFR chart map. It is not the intention of this section to fully
explain the functionality of each SFR--this information will be covered in
separate chapters of the tutorial. This section is to just give you a general
idea of what each SFR does.
Tab 6.2.4 Interrupt Handler Address and the Interrupts associated to them
By consulting the above chart we see that whenever Timer 0 overflows (i.e., the
TF0 bit is set), the main program will be temporarily suspended and control will
jump to 00BH. It is assumed that we have code at address 0003H that handles
the situation of Timer 0 overflowing.
Setting up Interrupts
By default at power up, all interrupts are disabled. This means that even if, for
example, the TF0 bit is set, the 8051 will not execute the interrupt. Your program
must specifically tell the 8051 that it wishes to enable interrupts and specifically
which interrupts it wishes to enable. Your program may enable and disable
interrupts by modifying the IE SFR (A8h):
c) I2C
7. Memory : Most often all the memory required for the operation of a
micro controller is included on board. Program is usually stored in non-volatile
memory such as ROM. In that situation the program has to be fully tested before
committing it to silicon. Micro controllers are usually equipped with an emulation
mode that enables access to external memory. This mode of operation can be
used for program development or debugging. Other forms of memory used in
micro controllers include EEPROM and RAM. EEPROM is used for non-volatile
storage of variables such as calibration data and system settings. RAM is used
for temporary storage of variables.
External Device Drivers
down
down
Power-down Mode
In the power-down mode, the oscillator is stopped, and the instruction that
invokes power-down is the last instruction executed. The on-chip RAM and
Special Function Registers retain their values until the power-down mode is
terminated. The only exit from power-down is a hardware reset. Reset redefines
the SFRs but does not change the on-chip RAM. The reset should not be
activated before V CC is restored to its normal operating level and must be held
active long enough to allow the oscillator to restart and stabilize.
On the chip are three lock bits that can be left unprogrammed (U) or can be
programmed (P) to obtain the additional features listed in the table below. When
lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a
random value, and holds that value until reset is activated. It is necessary that
the latched value of EA be in agreement with the current logic level at that pin in
order for the device to function properly.
Flash is disabled
disabled
execution is disabled
It finishes the instruction it is executing and saves the address of the next
instruction on the stack.
It jumps to a fixed location in memory called vector table that holds the address
of the interrupt service routine.
The micro controller gets the address of the ISR from the interrupt vector table
and jumps to it. It starts to execute the interrupt service subroutine until it reaches
the last instruction of the subroutine, which is RETI (Return from Interrupt).Upon
executing the RETI instruction, the micro controller returns to the place where it
was interrupted. First, it gets the program counter (PC) address from the stack by
popping the top two bytes of the stack into the PC. Then it starts execute from
that address.
There are really five interrupts available to the user in the 8051 but many
manufacturer’s data sheets state that there are six interrupts since they include
RESET.
RESET: When the reset pin is activated, the 8051 jumps to address location
0000. This is the power-up reset.
Two interrupts are set aside for the timers: one for timer0 and one for timer1.
Memory locations 000BH and 001BH in the interrupt vector table belong to
timer0 and timer1, respectively.
Two interrupts are set aside for hardware external hardware interrupts. Pin
numbers 12 (P3.2) and 13 (P3.3) in port34 are for the external hardware
interrupts INT0 and INT1, respectively. Memory locations 0003H and 0013H in
the interrupt vector table are assigned to INT0 and INT1, respectively.
Serial communication has a single interrupt that belongs to both receive and
transfer. The interrupt vector table location 0023H belongs to this interrupt.
Upon rest, all interrupts are disabled (masked), meaning that none will be
responded to by the micro controller if they are activated. The interrupts must be
enabled by software in order for the micro controller to respond to them. There is
a register called INTERRUPT ENABLE (IE) that is responsible for enabling and
disabling the interrupts.
NOTE: * User software should not write 1s to reserved bits. These bits may be
used in future Flash micro controllers to invoke new features.
Bit D7 of the TE register must be set to high to allow the rest of register to take
effect.
The block diagram of the system is as shown in the fig. The system basically
consists of a
RF transmitter:
General Description:
The ST-TX01-ASK is an ASK Hybrid transmitter module.
ST-TX01-ASK is designed by the Saw Resonator, with an
effective low cost, small size, and simple-to-use for designing.
Frequency Range:315 / 433.92 MHZ.
Supply Voltage: 3~12V.
Output Power : 4~16dBm
Circuit Shape: Saw
Applications
RF module (Receiver):
Description:
General Description:
The ST- RX04-ASK is an ASK superhet receiver module with PLL synthesizer and
crystal oscillator.
The circuit shape is: PLL.
Receiver Frequency: 315 / 433.92 MHZ
Operation Voltage 5V
IF Frequency: 500k
Typical sensitivity: -105dBm
Supply Current: 2.3mA
Applications:
1 �Car security system
2 �Wireless security systems
3 �Sensor reporting
4 �Automation system
5 �Remote Keyless entry
Features
1 �Low power consumption.
2 �Easy for application.
3 �On-Chip VCO with integrated PLL using crystal oscillator reference.
4 �Integrated IF and data filters.
5 �Operation temperature range : ﹣10℃~+60℃
6 �Operation voltage : 5 Volts.
7 �Available frequency at : 315/434 MHz
Remark:
1. Antenna length about :23cm for 315 MHz
17cm for 434 MHz
The encoders are a series of CMOS LSIs for remote control system
applications. They are capable of encoding information, which consists of N address bits
and 12_N data bits. Each address/data input can be set to one of the two logic states.
The programmed addresses/data are transmitted together with the header bits
via an RF or an infrared transmission medium upon receipt of a trigger signal. The
capability to select a TE trigger on the HT12E.
Fig 3.7 PIN diagram
Transmission Enable
For the HT12E encoders, applying a low signal to the TE pin enables transmission.
Flow chart:
In the receiver section we are using RF receiver for receiving the data now the Decoder
HT12D can decode received data. This decoded data will be fed into the
Port 1 of micro controller from the Address/data lines of the Decoder IC. This Receiving
data send through port2 of micro controller to the data lines of the LCD (D0-D7) .now
the data displayed on the LCD.This output data can be displayed on an LCD.
LCD: Most of the character type LCD modules have parallel bus for interfacing with in
the embedded controls it has an eight bit bus, a module select signal (cs), a read/write
signal and another line A0 it selects the address so the micro controller has to spare 11
I/O lines to display the given Data on the LCD.
Decoder HT 12D
General Description
The decoders are a series of CMOS LSIs for remote Control system applications.
For proper operation, a pair of encoder/decoder with the same number of addresses and
data format should be chosen. The decoders receive serial addresses and data from
programmed encoders. Which are transmitted by a carrier using an RF or an IR
transmission medium. They compare the serial input data three times continuously with
their local addresses.
If no error or unmatched Codes are found the input data codes are decoded
and then transferred to the output pins. The VTpin also goes high to indicate a valid
transmission. of decoders are capable of decoding Information that consists of N bits of
address and 12_NBits of data of this series, the HT12D is arranged to provide8 address
bits and 4 data bits, and HT12F is used to Decode 12 bits of address information.
Fig 3.9.2 Internal Block diagram
Fig 4.0 Receiver circuit:
Principle :
IR LED emits infrared radiation. This radiation illuminates the surface in front of
LED. Surface reflects the infrared light. Depending on reflectivity of the surface,
amount of light reflected varies. This reflected light is made incident on reverse
biased IR sensor. When photons are incident on reverse biased junction of this
diode, electron-hole pairs are generated, which results in reverse leakage
current. Amount of electron-hole pairs generated depends on intensity of incident
IR radiation. More intense radiation results in more reverse leakage current. This
current can be passed through a resistor so as to get proportional voltage. Thus
as intensity of incident rays varies, voltage across resistor will vary accordingly.
This voltage can then be given to OPAMP based comparator. Output of the
comparator can be read by uC. Alternatively, you can use on-chip ADC in AVR
microcontroller to measure this voltage and perform comparison in software.
Colour of IR transmitter and receiver is different. However you may come across
pairs which appear exactly same or even has opposite colours than shown in
above pic and it is not possible to distinguish between TX and RX visually. In
case you will have to take help of multimeter to distinguish between them.
An infrared emitter is an LED made from gallium arsenide, which emits near-
infrared energy at about 880nm.
The infrared phototransistor acts as a transistor with the base voltage determined
by the amount of light hitting the transistor.
Hence it acts as a variable current source. Greater amount of IR light cause
greater currents to flow through the collector-emitter leads.
As shown in the diagram below, the phototransistor is wired in a similar
configuration to the voltage divider.
The variable current traveling through the resistor causes a voltage drop in the
pull-up resistor. This voltage is measured as the output of the device.
Photo IR reflectance sensors contain a matched infrared transmitter and infrared
receiver pair.
These devices work by measuring the amount of light that is reflected into the
receiver.
Because the receiver also responds to ambient light, the device works best when
well shielded from abient light, and when the distance between the sensor and
the reflective surface is small(less than 5mm).
IR reflectance sensors are often used to detect white and black surfaces. White
surfaces generally reflect well, while black surfaces reflect poorly. One of such
applications is the line follower of a robot.
The resistance of the sensor decreases when IR light falls on it. A good sensor
will have near zero resistance in presence of light and a very large resistance in
absence of light. We have used this property of the sensor to form a potential
divider. The potential at point ‘2’ is Rsensor / (Rsensor + R1). Again, a good
sensor circuit should give maximum change in potential at point ‘2’ for no-light
and bright-light conditions. This is especially important if you plan to use an ADC
in place of the comparator.
1. Parallel: Often 8 or more lines (wire conductors) are used to transfer data
to a device that is only few feet away.
2. Serial: To transfer to a device located many meters away, the serial
method is used. The data is sent one bit at a time.
Fig: Mode of Communication
At the transmitting end, the byte of data must be converted to serial bits using
parallel-in-serial-out shift register. At the receiving end, there is a serial-in-
parallel-out shift register to receive the serial data and pack them into byte. When
the distance is short, the digital signal can be transferred as it is on a simple wire
and requires no modulation. If data is to be transferred on the telephone line, it
must be converted from 0s and 1s to audio tones. This conversion is performed
by a device called a modem, “Modulator/demodulator”.
Serial data communication uses two methods. First are synchronous method
transfers a block of data at a time. Second is an asynchronous method transfer a
single byte at a time.
Due to the extended ASCII characters, 8-bit ASCII data is common in modern
PCs the use of one stop bit is standard. Assuming that we are transferring a text
file of ASCII characters using 1 stop bit, we have a total of 10 bits for each
character. In some systems in order to maintain data integrity, the parity bit of the
character byte is included in the data frame. 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. As far as the conductor
wire is concerned, the baud rate and bps are the same, and we use the terms
interchangeably. The data transfer rate of given computer system depends on
communication ports incorporated into that system.
8051 has two pins that are used specifically for transferring and receiving data
serially. These two pins are called TxD and RxD and are part of the port 3 group
(P3.0 and P3.1).These pins are TTL compatible; therefore, they require a line
driver to make them RS232 compatible. To allow data transfer between the PC
and an 8051 system without any error, we must make sure that the baud rate of
8051 system matches the baud rate of the PC’s COM port.
REGISTER STRUCTURE
SBUF Register: This is an 8-bit register used solely for serial communication. For
a byte data to be transferred via the TxD line, it must be placed in the SBUF
register. The moment a byte is written into SBUF, it is framed with the start and
stop bits and transferred serially via the TxD line. SBUF holds the byte of data
when it is received by 8051 RxD line. When the bits are received serially via
RxD, the 8051 defames it by eliminating the stop and start bits, making a byte out
of the data received, and then placing it in SBUF.
SCON Register: SCON is an 8-bit register used to program the start bit, stop bit,
and data bits of data framing, among other things.
SM0, SM1: They determine the framing of data by specifying the number of bits
per character, and the start and stop bits.
In 1945 Leon 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 covert listening
device, not an identification tag, it is considered to be a predecessor of RFID
technology, because it was likewise passive, being energized and activated by
electromagnetic waves from an outside source.
Similar technology, such as the IFF transponder invented in the United Kingdom
in 1915, 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 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).
What is RFID?
RFID is short for Radio Frequency Identification. Generally a RFID system
consists of 2 parts. A Reader, and one or more Transponders, also known as
Tags. RFID systems evolved from barcode labels as a means to automatically
identify and track products and people. You will be generally familiar with RFID
systems as seen in:
Contact less Payment Systems:
RFID tags used to carry payment information. RFIDs are particular suited to
electronic Toll collection systems. Tags attached to vehicles, or carried by
people transmit payment information to a fixed reader attached to a Toll station.
Payments are then routinely deducted from a users account, or information is
changed directly on the RFID tag.
Access Control:
RFID Readers placed at entrances that require a person to pass their proximity
card (RF tag) to be "read' before the access can be made.
Product Tracking and Inventory Control:
RFID systems are commonly used to track and record the movement of ordinary
items such as library books, clothes, factory pallets, electrical goods and
numerous items.
Shown below is a typical RFID system. In every RFID system the transponder
Tags contain information. This information can be as little as a single binary bit ,
or be a large array of bits representing such things as an identity code, personal
medical information, or literally any type of information that can be stored in
digital binary format.
Shown is a RFID transceiver that communicates with a passive Tag. Passive
tags have no power source of their own and instead derive power from the
incident electromagnetic field. Commonly the heart of each tag is a microchip.
When the Tag enters the generated RF field it is able to draw enough power from
the field to access its internal memory and transmit its stored information. When
the transponder Tag draws power in this way the resultant interaction of the RF
fields causes the voltage at the transceiver antenna to drop in value. This effect
is utilized by the Tag to communicate its information to the reader. The Tag is
able to control the amount of power drawn from the field and by doing so it can
modulate the voltage sensed at the Transceiver according to the bit pattern it
wishes to transmit.
COMPONENTS OF RFID
• An antenna or coil
1. ANTENNA
The antenna emits radio signals to activate the tag and read and write data to it.
Antennas are the conduits between the tag and the transceiver, which controls
the system's data acquisition and communication. Antennas are available in a
variety of shapes and sizes; they can be built into a door frame to receive tag
data from persons or things passing through the door, or mounted on an
interstate tollbooth to monitor traffic passing by on a freeway. The
electromagnetic field produced by an antenna can be constantly present when
multiple tags are expected continually. If constant interrogation is not required, a
sensor device can activate the field.
Often the antenna is packaged with the transceiver and decoder to become a
reader (a.k.a. interrogator), which can be configured either as a handheld or a
fixed-mount device. The reader emits radio waves in ranges of anywhere from
one inch to 100 feet or more, depending upon its power output and the radio
frequency used. When an RFID tag passes through the electromagnetic zone, it
detects the reader's activation signal. The reader decodes the data encoded in
the tag's integrated circuit (silicon chip) and the data is passed to the host
computer for processing.
2. TAGS (Transponders)
RFID TAGS
Data capacity
The amount of data storage on a tag can vary, ranging from 16 bits on the low
end to as much as several thousand bits on the high end. Of course, the greater
the storage capacity, the higher the price per tag.
Form factor
The tag and antenna structure can come in a variety of physical form factors and
can either be self-contained or embedded as part of a traditional label structure
(i.e., the tag is inside what looks like a regular bar code label—this is termed a
'Smart Label') companies must choose the appropriate form factors for the tag
very carefully and should expect to use multiple form factors to suit the tagging
needs of different physical products and units of measure. For example, a pallet
may have an RFID tag fitted only to an area of protected placement on the pallet
itself.
On the other hand, cartons on the pallet have RFID tags inside bar code labels
that also provide operators human-readable information and a back-up should
the tag fail or pass through non RFID-capable supply chain links.
While the tag requirements for compliance mandates may be narrowly defined, it
is likely that a variety of tag types will be required to solve specific operational
issues. You will want to work with a company that is very knowledgeable in tag
and reader technology to appropriately identify the right mix of RFID technology
for your environment and applications.
EPC Tags
EPC refers to "electronic product code," an emerging specification for RFID tags,
readers and business applications first developed at the Auto-ID Center at the
Massachusetts Institute of Technology. This organization has provided significant
intellectual leadership toward the use and application of RFID technology. EPC
represents a specific approach to item identification, including an emerging
standard for the tags themselves, including both the data content of the tag and
open wireless communication protocols. In a sense, the EPC movement is
combining the data standards embodied in certain bar code specifications, such
as the UPC or UCC-128 bar code standards, with the wireless data
communication standards that have been developed by ANSI and other groups.
3. RF Transceiver:
The RF transceiver is the source of the RF energy used to activate and power
the passive RFID tags. The RF transceiver may be enclosed in the same cabinet
as the reader or it may be a separate piece of equipment. When provided as a
separate piece of equipment, the transceiver is commonly referred to as an RF
module. The RF transceiver controls and modulates the radio frequencies that
the antenna transmits and receives. The transceiver filters and amplifies the
backscatter signal from a passive RFID tag.
Typical Applications for RFID
Potential uses
• Access management
• Tracking of goods and RFID in retail
• Tracking of persons and animals
• Toll collection and contactless payment
• Machine readable travel documents
• Smart dust (for massively distributed sensor networks)
• Location-based services
• Tracking Sports memorabilia to verify authenticity
• Airport Baggage Tracking Logistics
RFID chips
Future technology
The MAX232 is an integrated circuit that converts signals from an RS-232 serial
port to signals suitable for use in TTL compatible digital logic circuits. The
MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and
RTS signals. The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V)
from a single + 5 V supply via on-chip charge pumps and external capacitors.
This makes it useful for implementing RS-232 in devices that otherwise do not
need any voltages outside the 0 V to + 5 V range, as power supply design does
not need to be made more complicated just for driving the RS-232 in this case.
Control Signals
-3V to -15V 5V
(RTS/CTS/DTR/DSR) Logic 0
Control Signals
+3V to +15V 0V
(RTS/CTS/DTR/DSR) Logic 1
The DB9 connector is mainly used for serial connections, allowing for the
asynchronous transmission of data as provided for by standard RS-232 (RS-
232C).
Note that there are DB9-DB25 adapters for easily converting a DB9 plug into a
DB25, and vice versa.
PINS
Pin
number Name
1 CD - Carrier Detect
2 RXD - Receive Data
3 TXD - Transmit Data
DTR - Data Terminal
4 Ready
DESCRIPTION
A variable regulated power supply, also called a variable bench power supply, is
one where you can continuously adjust the output voltage to your requirements.
Varyingthe output of the power supply is the recommended way to test a project
after having double checked parts placement against circuit drawings and the
parts placement guide.
This type of regulation is ideal for having a simple variable bench power supply.
Actually this is quite important because one of the first projects a hobbyist should
undertake is the construction of a variable regulated power supply. While a
dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a
variable supply on hand, especially for testing.
Most digital logic circuits and processors need a 5-volt power supply. To use
these parts we need to build a regulated 5-volt source. Usually you start with an
unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power
supply is included with the Beginner Kit and the Microcontroller Beginner Kit.). To
make a 5 volt power supply, we use a LM7805 voltage regulator IC (Integrated
Circuit). The IC is shown below.
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the
power, you get a 5 volt supply from the Output pin.
CIRCUIT FEATURES:
Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA
Circuit protection: Built-in overheating protection shuts down output when
regulator IC gets too hot
Circuit complexity: Very simple and easy to build
Circuit performance: Very stable +5V output voltage, reliable operation
Availability of components: Easy to get, uses only very common basic
components
Design testing: Based on datasheet example circuit, I have used this circuit
succesfully as part of many electronics projects
Applications: Part of electronics devices, small laboratory power supply
Power supply voltage: Unreglated DC 8-18V power supply
Power supply current: Needed output current + 5 mA
Component costs: Few dollars for the electronics components + the input
transformer cost.
BLOCK DIAGRAM:
CIRCUIT DIAGRAM:
LM7805
3-Terminal 1A Positive Voltage Regulator
Features
• Output Current up to 1A
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection
Description
The MC7805 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 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.
Note:
Load and line regulation are specified at constant junction temperature. Change
in VO due to heating effects must be taken into account separately. Pulse testing
with low duty is used.
Quiescent Current Peak Output Current
LCD is a type of display used in digital watches and many portable computers.
LCD displays utilize to sheets of polarizing material with a liquid crystal solution
between them. An electric current passed through the liquid causes the crystals
to align so that light cannot pass through them. LCD technology has advanced
very rapidly since its initial inception over a decade ago for use in laptop
computers. Technical achievement has resulted in brighter displace, higher
resolutions, reduce response times and cheaper manufacturing process.
The liquid crystals can be manipulated through an applied electric voltage so that
light is allowed to pass or is blocked. By carefully controlling where and what
wavelength (color) of light is allowed to pass, the LCD monitor is able to display
images. A backlight provides LCD monitor’s brightness.
Over the years many improvements have been made to LCD to help enhance
resolution, image, sharpness and response times. One of the latest such
advancements is TFT or Thin Film Transistor. TFT-LCD’s make use of a very thin
transistor that is applied to glass during acts as switch allowing control of light at
the pixel level, greatly enhancing image sharpness and resolution. This has been
particularly important for improving LCD’s ability to display small-sized fonts and
image clearly.
Other advances have allowed LCD’s to greatly reduce liquid crystal cell response
times. Response time is basically the amount of time it takes for a pixel to
“change colors”. In reality response time is the amount of time it takes a liquid
crystal cell to go from being active to inactive.
LCD interfacing with 8052 is a real-world application. In recent years the LCD is
finding widespread use replacing LEDs (seven segment LEDs or other
multisegment LEDs). This is due to following reasons:
Incorporation of a refreshing controller into the LCD, thereby relieving the CPU to
keep displaying the data.
PIN DIAGRAM
One of the, pins are numbered on the LCD’s print circuit board (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 metalwork at
same point.
G +5V -5V
1 2 3
07 08 09 10 11 12 13 14 4 5 6
D0 D1 D2 D3 D4 D5 D6 D7 RS R/W EN
PIN DESCRIPTIONS
While Vcc and Vss provide +5V and ground respectively, Vee is used for
controlling LCD contrast.
There are two very important registers inside the LCD. The RS pin is used for
their selection as follows.
If RS=0, the instruction command code register is selected, allowing the user to
send a command such as clear display, cursor at home, etc.,
If RS=1 the data register is selected, allowing the user to send data to be
displayed on the LCD.
R/W, read/write
R/W input allows the user to write information to the LCD or read information
from it. R/W=1 when reading; R/W=0 when writing.
EN, Enable
The LCD to latch information presented to its data pins uses the enable pin.
When data is supplied to data pins, a high-to-low pulse must be applied to this
pin in order for the LCD to latch in the data present at the data pins. This pulse
must be a minimum of 450ns wide.
D0-D7
The 8-bit data pins, D0-D7, are used to send information to the LCD or read the
contents of the LCD’s internal registers.
To display letters and numbers, we send ASCII codes for the letters A-Z, a-z, and
numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to the LCD to clear
the display or force the cursor to the home position or blink the instruction
command codes.
We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive
information. The busy flag is D7 and can be read when R/W=1 and RS=0, as
follows: if R/W=1,RS=0. When D7=1 (busy flag=1), the LCD is busy taking care
of internal operations and will not accept any information.
When LCD is powered up, the display should show a series of dark squares,
possibly only on part of display. These characters are actually in their off state,
so the contrast control should be adjusted anti-clockwise until the squares are
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 characters are
entered, they cannot be seen. It is therefore necessary to issue a command at
this point, to switch the display on.
Prototype circuit:
The two registers 1) Instruction Register (IR) and the 2) Data Register (DR) in the
KS0066 controller chip are directly controlled by the MPU. Control information is
temporarily stored in these registers prior to internal operation start. This allows
interface to various types of MPUs which operate at different speeds from that of
the KS0066, and allows interface from peripheral control ICs. Internal operations
of the KS0066 are determined from the signals sent from the MPU. These
signals, including register selection signals (RS), Read/Write (R/W) and data bus
signals (DBO - DB7) are polled instructions.
Returns cursor to home position. First line first character blocks on all 1, 2 and 4
line display; except L4044 refer “clear display”: (Address 0; A,, “80”). The
contents of DD RAM remain unchanged.
D: Display is turned ON when D = 1 and OFF when D =0. When display is OFF,
display data in DD RAM remains unchanged. Information comes back
immediately when D = 1 is entered.
C: Cursor is displayed when C = 1 and not displayed when C = 0. If the cursor
disappears, function of I/D etc.
S: Shifts the entire display to either the right or left when S = 1 (high). When S =
1 and I/D = 1 the display shifts one position to the left. When S = 1 and I/D = 0
the display shifts one position to the right. This right or left shift occurs after each
data write to DD RAM. Display is not shifted when reading from DD RAM.
Display is not shifted when S = 0.
In a 5 x 7 dot matrix there is an eighth line which functions as the cursor.
B: When B = 1, the character at the cursor position starts blinking. When B = 0
the cursor does not blink. The blink is done by stitching between the all black dot
matrix and displayed character at 0.4 second intervals. The cursor and the blink
can be set at the same time (fosc = 250 kHz).
5 X 7 DOT MATRIX
C = 1 (cursor display) B = 1 (blinking)
Cursor Conditions
Cursor/Display Shift moves the cursor or shifts the display without changing the
DD RAM contents. The cursor position and the AC contents match. This
instruction is available for display correction and retrieval because the cursor
position or display can be shifted without writing or reading display data. In case
of a 2-line display, the cursor is shifted from character block 40 of line 1 to
character block 1 of line 2. Displays of lines 1 and 2 are shifted at the same time.
In case of a 4-line display, the cursor does not move continuously from line 2 to
line 3. The cursor is shifted from character block 40 of line 3 to character block 1
of line 4. Displays of lines 3 and 4 are shifted at the same time. The display
pattern of line 2 or 4 is not shifted to line 1 or 3.
PRINTED CIRCUIT BOARD
1) Technology
2) Design
Conductor materials available are silver, brass, aluminium and copper. Copper is
most widely used. The thickness of conducting material depends upon the
current carrying capacity of circuit. Thus a thicker copper layer will have more
current carrying capacity.
Advantages of PCB
Classifications of laminates :
Laminates
There materials are built from several layers of paper or glass, which are
bound together under heat and pressure to form rigid sheets. The binder is
usually a phenolic resin in the case of glass base.
The copper layer is formed on either side or two sides of the laminate.
Because of the different filters and binding resins the characteristic properties
of copper clad laminates change.
The rigid sheets of filters which form reinforcement use paper in the form of
alpha cellulose, craft or rags. These are cheaper and have easy machinbillity.
Glass filter uses glass fibers which are woven to give cloth like appearance.
This gives a high mechanical strength, they are better moisture resistant than
above type.
Binding resins are either phenolic or epoxy as mentioned before in addition
to these; phenol formaldehyde and polyesters are also used. Of these, Epoxy
resin has
Good electrical and mechanical properties.
Types of laminates:
National electrical manufactures association (NEMA) has various grades of
laminates that are obtained by different resins and filters.
(1) Phenolic:
Phenol and formaldehyde produce phenolic paper base laminate has
phenolic resins with proper filter. The co lour of this base material is usually
brown and it is opaque. Certain additives and the grid is called FR grade.
Disadvantages:
Epoxy paper: this is also paper base is impregnated with epoxy resin. The co lour
is yellowish white and it is translucent.
Epoxy glass: this base material is more expensive but is combines relative
strength and good is mainly because of glass fiber. The co lour of this material is
usually green and it is semitransparent.
(c) They have better mechanical strength as mentioned before due to low
shrinkage.
They are mostly used with glass fiber. Their water resistance is good.
These are mostly used with glass fiber. Their maximum temperature limit is
165C.
Advantages:
(a)It has low dissipation factor over wide rang of temperature, humidity and
frequency rang.
They have good heat resistance and good electrical properties .However their
mechanical properties are not good.
This is the best polymer for heat resistance. When used with glass this gives
good mechanical properties. They has better adhesion to copper. Normally used
for military and space applications.
There are a number of specifications that are applicable to copper clad laminated
e.g.
The conductor pattern which is on the master film is transferred on copper clad
laminate by two methods.
Photopolymer resist is a light sensitive organic material like KPR (Kodak photo
resist), which is applied to the board as a film. The photo resist when exposed
ultraviolet light hardens ore polymerizes. Once it is polymerized, it becomes
insoluble to certain chemical solvents known as developers.
The developer dissolves the portion which is masked or which is not exposed to
light. Thus the pattern that is to be drawn on PCB is derived from the artwork,
which is a photographical process. This is transferred to a master film on 1:1
scale. This can be reduced to any small size thus miniaturization is possible. The
pattern is transferred to a mask. This mask is kept on PCB. The whole process is
known as image transfer.
Now it is subjected to UV rays. The unpolymerized or masked portion is washed
away in developer leaving wanted copper pattern on board. KPR or photo resist
is then removed
(3) It should have good possibility to strip after unwanted copper is removed.
(2) Lamps
This technique is similar to the used in printing industry. The copper foil is
covered with printing ink where the conduction paths are going to be.
The screen, which is used for pattern, is of either stainless steel or polyester
mesh, which is dimensionally accurate and fine mesh. The open meshes of
screen correspond to the pattern.
squeegee
screen ink
frame
hinge
PCB
After drying board is washed in ferric chloride which acts as etchant. Etching is a
chemical process by which unwanted copper is removed. The portion which is
covered by ink is not removed, that is the pattern remains intact. Later ink
stripping is done with tricholoroethylene.
Requirements of inks:
As shown in figure
screen
Cu foil
Base material
After deposition of ink it spreads slightly under the mesh and shows a trapezoidal
shape. The printing ink should not be too thin thick to get proper pattern on the
board.
The time or exposure to light depends upon the properties of ink, distance of
board from light source and humidity also.
Screen printing can be done mechanically also. The screen cleaning is done
from the side on which ink was applied. The cleaning solution is normally a
thinner or a solvent.
Copper when exposed to atmosphere for a long time gets tarnished and
problems are created while soldering.
However solder ability again depends on the lacquer or varnish properties, the
thickness of these coatings.
(3) Electroplating
(1) Immersion plating utilizes tin and its alloys and good. It is done by chemical
replacement from coating material salt solution. This method is simple and less
costly
(2) In electronics copper plating, electric current is not used instead a chemical
reducing agent is used which supplies electrons for reaction in which copper is
reduced from its ionic state.
(3) In electroplating a d.c. Current is passed between two electrodes and a thin
coating is deposited on cathode when immersed in electrolyte.
Of these ferric chloride is widely used because it has short etching time and it
can be stored for a longer time rinsing follows etching.
Solders are special alloys, which are used to get either a mechanically strong
joint or electric joint of low contact resistance. Solders have low melting points
compared to meals to be joined. Therefore when solder is heated, molten solder
wets the metal, spreads and joins.
Any contamination on the surface of the metal to be joined acts as a barrier and
hampers as action of wetting.
Soft solders have lower melting point and lower tensile strength. soft solders are
largely tin lead alloys with 18%to 19% of tin. Hard solders are copper zinc alloys
and silver base compostions.fluxs are auxiliary materials used while soldering is
done.
(1) They dissolve and remove oxides and contaminants from surface of metals to
be. Soldered.
(2) They protect the metal surface and molten solder from oxidation
(b) Acid free fluxes: these are rosin base materials with addition of glycerin and
alcohol.
(c) Activated fluxes: these are rosin base fluxes with activating agents like
hydrochlorides and phosphates of aniline, salicylic acid in small amount.
(d) Corrosion resistant fluxes: these fluxes are based on phosphoric acid with
addition of various organic compositions and solvents.
Soldering iron consists of a bit usally made of copper and an insulated handle
connected to the bit with a metal shank.
The bit is heated which melts solders alongwith flux to make a joint.
Soldering irons of different wattages are available for different kinds of work.
Mass soldering is done in factories or electronic industries where the whole PCB
assembly can be soldered from one side where the component leads come out.
(1) Dip soldering: PCB assembly is lowered vertically in the solder bath as
shown in
PCB
(5) All the wire leads must be of same length under the board.
Component mounting on PCB:
solder
Axial mounting Vertical mounting
(2) When the space is to be saved then vertical mounting is preferred. The
vertical lead must have an insulating sleeve.
(3) Where jumper wires cross over conductors, they must be insulated.
(4) For mounting of ICS, TOS, DIP packages, special jigs must be used for easy
insertion.
(5) While mounting transistors, each lead must has insulating sleeve. All the
leads must be cut with sharp cutter to same lengths seen from the surface that is
to be soldered.
Designing of PCB:
Layout and artwork are the most important aspects of designing of PCB
Artwork is normally produced at 1:1 or 2:1 scale. Grid system is also used when
drilling of holes for components while preparing layout, bishop graphics inc. ‘’
puppets’’ or replica of components or IC holders are used.
There are certain standard norms that are to be followed while preparing layout
or network. Component code is also to be standardized.ANSI or American
national standard institute recommends.
R= Resistor
Q=Transistor
C= Capacitor
U= Integrated circuit
T=T transformer
CR= Diode
0.5 mm 0.6 mm
1 mm 1.1 mm
2 mm 1.5 mm
4 mm 3.2 m
(1) Current carrying capacity depends upon the track width. Due to high currents,
there is temperature rise caused in conductors. Ideally under normal working
conditions there should not be temperature rise in conductors.
(2) When two conductors are running parallel to each other, depending upon the
dielectric constant of laminate, there exist certain capacitance. Similarly in double
– sided boards when tracks are on either side of board, there is capacitance as
two tracks are considered to be metal conductors with laminate as dielectric.
(3) For fast signals or high-speed logic circuits the tracks or conductors can be
considered as transmission lines, with.
Zo = L1
C1
(6) Heat sensitive components must be kept away from heat producing ones.
(7) Sufficient test points must be given and components must have easy
accessibility for replacement.
(8) When two signal lines are running close to each other, there is possibility of
cross talk. To reduce this and electro magnetic interference all unused copper
surfaces are connected to ground. Ground line is made sufficiently broad.
(9) Normally low power level and high power level wires are twisted outside PCB
to protect the circuits from electro magnetic coupling.
For artwork adhesive tapes may be used which are obtained in various shapes
and sizes.
The film (either negative or positive) that is used for direct exposure of photo
resist coated PCB is known as master film.
Special types cameras are to be used to reduce the artwork to a certain size.
After exposure the film is developed which can be used as a mask on photo
resist coated PCB to give required pattern.
Tos/8
pads
Dip
Conductor pads
Transistor pad
Conductors
(c) (e)
(a)
Through holes plated through holes are more expensive but they do not have the
problem of deburring of holes after drilling. Ordinary DSBs must use jumper wires
for interconnections.
Different types of processes are in vogue while making double sided boards.
(1) Print and etch process: this is similar subtractive process, which is used
single sided board, where master negative film. is used on resist from both the
sides. After exposure, developing, etching and stripping follows. Holes are drilled
for component soldering.
(2) Panel plating process: in this process, holes are drilled first then the whole
panel is plated with the help of electro less plating. Thus holes get a thin layer of
copper on the surface of walls. The board then follows the above print etch
procedure.
(3) Pattern plating process: this is an additive process in the sense the required
pattern is left open with rest of the area covered. Thus after electroplating, the
actual pattern and the holes get electroplated. This is most widely used
procedure.
(4)Tenting process: this is similar to print and etch process, which has plated
through holes.
The positive resists protects the required pattern and holes from etchant attacks,
like a tent and hence the name.
Multilayer boards:
A number of PCB ‘s are stacked together with adhesive and electrical
connections between different conducting layer are done with plated through
holes as shown in figure:
Multilayer boards
(2) Whenever space and volume are of prime importance these boards are used.
Epoxy glass cloth has insulation thickness of 1 to 3 mils. It has dielectric strength
of 2000 volts/mil. And fold endurance of 10,000 cycles.
SOURCE CODE
14. Now double click on the Target1, you would get another option “Source
group 1” as shown in next page.
15. Click on the file option from menu bar and select “new”
16. The next screen will be as shown in next page, and just maximize it by
double clicking on its blue boarder.
17. Now start writing program in either in “C” or “ASM”
18. For a program written in Assembly, then save it with extension “. asm”
and for “C” based program save it with extension “ .C”
19. Now right click on Source group 1 and click on “Add files to Group
Source”
20. Now you will get another window, on which by default “C” files will
appear.
21. Now select as per your file extension given while saving the file
23. Now Press function key F7 to compile. Any error will appear if so
happen.
24. If the file contains no error, then press Control+F5 simultaneously.
27. Now Click on the Peripherals from menu bar, and check your required
port as shown in fig below
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key “F11” slowly and observe.
STAR T
ENTRY IS EXIT
ENTR
Y
/EXIT
#include<reg52.h>
#include<lcd.h>
void disp_name() ;
void delay(int x);
void disp_name1();
void disp_name2();
void disp_name3();
void disp_name4();
void disp_name5();
void disp_name6();
void disp_name7();
void disp_name8();
void smoke();
void ldr();
void temp();
void timer_0_load();
char databyte[]={"0123456789"};
unsigned char i;
int a,b,c,j,k,l;
////////////////////////////////////////////////////////////////////
void main()
{
lcd_init();
disp_name();
delay(100);
disp_name1();
delay(100);
disp_name2();
#include<reg52.h>
#include<lcd.h>
void disp_name() ;
void delay(int x);
void disp_name1();
void disp_name2();
void disp_name3();
void disp_name4();
void disp_name5();
void disp_name6();
void disp_name7();
void disp_name8();
void smoke();
void ldr();
void temp();
void timer_0_load();
char databyte[]={"0123456789"};
unsigned char i;
int a,b,c,j,k,l;
////////////////////////////////////////////////////////////////////
void main()
{
lcd_init();
disp_name();
delay(100);
disp_name1();
delay(100);
disp_name2();
delay(100);
disp_name3();
delay(100);
timer_0_load();
while(1)
}
}
////////////////////////////////////////////////////////////////////////
void disp_name()
{
while(1)
}
}
////////////////////////////////////////////////////////////////////////
void disp_name()
{
char i=0;
char databyte[]={" temperature. reading"};
send_command(0x80);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
delay(50);
i++;
}
}
/////////////////////////////////////////////////////////////////
void disp_name1()
{
char i=0;
char databyte[]={" Degree Centegrate"};
send_command(0xC3);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
////////////////////////////////////////////////////////////
void disp_name2()
{
char i=0;
char databyte[]={"Smoke/LPG "};
send_command(0x94);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
///////////////////////////////////////////////////////////////////////////////////////////
void disp_name3()
{
char i=0;
char databyte[]={"LIGHT/BULB"};
send_command(0xd4);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
/////////////////////////////////////////////////////////////////////
void disp_name4()
{
char i=0;
char databyte[]={" is sensed" };
send_command(0x9e);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
/////////////////////////////////////////////////////////////////////////////////////////////////
void disp_name8()
{
char i=0;
char databyte[]={" " };
send_command(0x9e);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void disp_name7()
{
char i=0;
char databyte[]={"prohibited" };
send_command(0x9e);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void disp_name5()
{
char i=0;
char databyte[]={"is ON*"};
send_command(0xde);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
////////////////////////////////////////////////////////////////////////////////////////////
void disp_name6()
{
char i=0;
char databyte[]={"is OFF"};
send_command(0xde);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}}
////////////////////////////////////////////////////////////
void timer_0_load()
{ TR0=1;
TCON=0X01;
TMOD=0X01;
TH0=0XEC;
TL0=0X78;
TR0=0;
ET0=1;
EA=1;
}
//////////////////////////////////////////////////////////////////////////
void timet0(void) interrupt 1
{
timer_0_load();
smoke();
////////////////////DELAY////////////////////////////////////////
void delay(int x)
{
int i,j;
for(i=0;i<=x;i++)
{
for(j=0;j<150;j++)
{ }
}
}
///////////////////SMOKE SENSOR///////////////////////////////
void smoke()
{
disp_name7();
if(P37==0)
{
for(k=0;k<1;k++)
{
P21=0;
disp_name4();
delay(100);
P21=1;
disp_name8();
delay(100);
k++;
}
}
////////////////////////////////LDR////////////////////////////////////
void ldr()
{
if(P36==0)
{
P20=1;
lcd_init1();
disp_name6();
}
if(P36==1)
{
P20=0;
lcd_init1();
disp_name5();
}
}
//////////////////TEMPERATURE SENSOR//////////////////////////////////////////////////////////
void temp()
{
i=P0;
a=i%10; b=i/10; c=i/100;
send_command(0xc0);
send_data(databyte[c]);
lcd_init1();
send_command(0xc1);
send_data(databyte[b]);
lcd_init1();
send_command(0xc2);
send_data(databyte[a]);
if(b>2)
{
P22=0;
}
else
{
P22=1;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
Source Code for Receiver
#include<reg52.h>
#include<lcd.h>
void disp_name() ;
void delay(int x);
void disp_name1();
void disp_name2();
void disp_name3();
void disp_name4();
void disp_name5();
void disp_name6();
void temp();
void light();
void timer_0_load();
void main()
{
P0=0x00;
delay(1);
lcd_init();
timer_0_load();
while(1)
{
if(P21==0)
{ lcd_init1();
disp_name2();
P01=1;
}
if(P21==1)
{
lcd_init1();
disp_name3();
P01=0;
}
}
}
/////////////////////////////////////////////////////////////////////
void delay(int x)
{
int i,j;
for(i=0;i<x;i++)
{
for(j=0;j<1000;j++)
{}
}
}
////////////////////////////////////////////////////////////////////
void disp_name()
{
char i=0;
char databyte[]={"BULB ON "};
send_command(0x80);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}
}
//////////////////////////////////////////////////////////
void disp_name5()
{
char i=0;
char databyte[]={"BULB OFF**"};
send_command(0x80);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}
}
//////////////////////////////////////////////////////////////////////////
void disp_name2()
{
char i=0;
char databyte[]={"SMOKE/LPG SENSED"};
send_command(0xC0);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}
}
/////////////////////////////////////////////////////////////////////////////
void disp_name3()
{
char i=0;
char databyte[]={"SMOKE prohibited"};
send_command(0xC0);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}
}
///////////////////////////////////////////////////////////////////////////////
void disp_name4()
{
char i=0;
char databyte[]={"*****FAN ON*****"};
send_command(0x80);
while(databyte[i'\0')
{
send_data(databyte[i]);
i++;
}
}
//////////////////////////////////////////////////////////////////////
void disp_name6()
{
char i=0;
char databyte[]={"****FAN**OFF****"};
send_command(0x80);
while(databyte[i]!='\0')
{
send_data(databyte[i]);
i++;
}
}
///////////////////////////////////////////////////////////////////////////////
void timer_0_load()
{ TR0=0;
TCON=0X01;
TMOD=0X02;
TH0=0X0ec;
TL0=0X00;
TR0=1;
ET0=1;
EA=1;
}
//////////////////////////////////////////////////////////////////////////
void timet0(void) interrupt 1
{
timer_0_load();
light();
}
//////////////////////////////////////////////////////////////////////
void temp()
{
if(P22==0)
{
P02=1;
disp_name4();
}
if(P22==1)
{
P02=0;
disp_name6();
}
//////////////////////////////////////////////////////////////////////////////////
void light()
{
if(P20==0)
{
disp_name() ;
P00=1;
}
if(P20==0
{
disp_name5() ;
P01=0;
}}
FUTURE ENHANCEMENT
-Kenneth J.Ayala
-B.Ram
-Ramesh S.Gaonkar
Electronic Components
-D.V.Prasad
Wireless Communications
- Theodore S. Rappaport
Mobile Tele Communications
- William C.Y. Lee