You are on page 1of 82

1.

OVERVIEW

1
1. OVERVIEW

1.1 Introduction:
As we have different languages in our world and its impossible for us to
know all the languages. When dumb or illiterate people are traveling by airlines they
can’t speak to air hostess as dumb people can’t speak and illiterate may not know the
language to communicate with air hostess. So in this case we need intelligent
communication system. In this project we are building a device that helps them in
expressing their needs with other language people (Air hostess) i.e. request them if we
need any thing in the flight like coffee, tea, drinks etc.

In this project we use GLCD and Touch screen Technology to


make it easy even to illiterates as it is also included with images, which indicates the
needs. This even reduces the difficulty to airhostess in receiving the customers with
different languages. Here for wireless communication purpose we use Zigbee technology.

ZigBee is a wireless technology developed as an open global standard to address


the unique needs of low-cost, low-power, wireless sensor networks. Zigbee is the set of
specs built around the IEEE 802.15.4 wireless protocol. As Zigbee is the upcoming
technology in wireless field, we had tried to demonstrate its way of functionality and
various aspects like kinds, advantages and disadvantages using a small application of
controlling the any kind of electronic devices and machines. The Zigbee technology is
broadly adopted for bulk and fast data transmission over a dedicated channel.

This project consists of Zigbee based system that transmits the wireless
signals according to the input given by the user using touch screen. At the receiver
(airhostess) end the information will be displayed on GLCD in English language. Here
when user sends his need through touch screen, then micro controller transmits that
information through Zigbee transmitter. The information received by the Zigbee receiver
will be displayed on GLCD.

2
1.2 Aim of project:
The main aim of this project is to construct a user friendly multi-
language communication system for illiterate/dumb people traveling by Airlines.

1.3 Methodology
In this project we are constructing two circuits, one is transmitter
circuit used for transmitting signal to airhostess from passenger, and another is receiver
for airhostess to receive the signal from passenger.

In transmitter circuit there is printed paper showing images of water,


medicine etc., is attached to touch screen. When passenger press on a particular image
microcontroller reads the exact location of touch and transmits a signal corresponding to
location. For example if there are two images on touch screen and first image is water,
second image is medicine. If passenger press on water microcontroller transmits ‘1’.
Other wise it sends’2’.

To carry this signal from transmitter to receiver, here we use two


ZigBee transceivers. One module receives signal from transmitter controller and
transmits the same. And another receives the signal transmitted by first ZigBee module
and sends same to receiver microcontroller. Receiver microcontroller analyses the data
received and display message correspondingly on LCD. For example if received ‘1’, it
will display seat no. and “requesting water”.

3
1.3.1 Block diagram:

Touchsc

1.4 Applications:

The applications of this project are:

• Very useful even for illiterates.


• Faster and secure data transmission.
• User friendly and easy to install.
• Helpful in abroad to express user’s needs.
• Deaf and dump people also can interact with others.
• Can be used with any languages.
1.5 Organization of report:
Details about hardware are given in chapter3. Details of
communication protocol are given chapter4. Details about implementation and coding are
given in chapter5.

4
2. HARDWARE ANALYSIS

5
2. Hardware analysis
2.1. Power supply

Power supply is the major concern for every electronic device .Since the controller and
other devices used are low power devices there is a need to step down the voltage and as
well as rectify the output to convert the output to a constant dc

2.1.1 Transformer

Transformer is a device used to increment or decrement the input voltage given as per the
requirement. The transformers are classified into two types depending upon there
functionality

• Step up transformer
• Step down transformer

Here we use a step down transformer for stepping down the house hold ac power supply
i.e. the 230-240v power supply to 5 v .We use a 5-0-5 v center tapped step down
transformer.

2.1.2 Rectifier

The output of the transformer is an ac and should be rectified to a constant dc for this it is
necessary to feed the output of the transformer to a rectifier.

The rectifier is employed to convert the alternating ac to a constant dc. There are
many rectifiers available in the market some of them are:-

• Half wave rectifier


• Full wave rectifier
• Bridge rectifier

The rectification is done by using one or more diodes connected in series or parallel.

If only one diode is used then only first half cycle is rectified and it is termed as half
wave rectification and the rectifier used is termed as Half wave rectifier. If two diodes
are employed in parallel then both positive and negative half cycles are rectified and this
is full wave rectification and the rectifier is termed as Full wave rectifier.
If the diodes are arranged in the form of bridge then it is termed as Bridge rectifier,

6
it acts as a full wave rectifier.

These rectifiers are available in the market in the form of integrated chips (I.Cs)

1.1.3 Voltage regulator

The voltage regulator is used for the voltage regulation purpose. We use IC 7805 voltage
regulator.

The IC number has a specific significance. The number 78 represents the series
while 05 represent the output voltage generated by the IC

1.1.4 Light emitting diode

We employ a light emitting diode for testing the functionality of the power supply circuit.
Here we use a 5 volts LED which is connected in series with the power supply circuit it
verifies the functioning of the power supply

LED’s are also employed in other areas for many purposes. The fallowing are the
advantages of using LED’s.

• It helps us while troubleshooting the device i.e. when the device is


malfunctioning it would be easy to detect where the actual problem a raised
• LED employed with microcontroller verifies whether data is being
transmitted
• It verifies the functionality of the power supply.

7
2.2 Microcontroller PIC16F73
2.2.1. Introduction
The PIC16f73 CMOS FLASH-based 8-bit microcontroller is upward compatible with the
PIC16C5x, PIC12Cxxx and PIC16C7x devices. It features 200 ns instruction execution,
256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 8
channels of 10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM
functions, a synchronous serial port that can be configured as either 3-wire SPI or 2-wire
I2C bus, a USART, and a Parallel Slave Port.
2.2.2. High-Performance RISC CPU
• Lead-free; RoHS-compliant
• Operating speed: 20 MHz, 200 ns instruction cycle
• Operating voltage: 4.0-5.5V
• Industrial temperature range (-40° to +85°C)
• 15 Interrupt Sources
• 35 single-word instructions
• All single-cycle instructions except for program branches (two-cycle)
2.2.3 Special Microcontroller Features
• Flash Memory: 14.3 Kbytes (8192 words)
• Data SRAM: 368 bytes
• Data EEPROM: 256 bytes
• Self-reprogram able under software control
• In-Circuit Serial Programming via two pins (5V)
• Watchdog Timer with on-chip RC oscillator
• Programmable code protection
• Power-saving Sleep mode
• Selectable oscillator options
• In-Circuit Debug via two pins
2.2.4Peripheral Features
• 33 I/O pins; 5 I/O ports

8
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler
• Can be incremented during Sleep via external crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
• Two Capture, Compare, PWM modules
• 16-bit Capture input; max resolution 12.5 ns
• 16-bit Compare; max resolution 200 ns
• 10-bit PWM
• Synchronous Serial Port with two modes:
• SPI Master
• I2C Master and Slave
• USART/SCI with 9-bit address detection
• Parallel Slave Port (PSP)
• 8 bits wide with external RD, WR and CS controls
• Brown-out detection circuitry for Brown-Out Reset
• Analog Features
• 10-bit, 8-channel A/D Converter
• Brown-Out Reset

2.2.5 Analog Comparator module


• analog comparators
• Programmable on-chip voltage reference module
• Programmable input multiplexing from device inputs and internal VREF
• Comparator outputs are externally accessible
CMOS Technology:

• Low power, high speed CMOS FLASH technology


• Fully static design
• Wide operating voltage range: 2.0V to 5.5V

9
• High Sink/Source Current: 25 mA
• Industrial temperature range
• Low power consumption:
- < 2 mA typical @ 5V, 4 MHz
- 20 μA typical @ 3V, 32 kHz
- < 1 μA typical standby current

Following are the major blocks of PIC Microcontroller.

Program memory (FLASH) is used for storing a written program.


Since memory made in FLASH technology can be programmed and cleared more than
once, it makes this microcontroller suitable for device development.

EEPROM - data memory that needs to be saved when there is no supply.


It is usually used for storing important data that must not be lost if power supply suddenly
stops. For instance, one such data is an assigned temperature in temperature regulators. If
during a loss of power supply this data was lost, we would have to make the adjustment
once again upon return of supply. Thus our device looses on self-reliance.

RAM - Data memory used by a program during its execution. In RAM are stored all
inter-results or temporary data during run-time.
PORTS are physical connections between the microcontroller and the outside world.
PIC16f73 has five I/O Ports and 33 pins in all 5 ports.
FREE-RUN TIMER is an 8-bit register inside a microcontroller that works
independently of the program. On every fourth clock of the oscillator it increments its
value until it reaches the maximum (255), and then it starts counting over again from
zero. As we know the exact timing between each two increments of the timer contents,
timer can be used for measuring time which is very useful with some devices.

CENTRAL PROCESSING UNIT has a role of connective element between other

10
blocks in the microcontroller. It coordinates the work of other blocks and executes the
user program.

CISC, RISC
It has already been said that PIC16f73 has RISC architecture. This term is often found in
computer literature, and it needs to be explained here in more detail. Harvard architecture
is a newer concept than von-Neumann. It rose out of the need to speed up the work of a
microcontroller. In Harvard architecture, data bus and address bus are separate. Thus a
greater flow of data is possible through the central processing unit, and of course, a
greater speed of work. Separating a program from data memory makes it further possible
for instructions not to have to be 8-bit words. PIC16f73 uses 14 bits for instructions
which allows for all instructions to be one word instructions. It is also typical for Harvard
architecture to have fewer instructions than von-Neumann's, and to have instructions
usually executed in one cycle.

Microcontrollers with Harvard architecture are also called "RISC


Microcontrollers". RISC stands for Reduced Instruction Set Computer. Microcontrollers
with von-Neumann's architecture are called 'CISC microcontrollers'. Title CISC stands
for Complex Instruction Set Computer.

Since PIC16f73 is a RISC microcontroller, that means that it has a reduced set of
instructions, more precisely 35 instructions. (Ex. Intel's and Motorola's microcontrollers

11
have over hundred instructions) All of these instructions are executed in one cycle except
for jump and branch instructions. According to what its maker says, PIC16f73 usually
reaches results of 2:1 in code compression and 4:1 in speed in relation to other 8-bit
microcontrollers in its class.

2.2.6 Applications
PIC16F73 perfectly fits many uses, from automotive industries and controlling home
appliances to industrial instruments, remote sensors, electrical door locks and safety
devices. It is also ideal for smart cards as well as for battery supplied devices because of
its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where permanent
storage of various parameters is needed (codes for transmitters, motor speed, receiver
frequencies, etc.). Low cost, low consumption, easy handling and flexibility make
PIC16F73 applicable even in areas where microcontrollers had not previously been
considered (example: timer functions, interface replacement in larger systems,
coprocessor applications, etc.).

In System Programmability of this chip (along with using only two pins in data transfer)
makes possible the flexibility of a product, after assembling and testing have been
completed. This capability can be used to create assembly-line production, to store
calibration data available only after final testing, or it can be used to improve programs
on finished products.

2.2.7 Clock / instruction cycle


Clock is micro controller’s main starter, and is obtained from an external component
called an "oscillator". If we want to compare a microcontroller with a time clock, our
"clock" would then be a ticking sound we hear from the time clock. In that case,
oscillator could be compared to a spring that is wound so time clock can run. Also, force
used to wind the time clock can be compared to an electrical supply.

Clock from the oscillator enters a microcontroller via OSC1 pin where internal circuit of

12
a microcontroller divides the clock into four even clocks Q1, Q2, Q3, and Q4 which do
not overlap. These four clocks make up one instruction cycle (also called machine cycle)
during which one instruction is executed.

Execution of instruction starts by calling an instruction that is next in string. Instruction is


called from program memory on every Q1 and is written in instruction register on Q4.
Decoding and execution of instruction are done between the next Q1 and Q4 cycles. On
the following diagram we can see the relationship between instruction cycle and clock of
the oscillator (OSC1) as well as that of internal clocks Q1-Q4. Program counter (PC)
holds information about the address of the next instruction.

Pipelining
Instruction cycle consists of cycles Q1, Q2, Q3 and Q4. Cycles of calling and executing
instructions are connected in such a way that in order to make a call, one instruction cycle
is needed, and one more is needed for decoding and execution. However, due to
pipelining, each instruction is effectively executed in one cycle. If instruction causes a
change on program counter, and PC doesn't point to the following but to some other
address (which can be the case with jumps or with calling subprograms), two cycles are
needed for executing an instruction. This is so because instruction must be processed
again, but this time from the right address. Cycle of calling begins with Q1 clock, by
writing into instruction register (IR). Decoding and executing begins with Q2, Q3 and Q4
clocks.

13
TCY0 reads in instruction MOVLW 55h (it doesn't matter to us what instruction
was executed, because there is no rectangle pictured on the bottom).
TCY1 executes instruction MOVLW 55h and reads in MOVWF PORTB.
TCY2 executes MOVWF PORTB and reads in CALL SUB_1.
TCY3 executes a call of a subprogram CALL SUB_1, and reads in instruction BSF
PORTA, BIT3. As this instruction is not the one we need, or is not the first instruction of
a subprogram SUB_1 whose execution is next in order, instruction must be read in again.
This is a good example of an instruction needing more than one cycle.
TCY4 instruction cycle is totally used up for reading in the first instruction from a
subprogram at address SUB_1.
TCY5 executes the first instruction from a subprogram SUB_1 and reads in the next one.

14
Pins on PIC16F73 microcontroller have the following meaning:

There are 28 pins on PIC16F73. Most of them can be used as an IO pin. Others are
already for specific functions. These are the pin functions.
1. MCLR – to reset the PIC
2. RA0 – port A pin 0
3. RA1 – port A pin 1
4. RA2 – port A pin 2
5. RA3 – port A pin 3
6. RA4 – port A pin 4
7. RA5 – port A pin 5
8. VSS – ground
9. OSC1 – connect to oscillator
10. OSC2 – connect to oscillator

15
11. RC0 – port C pin 0 VDD – power supply
12. RC1 – port C pin 1
13. RC2 – port C pin 2
14. RC3 – port C pin 3
15. RC4 - port C pin 4
16. RC5 - port C pin 5
17. RC6 - port C pin 6
18. RC7 - port C pin 7
19. VSS - ground
20. VDD – power supply
21. RB0 - port B pin 0
22. RB1 - port B pin 1
23. RB2 - port B pin 2
24. RB3 - port B pin 3
25. RB4 - port B pin 4
26. RB5 - port B pin 5
27. RB6 - port B pin 6
28. RB7 - port B pin 7

By utilizing all of this pin so many application can be done such as:
1. LCD – connect to Port B pin.
2. LED – connect to any pin declared as output.
3. Relay and Motor - connect to any pin declared as output.
4. External EEPROM – connect to I2C interface pin – RC3 and RC4 (SCL and SDA)
5. LDR, Potentiometer and sensor – connect to analogue input pin such as RA0.
6. GSM modem dial up modem – connect to RC6 and RC7 – the serial communication
interface using RS232 protocol.

For more detail function for each specific pin please refer to the device datasheet from
Microchip.

16
Ports
Term "port" refers to a group of pins on a microcontroller which can be accessed
simultaneously, or on which we can set the desired combination of zeros and ones, or
read from them an existing status. Physically, port is a register inside a microcontroller
which is connected by wires to the pins of a microcontroller. Ports represent physical
connection of Central Processing Unit with an outside world. Microcontroller uses them
in order to monitor or control other components or devices. Due to functionality, some
pins have twofold roles like PA4/TOCKI for instance, which is in the same time the
fourth bit of port A and an external input for free-run counter. Selection of one of these
two pin functions is done in one of the configuration registers. An illustration of this is
the fifth bit T0CS in OPTION register. By selecting one of the functions the other one is
disabled.
All port pins can be designated as input or output, according to the needs of a device
that's being developed. In order to define a pin as input or output pin, the right
combination of zeros and ones must be written in TRIS register. If the appropriate bit of
TRIS register contains logical "1", then that pin is an input pin, and if the opposite is true,
it's an output pin. Every port has its proper TRIS register. Thus, port A has TRISA, and
port B has TRISB. Pin direction can be changed during the course of work which is
particularly fitting for one-line communication where data flow constantly changes
direction. PORTA and PORTB state registers are located in bank 0, while TRISA and
TRISB pin direction registers are located in bank 1.

PORTB and TRISB


PORTB has adjoined 8 pins. The appropriate register for data direction is TRISB.
Setting a bit in TRISB register defines the corresponding port pin as input, and resetting a
bit in TRISB register defines the corresponding port pin as output.

17
Each PORTB pin has a weak internal pull-up resistor (resistor which defines a line to
logic one) which can be activated by resetting the seventh bit RBPU in OPTION register.
These 'pull-up' resistors are automatically being turned off when port pin is configured as
an output. When a microcontroller is started, pull-ups are disabled.
Four pins PORTB, RB7:RB4 can cause an interrupt which occurs when their
status changes from logical one into logical zero and opposite. Only pins configured as
input can cause this interrupt to occur (if any RB7:RB4 pin is configured as an output, an
interrupt won't be generated at the change of status.) This interrupt option along with
internal pull-up resistors makes it easier to solve common problems we find in practice
like for instance that of matrix keyboard. If rows on the keyboard are connected to these
pins, each push on a key will then cause an interrupt. A microcontroller will determine
which key is at hand while processing an interrupt It is not recommended to refer to port
B at the same time that interrupt is being processed

18
PORTA and TRISA

PORTA has 5 adjoining pins. The corresponding register for data direction is TRISA at
address 85h. Like with port B, setting a bit in TRISA register defines also the
corresponding port pin as input, and clearing a bit in TRISA register defines the
corresponding port pin as output.
It is important to note that PORTA pin RA4 can be input only. On that pin is also situated
an external input for timer TMR0. Whether RA4 will be a standard input or an input for a
counter depends on T0CS bit (TMR0 Clock Source Select bit). This pin enables the timer
TMR0 to increment either from internal oscillator or via external impulses on
RA4/T0CKI pin.

19
Memory organization
PIC16F73 has two separate memory blocks, one for data and the other for program.
EEPROM memory with GPR and SFR registers in RAM memory make up the data
block, while FLASH memory makes up the program block.

Program memory
Program memory has been carried out in FLASH technology which makes it possible to
program a microcontroller many times before it's installed into a device, and even after its
installment if eventual changes in program or process parameters should occur. The size
of program memory is 1024 locations with 14 bits width where locations zero and four
are reserved for reset and interrupt vector.

Data memory
Data memory consists of EEPROM and RAM memories. EEPROM memory consists of
256 eight bit locations whose contents are not lost during loosing of power supply.
EEPROM is not directly addressable, but is accessed indirectly through EEADR and
EEDATA registers. As EEPROM memory usually serves for storing important
parameters (for example, of a given temperature in temperature regulators) , there is a
strict procedure for writing in EEPROM which must be followed in order to avoid
accidental writing. RAM memory for data occupies space on a memory map from
location 0x0C to 0x4F which comes to 68 locations. Locations of RAM memory are also
called GPR registers which is an abbreviation for General Purpose Registers. GPR
registers can be accessed regardless of which bank is selected at the moment.

20
2.3. Touch screen sensor

Touch screen sensor

Definition:

A touch screen is any monitor, based either on LCD (Liquid Crystal Display) or
CRT (Cathode Ray Tube) technology, which accepts direct on screen input. The ability
for direct onscreen input is facilitated by an external (light pen) or an internal device
(touch overlay and controller) that relays the X, Y coordinates to the computer.

About Touch Screen Sensors:

Touch screen sensors are composed of a transparent touch screen surface


surrounded by a sensor array that provides positional information to a processor. A touch
screen sensor enables the display to be used as input device and replaces the keyboard or
mouse as the primary method of input for interacting with a display's content. Touch
screen sensors can be attached to computers and handheld devices.

There are several basic types of touch screen sensors. Examples include
capacitive glass touch screen sensors, resistive touch screens, and complete touch screen
systems. A capacitive glass touch screen sensor is placed on a touch screen panel that is
coated with indium tin oxide. The panel conducts a continuous electrical current across
the sensor in order to detect changes in capacitance. A resistive touch screen panel is also
coated with a thin-film, but in order to produce an electrically resistive layer. Each
change in electrical resistance is marked as a touch event and sent to a controller for
processing. A complete touch screen system allows a user to operate a computer or

21
terminal by touching the display screen. A touch screen system consists of a touch screen
sensor array, a controller card, and a software driver.

Selecting touch screen sensors requires an analysis of performance specifications


and application requirements. In general, resistive touch screens provide only 75%
clarity. They are available in 12.1 in., 15.0 in., 17.1 in., 18.1 in., 19.1 in., and 20.1 in.
models. Four-wire, 5-wire, and 8-wire resistive touch screens are commonly available.

We are mostly using the 4 wire resistive touch sensor.

Touch screen sensors are used in many applications. Some touch screen sensors
are used in pen digitizers for signature capture, smart phones, or personal digital
assistants (PDAs). Other touch screen sensors are used in ATMs or portable game
consoles. Specialized touch screen sensors can also be used in information appliances.

Fig: 4-wire resistive Touch screen

Resistive Touch screen Technology:

Resistive LCD touch screen monitors rely on a touch overlay, which is


composed of a flexible top layer and a rigid bottom layer separated by insulating dots,
attached to a touch screen controller. The inside surface of each of the two layers is

22
coated with a transparent metal oxide coating (ITO) that facilitates a gradient across each
layer when voltage is applied. Pressing the flexible top sheet creates electrical contact
between the resistive layers, producing a switch closing in the circuit. The control
electronics alternate voltage between the layers and pass the resulting X and Y touch
coordinates to the touch screen controller. The touch screen controller data is then passed
on to the computer operating system for processing.

Resistive touch screens are composed of two flexible sheets coated with a
resistive material and separated by an air gap or microdots. When contact is made to the
surface of the touch screen, the two sheets are pressed together, registering the precise
location of the touch. Because the touch screen senses input from contact with nearly any
object (finger, stylus/pen, palm) resistive touch screens are a type of "passive"
technology.

Working of Resistive Touch screens:

23
1. Polyester Film

2. Upper Resistive circuit Layer

3. Conductive ITO (Transparent Metal Coating).

4. Lower Resistive Circuit Layer

5. Insulating Dots

6. Glass/Acrylic Substrate

7. Touching the overlay surface causes the (2) Upper Resistive Circuit Layer to contact
the (4) Lower Resistive Circuit Layer, producing a circuit switch from the activated area.

8. The touch screen controller gets the alternating voltages between the (7) two circuit
layers and converts them into the digital X and Y coordinates of the activated area.

Because of its versatility and cost-effectiveness, resistive touch screen


technology is the touch technology of choice for many markets and applications.
Resistive touch screens are used in food service, retail point-of-sale (POS), medical
monitoring devices, industrial process control and instrumentation, portable and handheld
products.

Resistive touch screen technology possesses many advantages over other


alternative touch screen technologies (acoustic wave, capacitive, Near Field imaging, and
infrared). Highly durable, resistive touch screens are less susceptible to contaminants that
easily infect acoustic wave touch screens.

In addition, resistive touch screens are less sensitive to the effects of severe

24
scratches that would incapacitate capacitive touch screens. For industrial applications,
resistive touch screens are more cost-effective solutions than Near Field Imaging touch
screens.

A four-wire resistive touch screen panel consists of two flexible layers uniformly
coated with a transparent resistive material and separated by an air gap. Electrodes placed
along the edges of the layers provide a means for exciting and monitoring the touch
screen.

Block Diagram of Touch Screen Interface:

When a position is measured on a 4-wire touch screen, voltage is applied across


the screen in the Y direction; and a touch presses the layers together, where a voltage can

25
be read from one of the X electrodes. The contact made as a result of the touch creates a
voltage divider at that point, so the Y coordinate can be determined; the process then
repeats with the X direction being driven, and a reading is taken from one of the Y
electrodes. A touch-screen controller is simply an ADC that has built-in switches to
control which electrodes are driven and which electrodes are used as the input to the
ADC.

An Analog Devices AD7843 scans the X and Y axes and determines the
unique voltage drop for each axis. The four electrodes for scanning are labeled X+, X-,
Y+, and Y-. These electrodes are connected to the AD7843 touch screen controller and
the touch sensor is scanned and the analog voltages read.

The four touch electrodes are connected to the inputs X+, X-, Y+, and Y- of
the AD7843. A selected axis (X or Y) pair of electrodes is energized with a static voltage
and the voltage of the positive electrode of the other pair in the 4 wire touch panel is
measured. The sensed voltage is measured and converted to either an 8 bit or 12 bit
resolution. A digital word representing the voltage at the contacting point on the touch
panel is created and sent out via a high speed SPI serial interface.

Graphic LCD with Touch Screen:

These GLCD have common display drivers like KS0108 and T6963C and 4 wire
resistive touch screen.

There is no need for touch screen digitizer/controller for micro controllers


having on chip ADC with four analog channels. Just connect the four wire of touch
screen to analog inputs and read the respective digital data for X and Y direction of
touched point.

26
Fig: Graphic LCD with Touch Screen

Comparisons of all Resistive Touch Technologies: (4-, 5-, 6-, 7-, and 8-Wire)

Resistive touch screens are used in more applications than any other touch
technology–for example, PDAs, point-of-sale, industrial, medical, and office automation,
as well as consumer electronics. All variations of resistive touch screens have some
things in common:

27
• They are all constructed similarly in layers-a back layer such as glass with a
uniform resistive coating plus a polyester coversheet, with the layers separated by
tiny insulating dots. When the screen is touched, it pushes the conductive coating
on the coversheet against the coating on the glass, making electrical contact. The
voltages produced are the analog representation of the position touched. An
electronic controller converts these voltages into digital X and Y coordinates
which are then transmitted to the host computer.
• Because resistive touch screens are force activated, all kinds of touch input
devices can activate the screen, including fingers, fingernails, styluses, gloved
hands, and credit cards.
• All have similar optical properties, resistance to chemicals and abuse.
• Both the touch screen and its electronics are simple to integrate into imbedded
systems, thereby providing one of the most practical and cost-effective touch
screen solutions.

Four-Wire Resistive:

Four-wire resistive technology is the simplest to understand and manufacture. It


uses both the upper and lower layers in the touchscreen "sandwich" to determine the X
and Y coordinates. Typically constructed with uniform resistive coatings of indium tin

28
oxide (ITO on the inner sides of the layers and silver buss bars along the edges, the
combination sets up lines of equal potential in both X and Y.

In the illustration below, the controller first applies 5V to the back layer. Upon
touch, it probes the analog voltage with the coversheet, reading 2.5V, which represents a
left-right position or X axis.

It then flips the process, applying 5V to the coversheet, and probes from the
back layer to calculate an up-down position or Y axis. At any time, only three of the four
wires are in use (5V, ground, and probe).

The primary drawback of four-wire technology is that one coordinate axis


(usually the Y axis), uses the outer layer, the flexible coversheet, as a uniform voltage
gradient. The constant flexing that occurs on the outer coversheet with use will eventually
cause microscopic cracks in the ITO coating, changing its electrical characteristics
(resistance), degrading the linearity and accuracy of this axis.

Unsurprisingly, four-wire touch screens are not known for their durability.
Typically, they test only to about 1 million touches with a finger-far less when activated
by a pointed stylus which speeds the degradation process. Some four-wire products even

29
specify 100,000 activations within a rather large, 20 mm x 20 mm area. In the real world
of point-of-sale applications, a level of 100,000 activations with hard, pointed styluses
(including fingernails, credit cards, ballpoint pens, etc.) is considered normal usage in just
a few months' time.

Also, accuracy can drift with environmental changes. The polyester


coversheet expands and contracts with temperature and humidity changes, thereby
causing long-term degradation to the coatings as well as drift in the touch location.

While all of these drawbacks can be insignificant in smaller sizes, they become
increasingly apparent the larger the touch screen. Therefore, Elo normally recommends
four-wire touch screens in applications with a display size of 6.4" or smaller.

However, the relative low cost, inherent low power consumption, and common
availability of chipset controllers with support from imbedded operating systems, makes
Elo AT4 four-wire touch screens ideal for hand-held devices such as PDAs, wearable
computers, and many consumer devices.

4-Wire Resistive Add-on/Internal Touch Screen for less demanding touch

30
applications. Great for general use, demos, trade shows, proto-typing, proof of concepts,
low cost touch requirement.

4-wire analog resistive touch technology is suitable for applications that


require ease of integration, low power consumption, lightweight, portability, cost
effectiveness and compact mechanism. Affordable, durable and versatile, the 4-wire
resistive touch screens are primarily used in mobile applications, such as smart phones,
PDAs, e-books, web pads, digital cameras, GPS, and other consumer or office
electronics.

Features:

• Input Method: Stylus, Finger, Gloved Hand


• Widest Range in Sizes: 1.4" ~ 21"
• High Transmission Rate
• Low Power Consumption
• Narrow Boarder Design
• Writing and Signature Capture Capability

Various Constructions Available:

• Film/Glass
• Film/Strengthened Glass
• Film/Film/PC
• Sunlight Readability Available
• Palm Rejection Model Available

31
Technologies:

There are a number of types of touch screen technology.

Resistive:

A resistive touch screen panel is composed of several layers, the most


important of which are two thin, metallic, electrically conductive layers separated by a
narrow gap. When an object, such as a finger, presses down on a point on the panel's
outer surface the two metallic layers become connected at that point: the panel then
behaves as a pair of voltage dividers with connected outputs. This causes a change in the
electrical current which is registered as a touch event and sent to the controller for
processing. Resistive touch screens can also support Multi touch.

Surface acoustic wave:

Surface acoustic wave (SAW) technology uses ultrasonic waves that pass
over the touch screen panel. When the panel is touched, a portion of the wave is
absorbed. This change in the ultrasonic waves registers the position of the touch event
and sends this information to the controller for processing. Surface wave touch screen
panels can be damaged by outside elements. Contaminants on the surface can also
interfere with the functionality of the touch screen.

Capacitive:

A capacitive touch screen panel consists of an insulator such as glass, coated


with a transparent conductor such as indium tin oxide (ITO). As the human body is also a
conductor, touching the surface of the screen results in a distortion of the local
electrostatic field, measurable as a change in capacitance. Different technologies may be
used to determine the location of the touch. The location can be passed to a computer
running a software application which will calculate how the user's touch relates to the
computer software.

32
Surface capacitance:

In this basic technology, only one side of the insulator is coated with a
conductive layer. A small voltage is applied to the layer, resulting in a uniform
electrostatic field. When a conductor, such as a human finger, touches the uncoated
surface, a capacitor is dynamically formed. The sensor's controller can determine the
location of the touch indirectly from the change in the capacitance as measured from the
four corners of the panel. As it has no moving parts, it is moderately durable but has
limited resolution, is prone to false signals from parasitic capacitive coupling, and needs
calibration during manufacture. It is therefore most often used in simple applications such
as industrial controls.

Projected capacitance:

Projected Capacitive Touch (PCT) technology is a capacitive technology which


permits more accurate and flexible operation, by etching the conductive layer. An XY
array is formed either by etching a single layer to form a grid pattern of electrodes, or by
etching two separate, perpendicular layers of conductive material with parallel lines or
tracks to form the grid (comparable to the pixel grid found in many LCD displays).

Applying voltage to the array creates a grid of capacitors. Bringing a finger or conductive
stylus close to the surface of the sensor changes the local electrostatic field. The
capacitance change at every individual point on the grid can be measured to accurately
determine the touch location. The use of a grid permits a higher resolution than resistive
technology and also allows multi-touch operation. The greater resolution of PCT allows
operation without direct contact, such that the conducting layers can be coated with
further protective insulating layers, and operates even under screen protectors, or behind
weather and vandal-proof glass.

PCT is used in a wide range of applications including point of sale systems, smart
phones, and public information kiosks. Visual Planet's VIPs Interactive Foil is an
example of a kiosk PCT product, where a gloved hand can register a touch on a sensor
surface through a glass window.

33
Examples of consumer devices using projected capacitive touch screens
include Apple Inc.'s iPhone and IPOD Touch, HTC's G1, and HTC Hero, Palm Inc.'s
Palm Pre and Palm Pixi and more recently the LG KM900 Arena, Microsoft's Zune HD
and Sony Walkman X series.

Infrared:

Conventional optical-touch systems use an array of infrared (IR) light-emitting


diodes (LEDs) on two adjacent bezel edges of a display, with photo sensors placed on the
two opposite bezel edges to analyze the system and determine a touch event. The LED
and photo sensor pairs create a grid of light beams across the display. An object (such as
a finger or pen) that touches the screen interrupts the light beams, causing a measured
decrease in light at the corresponding photo sensors. The measured photo sensor outputs
can be used to locate a touch-point coordinate.

Widespread adoption of infrared touch screens has been hampered by


two factors: the relatively high cost of the technology compared to competing touch
technologies and the issue of performance in bright ambient light. This latter problem is a
result of background light increasing the noise floor at the optical sensor, sometimes to
such a degree that the touch screen’s LED light cannot be detected at all, causing a
temporary failure of the touch screen. This is most pronounced in direct sunlight
conditions where the sun has a very high energy distribution in the infrared region.

However, certain features of infrared touch remain desirable and represent


attributes of the ideal touch screen, including the option to eliminate the glass or plastic
overlay that most other touch technologies require in front of the display. In many cases,
this overlay is coated with an electrically conducting transparent material such as ITO,
which reduces the optical quality of the display. This advantage of optical touch screens
is extremely important for many device and display vendors since devices are often sold
on the perceived quality of the user display experience.

34
Another feature of infrared touch which has been long desired is the digital
nature of the sensor output when compared to many other touch systems that rely on
analog-signal processing to determine a touch position. These competing analog systems
normally require continual re-calibration, have a complex signal-processing demand
(which adds cost and power consumption), demonstrate reduced accuracy and precision
compared to a digital system, and have longer-term system-failure modes due to the
operating environment.

Strain gauge:

In a strain gauge configuration, also called force panel technology, the screen is
spring-mounted on the four corners and strain gauges are used to determine deflection
when the screen is touched. This technology has been around since the 1960s but new
advances by Vissumo and F-Origin have made the solution commercially viable. It can
also measure the Z-axis and the force of a person's touch. Such screens are typically used
in exposed public systems such as ticket machines due to their resistance to vandalism.

Optical imaging:

A relatively-modern development in touch screen technology, two or more


image sensors are placed around the edges (mostly the corners) of the screen. Infrared
backlights are placed in the camera's field of view on the other sides of the screen. A
touch shows up as a shadow and each pair of cameras can then be triangulated to locate
the touch or even measure the size of the touching object (see visual hull). This
technology is growing in popularity, due to its scalability, versatility, and affordability,
especially for larger units.

35
Comparison of touch screen technologies:

Technology 4-Wire SAW 5-Wire Infrared Capacitive


Durability: 5 year 5 Year 3 Year 3 Year 2 Year
Stability: High Higher High High Ok
Transparency: Ok Good Good Good Ok
Built-in/On Built-in/On Built-in/On
Installation: On wall Built-in
wall wall wall
Touch: Anything Finger/Pen Anything Sharp Conductive
Intense light-
Good Good Good Bad Bad
resistant:
Response time: <10ms 10ms <15ms <20ms <15ms
Following Speed: Good low Good Good Good
Excursion: No Small Big Big Big
CRT or
Monitor option: CRT CRT CRT or LCD CRT or LCD
LCD
Waterproof: Good Ok Good Ok Good

Specifications – Advanced

36
Electrical
Operation Voltage DC5V
Linearity 1.5% or less
Insulation ≥20MΩ/25V (DC)

Optical
Transmittance 81% ± 5%

Environmental
Operating Temperature -10°C to +60°C
Storage Temperature -30°C to +75°C

Mechanical
Activation Force ≤50g
(Custom activation force and palm rejection available)

Durability
Finger Touch 5M touches
Pen Hitting 1M touches
Surface Hardness ≥3H (JIS K5400)

Operating System
Windows 98/2000/ME/XP/NT/CE, DOS, Linux

Advantages:

1. Plug and play compatible.


2. Support complete line of windows and Linux os.
3. Support panels of curve type for CRT and flat type for LCD.
4. Character recognition for English, Chinese and Japanese languages.
5. Can support any special request for panel, controller or driver.

4 -wire resistive touch screen sensors have a lot of advantages:

1. It is working well even the surface suffered scraped damage if its glass won't been
hurt.

37
2. Our touch panel could be operated in the environment with -10 to 70 degree for
automobile.

3. Warranty is as longer as 1 year for normal operating with 5,000,000 touching times.

4. We provide touch panel with high transparency (more than 78%). It is quite clear even
our monitor with low transparency.

5. We could customize various sizes for customers' request between 1.8 and 19 inch.

6. It is easy to install into varied brands of monitor.

Specification:
- input mode: Stylus pen or finger

- Operation temperature: -10 degree to 60 degree 20%rh ~ 85%rh

- Storage temperature: -20 degree to 80 degree 10%rh ~ 90%rh

- Transparency: More than 78%

- Linearity: X less than 1.5%, y less than 1.5%

- chattering: Less than 15ms

- Hardness: 3h

- Knock test: 5,000,000 times

Applications of Four-Wire Resistive Touch screen:

1. Light industrial.

2. Home appliances.

3. Portable sport devices.

38
4. Access control terminals.

5. Portable medical devices.

2.4. Zigbee technology

Introduction:

When we hold the TV remote and wish to use it we have to necessarily point
our control at the device. This one-way, line-of-sight, short-range communication uses
infrared (IR) sensors to enable communication and control and it is possible to operate
the TV remotely only with its control unit.

Add other home theatre modules, an air- conditioner and remotely enabled fans
and lights to our room, and we become a juggler who has to handle not only these
remotes, but also more numbers that will accompany other home appliances we are likely
to use.

39
Some remotes do serve to control more than one device after ‘memorizing'
access codes, but this interoperability is restricted to LOS, that too only for a set of
related equipment, like the different units of a home entertainment system

Now picture a home with entertainment units, security systems including fire
alarm, smoke detector and burglar alarm, air-conditioners and kitchen appliances all
within whispering distance from each other and imagine a single unit that talks with all
the devices, no longer depending on line-of-sight, and traffic no longer being one-way.

This means that the devices and the control unit would all need a common
standard to enable intelligible communication. ZigBee is such a standard for embedded
application software and has been ratified in late 2004 under IEEE 802.15.4 Wireless
Networking Standards.

ZigBee is an established set of specifications for wireless personal area


networking (WPAN), i.e., digital radio connections between computers and related
devices. This kind of network eliminates use of physical data buses like USB and
Ethernet cables. The devices could include telephones, hand-held digital assistants,
sensors and controls located within a few meters of each other.

ZigBee is one of the global standards of communication protocol formulated by


the relevant task force under the IEEE 802.15 working group. The fourth in the series,
WPAN Low Rate/ZigBee is the newest and provides specifications for devices that have
low data rates, consume very low power and are thus characterized by long battery life.
Other standards like Blue tooth and IrDA address high data rate applications such as
voice, video and LAN communications.

The ZigBee Alliance has been set up as “an association of companies working
together to enable reliable, cost-effective, low-power, wirelessly networked, monitoring
and control products based on an open global standard”.

Once a manufacturer enrolls in this Alliance for a fee, he can have access to
the standard and implement it in his products in the form of ZigBee chipsets that would

40
be built into the end devices. Philips, Motorola, Intel, HP are all members of the Alliance.
The goal is “to provide the consumer with ultimate flexibility, mobility, and ease of use
by building wireless intelligence and capabilities into every day devices.

ZigBee technology will be embedded in a wide range of products and


applications across consumer, commercial, industrial and government markets
worldwide. For the first time, companies will have a standards-based wireless platform
optimized for the unique needs of remote monitoring and control applications, including
simplicity, reliability, low-cost and low-power”.

The target networks encompass a wide range of devices with low data rates in
the Industrial, Scientific and Medical (ISM) radio bands, with building-automation
controls like intruder/fire alarms, thermostats and remote (wireless) switches, video/audio
remote controls likely to be the most popular applications. So far sensor and control
devices have been marketed as proprietary items for want of a standard. With acceptance
and implementation of ZigBee, interoperability will be enabled in multi-purpose, self-
organizing mesh networks

Architecture:

Though WPAN implies a reach of only a few meters, 30 feet in the case of
ZigBee, the network will have several layers, so designed as to enable interpersonal
communication within the network, connection to a network of higher level and
ultimately an uplink to the Web.

The ZigBee Standard has evolved standardized sets of solutions, called ‘layers'. These
layers facilitate the features that make ZigBee very attractive: low cost, easy
implementation, reliable data transfer, short-range operations,

Very low power consumption and adequate security features.

41
1. Network and Application Support layer:

The network layer permits growth of network sans high power transmitters.
This layer can handle huge numbers of nodes. This level in the ZigBee architecture
includes the ZigBee Device Object (ZDO), user-defined application profile(s) and the
Application Support (APS) sub-layer.

The APS sub-layer's responsibilities include maintenance of tables that


enable matching between two devices and communication among them, and also
discovery, the aspect that identifies other devices that operate in the operating space of
any device.

The responsibility of determining the nature of the device (Coordinator /


FFD or RFD) in the network, commencing and replying to binding requests and ensuring
a secure relationship between devices rests with the ZDO (Zigbee Define Object). The
user-defined application refers to the end device that conforms to the ZigBee Standard.

2. Physical (PHY) layer:

The IEEE802.15.4 PHY physical layer accommodates high levels of integration


by using direct sequence to permit simplicity in the analog circuitry and enable cheaper
implementations.

3. Media access control (MAC) layer:

The IEEE802.15.4 MAC media access control layer permits use of several
topologies without introducing complexity and is meant to work with large numbers of
devices.

42
Figure 1: IEEE 802.15.4 / ZigBee Stack Architecture

Device types:

There are three different ZigBee device types that operate on these layers in any
self-organizing application network.

These devices have 64-bit IEEE addresses, with option to enable shorter
addresses to reduce packet size, and work in either of two addressing modes – star and
peer-to-peer.

1. The ZigBee coordinator node:

There is one, and only one, ZigBee coordinator in each network to act as the
router to other networks, and can be likened to the root of a (network) tree. It is designed
to store information about the network.

2. The full function device FFD:

The FFD is an intermediary router transmitting data from other devices. It needs

43
lesser memory than the ZigBee coordinator node, and entails lesser manufacturing costs.
It can operate in all topologies and can act as a coordinator.

3. The reduced function device RFD:

This device is just capable of talking in the network; it cannot relay data from
other devices. Requiring even less memory, (no flash, very little ROM and RAM), an
RFD will thus be cheaper than an FFD. This device talks only to a network coordinator
and can be implemented very simply in star topology.

ZigBee Characteristics:

The focus of network applications under the IEEE 802.15.4 / ZigBee standard
include the features of low power consumption, needed for only two major modes (Tx/Rx
or Sleep), high density of nodes per network, low costs and simple implementation.

These features are enabled by the following characteristics:

• 2.4GHz and 868/915 MHz dual PHY modes. This represents three license-free bands:
2.4-2.4835 GHz, 868-870 MHz and 902-928 MHz. The number of channels allotted to
each frequency band is fixed at sixteen (numbered 11-26), one (numbered 0) and ten
(numbered 1-10) respectively. The higher frequency band is applicable worldwide, and
the lower band in the areas of North America, Europe, Australia and New Zealand.

• Low power consumption, with battery life ranging from months to years. Considering
the number of devices with remotes in use at present, it is easy to see that more numbers
of batteries need to be provisioned every so often, entailing regular (as well as timely),
recurring expenditure. In the ZigBee standard, longer battery life is achievable by either
of two means: continuous network connection and slow but sure battery drain, or
intermittent connection and even slower battery drain.

44
• Maximum data rates allowed for each of these frequency bands are fixed as 250 kbps
@2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz.

• High throughput and low latency for low duty-cycle applications (<0.1%)

• Channel access using Carrier Sense Multiple Access with Collision Avoidance (CSMA
- CA)

• Addressing space of up to 64 bit IEEE address devices, 65,535 networks

• 50m typical range

• Fully reliable “hand-shacked” data transfer protocol.

• Different topologies as illustrated below: star, peer-to-peer, mesh

Figure 2: ZigBee Topologies

45
Traffic Types:

ZigBee/IEEE 802.15.4 addresses three typical traffic types. IEEE 802.15.4 MAC
can accommodate all the types.

1. Data is periodic: The application dictates the rate, and the sensor activates, checks for
data and deactivates.

2. Data is intermittent: The application, or other stimulus, determines the rate, as in the
case of say smoke detectors. The device needs to connect to the network only when
communication is necessitated. This type enables optimum saving on energy.

3. Data is repetitive, and the rate is fixed a priori. Depending on allotted time slots,
called GTS (guaranteed time slot), devices operate for fixed durations.

ZigBee employs either of two modes, beacon or non-beacon to enable the to-and-
fro data traffic. Beacon mode is used when the coordinator runs on batteries and thus
offers maximum power savings, whereas the non-beacon mode finds favor when the
coordinator is mains-powered.

In the beacon mode, a device watches out for the coordinator's beacon that
gets transmitted at periodically, locks on and looks for messages addressed to it. If
message transmission is complete, the coordinator dictates a schedule for the next beacon
so that the device ‘goes to sleep'; in fact, the coordinator itself switches to sleep mode.

While using the beacon mode, all the devices in a mesh network know when to
communicate with each other. In this mode, necessarily, the timing circuits have to be
quite accurate, or wake up sooner to be sure not to miss the beacon. This in turn means an
increase in power consumption by the coordinator's receiver, entailing an optimal
increase in costs.

46
Figure 1: Beacon Network Communication

The non-beacon mode will be included in a system where devices are ‘asleep'
nearly always, as in smoke detectors and burglar alarms. The devices wake up and
confirm their continued presence in the network at random intervals.

On detection of activity, the sensors ‘spring to attention', as it were, and transmit


to the ever-waiting coordinator's receiver (since it is mains-powered). However, there is
the remotest of chances that a sensor finds the channel busy, in which case the receiver
unfortunately would ‘miss a call'.

Figure 2: Non-Beacon Network Communication

47
Network Model:

The functions of the Coordinator, which usually remains in the receptive mode,
encompass network set-up, beacon transmission, node management, storage of node
information and message routing between nodes.

The network node, however, is meant to save energy (and so ‘sleeps' for long
periods) and its functions include searching for network availability, data transfer, checks
for pending data and queries for data from the coordinator.

48
Figure 1: ZigBee Network Model

For the sake of simplicity without jeopardizing robustness, this particular


IEEE standard defines a quartet frame structure and a super-frame structure used
optionally only by the coordinator.

The four frame structures are

• Beacon frame for transmission of beacons


• Data frame for all data transfers
• Acknowledgement frame for successful frame receipt confirmations
• MAC command frame

These frame structures and the coordinator's super-frame structure play critical
roles in security of data and integrity in transmission.

All protocol layers contribute headers and footers to the frame structure, such
that the total overheads for each data packet range are from 15 octets (for short addresses)
to 31 octets (for 64-bit addresses).

The coordinator lays down the format for the super-frame for sending beacons after every
15.38 ms or/and multiples thereof, up to 252s.

This interval is determined a priori and the coordinator thus enables


sixteen time slots of identical width between beacons so that channel access is
contention-less. Within each time slot, access is contention-based. Nonetheless, the
coordinator provides as many as seven GTS (guaranteed time slots) for every beacon
interval to ensure better quality.

Technology Comparisons:

The “Why ZigBee” question has always had an implied, but never quite

49
worded follower phrase “…when there is Blue tooth”. A comparative study of the two
can be found in ZigBee: 'Wireless Control That Simply Works’.

The bandwidth of Blue tooth is 1 Mbps; ZigBee's is one-fourth of this value.


The strength of Blue tooth lies in its ability to allow interoperability and replacement of
cables, ZigBee's, of course, is low costs and long battery life.

In terms of protocol stack size, ZigBee's 32 KB is about one-third of the stack


size necessary in other wireless technologies (for limited capability end devices, the stack
size is as low as 4 KB).

Most important in any meaningful comparison are the diverse application areas
of all the different wireless technologies. Blue tooth is meant for such target areas as
wireless USB's, handsets and headsets, whereas ZigBee is meant to cater to the sensors
and remote controls market and other battery operated products.

In a gist, it may be said that they are neither complementary standards nor
competitors, but just essential standards for different targeted applications. The earlier
Blue tooth targets interfaces between PDA and other device (mobile phone / printer etc)
and cordless audio applications.

The IEEE 802.15.4–based ZigBee is designed for remote controls and sensors, which are
very many in number, but need only small data packets and, mainly, extremely low
power consumption for (long) life. Therefore they are naturally different in their
approach to their respective application arenas.

ZigBee Applications:

The ZigBee Alliance targets applications "across consumer, commercial,


industrial and government markets worldwide".

Unwired applications are highly sought after in many networks that are characterized by
numerous nodes consuming minimum power and enjoying long battery lives.

50
ZigBee technology is designed to best suit these applications, for the reason that
it enables reduced costs of development, very fast market adoption, and rapid ROI.

Airbee Wireless Inc has tied up with Radio crafts AS to deliver "out-of-the-box"
ZigBee-ready solutions, the former supplying the software and the latter making the
module platforms. With even light controls and thermostat producers joining the ZigBee
Alliance, the list is growing healthily and includes big OEM names like HP, Philips,
Motorola and Intel.

With ZigBee designed to enable two-way communications, not only will the consumer be
able to monitor and keep track of domestic utilities usage, but also feed it to a computer
system for data analysis.

A recent analyst report issued by West Technology Research Solutions


estimates that by the year 2008, "annual shipments for ZigBee chipsets into the home
automation segment alone will exceed 339 million units," and will show up in "light
switches, fire and smoke detectors, thermostats, appliances in the kitchen, video and
audio remote controls, landscaping, and security systems."

2.5 GLCD

Graphic LCD 128x64

This 128x64 graphic LCD is the latest high quality offering from Crystal Fonts.
This production unit is much more than just a surplus LCD found on many electronics
sites! This CFAX model comes with an EL backlight and a 4-wire analog touch screen!
You can use it for anything! Checkout the example screen shots from Crystal Fonts.

Features:

• Ultra thin and light TAB construction


• Wide viewing angles
• Built-in controller: Samsung KS0713 (data sheet 850K).

51
• Great for hand held instruments, cell phones, PDAs, etc.
• Ultra low power consumption

Dimensions:

• 56.0mm x 42.5mm Module Outline (less tab)


• 52.0mm x 33.5mm Viewing Area
• 47.76mm x 30.29mm Active Area
• 0.35mm x 0.40mm Dot Pitch

Salient features of the Interface with Graphical LCD Display are as follows:
 Programming of additional vacuum signals and other peripheric equipment signals
possible.
 Up to Different languages are included and can be selected:
 English, German, French, Spanish, Chinese, etc.
 Standard molding machine interface [SPI & E12]
 Full diagnosis with text error messages

52
LCD Port
The LCD port provides the 14 standard signals required to interface to nearly all standard
alphanumeric character mode displays from 8 to 80 characters. VDD provides +5 volt
regulated power to the display (VSS is Ground). VEE ranges from 0 (maximum
intensity) to 2 volts (minimum intensity) with the adjustment of the variable resistor
located just above next to the power input.

The E signal is an active high enable, which is asserted when the processor makes a
memory access within the address range of 0xFE00 to 0xFEFF. RS and R/W are control
lines for the display. In order to meet the timing requirements for all standard LCD
displays, these are connected to the processor's address lines so they are asserted and
remain stable while E is asserted. Because of this, separate locations are used to read and
write to the LCD.

Description

Graphical LCD 128x64 controlled with the ATMega16, the graphic LCD GLCD
HG1286418C-VA with a S6B0107/S6B0108 controller is used. See below for the pin out
of the display. The display has 8 data bits and 5 control bits. The data bits are hooked to
PORTB and the control bits are hooked to PORTD of the Mega16. A small PCB board is
made for easy connection to the microcontroller. The program is made with the
BASCOM-AVR compiler. The program shows text and a picture on the display. A
library file needs to be included in the program, the library contains commands to control
the display like:

• Set font - Sets the current font which can be used on the graphical displays.
• Lcdat - shows text on the display
• $BGF - Includes a BASCOM Graphic File in the program.
• Showpic - shows a graphic file on the display
• Line - draws a line on the display
• Circle - draws a circle on the display

53
• Pset - Sets a single pixel on the display

There are several fonts available like a 8x8 font and a 16x16 font, but the font file
consume memory, the large the font file the larger the program becomes.
The core is used to provide a wishbone compliant interface to a graphical LCD. Currently
it supports the Crystalfontz CFAG12864 family, which is based on the KS0108B
controller.

Other graphical LCDs may be supported at a later date.

Advantages:

• No time consuming graphic programming


• Free Windows™ LCD simulator and development software
• No expensive software licenses required.
• Easy to learn powerful commands
• Fast development, drastically reduced time-to-market
• Touch-screen driver and analogue touch-screen included ( option -TP)
• Minimal electronics required to drive the display i.e memory, I/O, low cost CPU
• Hardware cost savings due to the onboard memory and low pin count interface.
• Variety of serial interfaces ( 5V RS-232, I²C, SPI )
• Breakout boards with USB, RS232 and RS485 interface
• Display requires only a single +5V supply
• Extremely compact construction with DIP connectors at the back of LCD
• Stylish black alum. bezel and mounting system available
• LCD is available with analogue touch screen (order option -TP)
• Monochrome LCD's are available in blue/white, white/black positive FSTN and
Amber
• Only best quality materials used
• Long products availability, recommended for industrial products

Applications:

54
• Medical equipment
• Electronic test equipment
• Industrial machinery Interface
• Serial terminal
• Advertising system
• EPOS
• Restaurant ordering systems
• Gaming box
• Security systems
• R&D Test units
• Climatizing units
• PLC Interface
• Simulators
• Environmental monitoring
• Lab development
• Student projects
• Home automation
• PC external display
• HMI operator interface.

Advantages of Graphic LCDs

• Download high quality fonts of any size, style or language easily and quickly
• Create graphics using primitives such as bitmaps, pixels, lines, rectangles and bar
graphs.
Software Control

• Backlight & Contrast is adjustable in most models

• 4 different brightness settings

• General Purpose Output (20mA drive)

55
• Line wrap and Auto screen scroll

• Bar Graphs and Large Digits

• Speed settings

• Splash/Start-up Screen

Features
• Speeds from 19.2Kbps to a lighting fast 115Kbps

• 96 bit buffer

• 15872 bytes of memory! Store up to 30 full image screens

• Upload your own fonts for a customized look

• Communicate over RS232 or I2C

• Optional wide voltage efficient power regulator from +7 to +30Vdc (on GLC24064 &
GLK24064-25)
• Extended• Black and white ST (MST) Tran missive mode

• Built-in CCFL backlight

• 40 characters x 18 line capability

• 240 x 128 dot graphic display

• Excellent readability and high-contrast ratio

• Built-in LCD controller (T6963C)

• Wide operating temperature range (0° to 50°C)

56
Some examples of graphic LCD controller chips are the Toshiba T6963, Seiko-Epson
SED1330, and Hitachi HD61202. Here, we will be primarily concerned with character
LCD modules that have the Hitachi HD44780 controller built-in.

3. Communication Interface

57
3. RS-232

In telecommunications, RS-232 (sometimes also referred to as EIA RS-232C


(EIA :Electronic Industries Association) is a standard for serial binary data
interconnection between a DTE (Data terminal equipment) and a DCE (Data
communication equipment). It is commonly used in computer serial ports.

RS-232-C defines:

• Electrical signal characteristics such as voltage levels, signaling rate, timing and
slew-rate of signals, voltage withstand level, short-circuit behavior, maximum
stray capacitance and cable length.
• Interface mechanical characteristics, pluggable connectors and pin identification.
• Functions of each circuit in the interface connector.
• Standard subsets of interface circuits for selected telecomm applications.

The standard does not define elements such as character encoding (for example, ASCII,
Baudot or EBCDIC), the framing of characters in the data stream (bits per character,
start/stop bits, parity), bit rates for transmission, although the standard says it is intended

58
for bit rates less than 20,000 bits per second. Some types of equipment exceed this speed
while still using RS-232 compatible signal levels.

3.1 History

This standard was originally used for specifying the connection between a teletypewriter,
which used asynchronous communication and electromechanical components, with a
modem. When electronic terminals (smart and dumb) began to be used, they were often
designed to be interchangeable with teletypes, and so supported RS-232. The C revision
of the standard was issued in 1969 in part to accommodate the electrical characteristics of
these devices. Then, because it was there, it was used for all sorts of remote
communications, especially through modems, including computer to computer.

Since application to such devices as computers, printers, digitizer tables, test instruments,
and so on were not envisioned, designers implementing an RS-232 compatible interface
on their equipment often interpreted the requirements idiosyncratically. Common
problems were non-standard pin assignment of circuits on connectors, and incorrect or
missing control signals. The lack of adherence to the standards produced a thriving
industry of breakout boxes, patch boxes, test equipment, books, and other aids for the
connection of disparate equipment.

Later personal computers (and other devices) started to make use of the standard so that
they could connect to existing equipment. The IBM Selectric typewriter with RS-232
supplanted teletypes in some applications. For many years some form of RS-232-
compatible port was a standard feature for serial communications on almost all
computers. It remained in widespread use into the late 1990s. For much of this time it
was the standard way to connect modems. The original letters "RS" stood for
"Recommended Standard".
3.2 Standard details
3.2.1 Volage levels

The RS-232 standard defines the voltage levels that correspond to logical one and logical
zero levels.

59
Signals are plus or minus 3 to 15 volts. The range near zero volts is not a valid RS-232
level; logic one is defined as a negative voltage, the signal condition is called marking,
and has the functional significance of OFF. Logic zero is positive, the signal condition is
spacing, and has the function ON.

The standard specifies a maximum open-circuit voltage of 25 volts. Circuits driving an


RS-232-compatible interface must be able to withstand indefinite short circuit to ground
or to any voltage level up to 25 volts. The slew rate, or how fast the signal changes
between levels, is also controlled.

3.2.2 Pin Assignments

60
(a) (b)
(a) Here is the full EIA232 signal definition for the DTE device
(usually the PC). The most commonly used signals are shown in bold
(b) This shows the full EIA232 signal definition for the DCE device
(usually the modem). The most commonly used signals are shown in
bold.
Many of the 22 signal lines in the EIA232 standard pertain to connections where the DCE
device is a modem, and then are used only when the software protocol employs
them. For any DCE device that is not a modem, or when two DTE devices are
directly linked, far fewer signal lines are necessary.
It is noticed in the pinout drawings that there is a secondary channel, which includes a
duplicate set of flow-control signals. This secondary channel provides for
management of the remote modem, enabling baud rates to be changed on the fly,
retransmission to be requested if a parity error is detected, and other control
functions. This secondary channel, when used, is typically set to operate at a very
low baud rate in comparison with the primary channel to ensure reliability in the
control path. In addition, it may operate as either a simplex, half-duplex, or full-
duplex channel, depending on the capabilities of the modem.
3.2.3 Signal Definitions
Signal functions in the EIA232 standard can be subdivided into six categories. These
categories are summarized below, after which each signal described.

1. Signal ground and shield.


2. Primary communications channel. This is used for data interchange, and
includes flow control signals.
3. Secondary communications channel. When implemented, this is used for
control of the remote modem, requests for retransmission when errors occur, and
governance over the setup of the primary channel.
4. Modem status and control signals. These signals indicate modem status
and provide intermediate checkpoints as the telephone voice channel is
established.

62
5. Transmitter and receiver timing signals. If a synchronous protocol is used,
these signals provide timing information for the transmitter and receiver, which
may operate at different baud rates.
6. Channel test signals. Before data is exchanged, the channel may be tested
for its integrity, and the baud rate automatically adjusted to the maximum rate that
the channel can support.

Signal Ground and Shield

Pin 7, Pin 1, and the shell are included in this category. Cables provide separate paths for
each, but internal wiring often connects pin 1 and the cable shell/shield to signal ground
on pin 7.

Pin 7 - Ground All signals are referenced to a common ground, as defined by the voltage
on pin 7. This conductor may or may not be connected to protective ground inside the
DCE device. The existence of a defined ground potential within the cable makes the
EIA232 standard different from a balanced differential voltage standard, such as EIA530,
which provides far greater noise immunity.

Primary Communications Channel


Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the
DTE device to the DCE device. When no data is transmitted, the signal is held in the
mark condition (logic '1', negative voltage).

NOTE: Pin 2 on the DCE device is commonly labeled "Received Data", although
by the EIA232 standard it should still be called Transmitted Data because the data
is thought to be destined for a remote DTE device.

Pin 3 - Received Data (RxD): This signal is active when the DTE device receives data
from the DCE device. When no data is transmitted, the signal is held in the mark
condition (logic '1', negative voltage).

NOTE: Pin 3 on the DCE device is commonly labeled "Transmitted Data",


although by the EIA232 standard it should still be called Received Data because

63
the data is thought to arrive from a remote DTE device.

Pin 4 - Request to Send (RTS) This signal is asserted (logic '0', positive voltage) to
prepare the DCE device for accepting transmitted data from the DTE device. Such
preparation might include enabling the receive circuits, or setting up the channel direction
in half-duplex applications. When the DCE is ready, it acknowledges by asserting Clear
to Send.

NOTE: Pin 4 on the DCE device is commonly labeled "Clear to Send", although
by the EIA232 standard it should still be called Request to Send because the
request is thought to be destined for a remote DTE device.

Pin 5 - Clear to Send (CTS) This signal is asserted (logic '0', positive voltage) by the
DCE device to inform the DTE device that transmission may begin. RTS and CTS are
commonly used as handshaking signals to moderate the flow of data into the DCE device.

NOTE: Pin 5 on the DCE device is commonly labeled "Request to Send",


although by the EIA232 standard it should still be called Clear to Send because
the signal is thought to originate from a remote DTE device.

Secondary Communications Channel

Pin 14 - Secondary Transmitted Data (STxD)


Pin 16 - Secondary Received Data (SRxD)
Pin 19 - Secondary Request to Send (SRTS)
Pin 13 - Secondary Clear to Send (SCTS)

These signals are equivalent to the corresponding signals in the primary communications
channel. The baud rate, however, is typically much slower in the secondary channel for
increased reliability.

Modem Status and Control Signals

64
pin 6 - DCE Ready (DSR) When originating from a modem, this signal is asserted
(logic '0', positive voltage) when the following three conditions are all satisfied:

1 - The modem is connected to an active telephone line that is "off-hook";


2 - The modem is in data mode, not voice or dialing mode; and
3 - The modem has completed dialing or call setup functions and is
generating an answer tone.

If the line goes "off-hook", a fault condition is detected, or a voice connection is


established, the DCE Ready signal is deasserted (logic '1', negative voltage).

IMPORTANT: If DCE Ready originates from a device other than a modem, it


may be asserted to indicate that the device is turned on and ready to function, or it
may not be used at all. If unused, DCE Ready should be permanently asserted
(logic '0', positive voltage) within the DCE device or by use of a self-connect
jumper in the cable. Alternatively, the DTE device may be programmed to ignore
this signal.

Pin 20 - DTE Ready (DTR) This signal is asserted (logic '0', positive voltage) by the
DTE device when it wishes to open a communications channel. If the DCE device is a
modem, the assertion of DTE ready prepares the modem to be connected to the telephone
circuit, and, once connected, maintains the connection. When DTE Ready is deasserted
(logic '1', negative voltage), the modem is switched to "on-hook" to terminate the
connection.

IMPORTANT: If the DCE device is not a modem, it may require DTE Ready to
be asserted before the device can be used, or it may ignore DTE Ready altogether.
If the DCE device (for example, a printer) is not responding, confirm that DTE
Ready is asserted before you search for other explanations.

Pin 8 - Received Line Signal Detector (CD) (also called carrier detect) This signal is
relevant when the DCE device is a modem. It is asserted (logic '0', positive voltage) by
the modem when the telephone line is "off-hook", a connection has been established, and

65
an answer tone is being received from the remote modem. The signal is deasserted when
no answer tone is being received, or when the answer tone is of inadequate quality to
meet the local modem's requirements (perhaps due to a noisy channel).

Pin 12 - Secondary Received Line Signal Detector (SCD) This signal is equivalent to
the Received Line Signal Detector (pin 8), but refers to the secondary channel.

Pin 22 - Ring Indicator (RI) This signal is relevant when the DCE device is a modem,
and is asserted (logic '0', positive voltage) when a ringing signal is being received from
the telephone line. The assertion time of this signal will approximately equal the duration
of the ring signal, and it will be deasserted between rings or when no ringing is present.

Pin 23 - Data Signal Rate Selector This signal may originate either in the DTE or DCE
devices (but not both), and is used to select one of two prearranged baud rates. The
asserted condition (logic '0', positive voltage) selects the higher baud rate.

Transmitter and Receiver Timing Signals

Pin 15 - Transmitter Signal Element Timing (TC) (also called Transmitter Clock)
This signal is relevant only when the DCE device is a modem and is operating with a
synchronous protocol. The modem generates this clock signal to control exactly the rate
at which data is sent on Transmitted Data (pin 2) from the DTE device to the DCE
device. The logic '1' to logic '0' (negative voltage to positive voltage) transition on this
line causes a corresponding transition to the next data element on the Transmitted Data
line. The modem generates this signal continuously, except when it is performing internal
diagnostic functions.

Pin 17 - Receiver Signal Element Timing (RC) (also called Receiver Clock) This
signal is similar to TC described above, except that it provides timing information for the
DTE receiver.

Pin 24 - Transmitter Signal Element Timing (ETC) (also called External Transmitter

66
Clock) Timing signals are provided by the DTE device for use by a modem. This signal
is used only when TC and RC (pins 15 and 17) are not in use. The logic '1' to logic '0'
transition (negative voltage to positive voltage) indicates the time-center of the data
element. Timing signals will be provided whenever the DTE is turned on, regardless of
other signal conditions.

Channel Test Signals

Pin 18 - Local Loopback (LL) This signal is generated by the DTE device and is used
to place the modem into a test state. When Local Loopback is asserted (logic '0', positive
voltage), the modem redirects its modulated output signal, which is normally fed into the
telephone line, back into its receive circuitry. This enables data generated by the DTE to
be echoed back through the local modem to check the condition of the modem circuitry.
The modem asserts its Test Mode signal on Pin 25 to acknowledge that it has been placed
in local loopback condition.

Pin 21 - Remote Loopback (RL) This signal is generated by the DTE device and is
used to place the remote modem into a test state. When Remote Loopback is asserted
(logic '0', positive voltage), the remote modem redirects its received data back to its
transmitted data input, there by remodulating the received data and returning it to its
source. When the DTE initiates such a test, transmitted data is passed through the local
modem, the telephone line, the remote modem, and back, to exercise the channel and
confirm its integrity. The remote modem signals the local modem to assert Test Mode on
pin 25 when the remote loopback test is underway.

Pin 25 - Test Mode (TM) This signal is relevant only when the DCE device is a
modem. When asserted (logic '0', positive voltage), it indicates that the modem is in a
Local Loopback or Remote Loopback condition. Other internal self-test conditions may
also cause Test Mode to be asserted, and depend on the modem and the network to which
it is attached.

If the full EIA232 standard is implemented as defined, the equipment at the far end of the
connection is named the DTE device (usually a computer or terminal), has a male DB25

67
connector, and utilizes 22 of the 25 available pins for signals or ground. Equipment at the
near end of the connection (the telephone line interface) is named the DCE device
(usually a modem), has a female DB25 connector, and utilizes the same 22 available pins
for signals and ground. The cable linking DTE and DCE devices is a parallel straight-
through cable with no crossovers or self-connects in the connector hoods. If all devices
exactly followed this standard, all cables would be identical, and there would be no
chance that an incorrectly wired cable could be used. This drawing shows the orientation
and connector types for DTE and DCE devices:

3.3 Electrical Standards

The EIA232 standard uses negative, bipolar logic in which a negative voltage signal
represents logic '1', and positive voltage represents logic '0'. This probably originated
with the pre-RS232 current loop standard used in 1950s-vintage teletype machines in
which a flowing current (and hence a low voltage) represents logic '1'.

NOTE: The negative logic assignment of EIA232 is the reverse of that found in most
modern digital circuit designs.

3.4 Common Signal Ground

The EIA232 standard includes a common ground reference on Pin 7, and is frequently
joined to Pin 1 and a circular shield that surrounds all 25 cable conductors. Data, timing,
and control signal voltages are measured with respect to this common ground. EIA232
cannot be used in applications where the equipment on opposite ends of the connection
must be electrically isolated.

NOTE: optical isolators may be used to achieve ground isolation, however, this
option is not mentioned or included in the EIA232 specification.

68
3.5 Cable wiring examples

DB25 to DB9 Adapter


Signals on the DB25 DTE side are directly
mapped to the DB9 assignments for a
DTE device. Use this to adapt a 25-pin
COM connector on the back of a computer
to mate with a 9-pin serial DCE device,
such as a 9-pin serial mouse or modem.
This adapter may also be in the form of a
cable.

DB9 to DB25 Adapter


Signals on the DB9 DTE side are directly
mapped to the DB25 assignments for a
DTE device. Use this to adapt a 9-pin
COM connector on the back of a computer
to mate with a 25-pin serial DCE devices,
such as a modem. This adapter may also
be in the form of a cable.
DB25 to DB9 Adapter (pin 1 connected to shield)

This adapter has the same wiring as the previous cable except that pin 1 is wired to the
connector shell (shield). Note that the cable's shield is usually a foil blanket surrounding
all conductors running the length of the cable and joining the connector shells. Pin 1 of

69
the EIA232 specification, called out as "shield", may be separate from the earth ground
usually associated with the connector shells.

3.6 Limitations of the standard

Because the application of RS-232 has extended far beyond the original purpose of
interconnecting a terminal with a modem, successor standards have been developed to
address the limitations. Issues with the RS 232 standard include:

• The large voltage swings and requirement for positive and negative supplies
increases power consumption of the interface and complicates power supply
design. The voltage swing requirement also limits the upper speed of a compatible
interface.
• Single-ended signalling referred to a common signal ground limits the noise
immunity and transmission distance.
• Multi-drop (meaning a connection between more than two devices) operation of
an RS-232 compatible interface is not defined; while multi-drop "work-arounds"
have been devised, they have limitations in speed and compatibility.
• Asymmetrical definitions of the two ends of the link make the assignment of the
role of a newly developed device problematical; the designer must decide on
either a DTE-like or DCE-like interface and which connector pin assignments to
use.
• The handshaking and control lines of the interface are intended for the setup and
takedown of a dial-up communication circuit; in particular, the use of handshake
lines for flow control is not reliably implemented in many devices.
• While the standard recommends a connector and pinout, the connector is large by
current standards.

70
3.7 Applcations
They are used in cash drawers, barcode and magnetic stripe readers, measurement
and remote-control devices. Hence, computers made for such applications are
equipped with RS-232 ports either 'on-board', or on a separate PCI or ISA
card.

3.8 Role in modern computing


Today, RS-232 is gradually being superseded in personal computers by USB for local
communications. However, RS-232 is still quite common in point-of-sale (cash
drawers, barcode and magnetic stripe readers) and industrial (measurement and
remote-control devices) peripherals, so computers made for such applications are
still equipped with RS-232 ports either 'on-board', or on a separate PCI or ISA card
3.9 Related standards

Other serial signalling standards may not interoperate with standard-compliant RS 232
ports. For example, using the TTL levels of +5 and 0 V puts the mark level in the
forbidden undefined area of the standard. Such levels are sometimes used with NMEA-
compliant GPS receivers and depth finders. 20 mA current loop uses the absence of 20
mA current for high, and the presence of current in the loop for low; this signal level is
often used for long-distance and optically isolated links. Connection of a current-loop
device to a compliant RS 232 port requires a level translator; current-loop devices are
capable of supplying voltages in excess of the withstand voltage limits of a compliant
device. However, the original IBM XT serial port card implemented a 20 mA current-
loop interface, which was never emulated by other suppliers of plug-compatible
equipment.

71
4. Implementation and coding

4.1 Schematic diagram


4.1.1 Transmitter circuit

72
Transmitter circuit is shown above. Here touch screen is
connected through an interface circuit to microcontroller. This interface selects which
two wires are to be used as electrodes and which two are to be used as output lines to
read ‘x or y’ coordinate. Output lines from interface are connected to portA analog pins,

73
because output of touch screen is analog.
Zigbee device has four wires, one is ground, and one is power
supply, one is for Tx, and another for Rx. Transmit pin is connected to RB0/int pin of
microcontroller and receive pin is connected to pin RB1.it receives, data to be transmitted
from micro controller and interrupt microcontroller through transmit pin.
To know whether circuit is functioning properly or not, led and
lamp arrangement is connected in the circuit. Led
4.1.2 Receiver circuit

GLCD has 5 wires, one is power supply, one is ground, and


remaining five wires are used by micro controller to send commands to GLCD. These
five pins are connected to pins RB3 to RB7. Remaining circuit set up is same as in
transmitter circuit except that lamp in Tx circuit is replaced buzzer in Rx circuit.

4.2 Source code


4.2.1 Transmitter program

74
#include <16F73.h>
#include <touchscreen.h>

#use delay (clock=20000000)


#use rs232 (baud = 9600, xmit=PIN_B0,rcv=PIN_B1,stream=WIRELESS)
// WIRELESS communication

unsigned long x_coord128, y_coord64;

void send_data (char sdata[])


{
int i = 0;
while(sdata[i]!= 0)
{
fputc(sdata[i],WIRELESS);
i++;
}
}

void main()
{
char text[25];

output_high(PIN_C4);
delay_ms(1000);
output_low(PIN_C4);
delay_ms(1000);
output_high(PIN_C4);
delay_ms(1000);
output_low(PIN_C4);

while(1)
{

while(!PressDetect()); //Wait for press detection on touch screen


x_coord128 = GetX(); //get X- coordinates of touched
location on to variable x_coord128

y_coord64 = GetY(); //Get the Y-coordinates of touched location

if((x_coord128 > 25) && (x_coord128 < 85) && (y_coord64 > 25) &&
(y_coord64 < 125))
{
sprintf(text,"1");
send_data(text);
output_high(PIN_C4);//turn ON the LED
}
else if((x_coord128 > 25) && (x_coord128 < 85) && (y_coord64 >
150) && (y_coord64 < 240))
{
sprintf(text,"2");

75
send_data(text);
output_high(PIN_C4);//turn ON the LED
}

else if((x_coord128 > 90) && (x_coord128 < 140) && (y_coord64 >
25) && (y_coord64 < 125))
{
sprintf(text,"3");
send_data(text);
output_high(PIN_C4); //turn ON the LED
}
else if((x_coord128 > 90) && (x_coord128 < 140) && (y_coord64 >
150) && (y_coord64 < 240))
{
sprintf(text,"4");
send_data(text);
output_high(PIN_C4); //turn ON the LED
}
else if((x_coord128 > 145) && (x_coord128 < 190) && (y_coord64 >
25) && (y_coord64 < 125))
{
sprintf(text,"5");
send_data(text);
output_high(PIN_C4); //turn ON the LED
}
else if((x_coord128 > 145) && (x_coord128 < 190) && (y_coord64 >
150) && (y_coord64 < 240))
{
sprintf(text,"6");
send_data(text);
output_high(PIN_C4); //turn ON the LED
}
else if((x_coord128 > 195) && (x_coord128 < 250) && (y_coord64 >
25) && (y_coord64 < 125))
{
output_high(PIN_C3); //turn ON the LED

}
else if((x_coord128 > 195) && (x_coord128 < 250) && (y_coord64 >
150) && (y_coord64 < 240))
{
output_low(PIN_C3);
}
delay_ms(100);
output_low(PIN_C4); //turn off the LED
}
}

4.2.2 Receiver program:


#include <16F73.h>

76
#include <nokiaGLCD.c>
#use delay(clock=20000000)
#use rs232 (baud = 9600, xmit=PIN_B1,rcv=PIN_B0,stream=WIRELESS) //
WIRELESS communication
void main()
{
char text[25]; //For capturing the text
char ch;
int i = 0;

//Following code is for Health Check (microcontroller)


output_high(PIN_C4); //LEC ON
delay_ms(1000);
output_low(PIN_C4); //LED OFF
delay_ms(1000);
output_high(PIN_C4); //LED ON
delay_ms(1000);
output_low(PIN_C4); //LED ON

init_3310_lcd(); //Initialize Nokia GLCD

//Nokia LCD got 6 row and 21 columns


nokia_clear_screen(); //Clear the screen contents
nokia_gotoxy(2,1); //Go to row number-1 and column number 2
sprintf(text," TOUCH SCREEN"); //this copies the text "TOUCH CREEN"
into the variable text.
printf(nokia_printchar,"%s",text); //Print the text on to LCD
delay_ms(500); //wait for 500 milli seconds
nokia_gotoxy(2,3); //third row second column
sprintf(text,” AIR LINES"); //copies the text into text variable
printf(nokia_printchar,"%s",text);
delay_ms(500);
nokia_gotoxy(2,5); //Fifth row and second column
sprintf(text,” ASSISTANT");
printf(nokia_printchar,"%s",text);
delay_ms(2000);
nokia_clear_screen();
nokia_gotoxy(3,3);
sprintf(text,"*** READY ***");
printf(nokia_printchar,"%s",text);
delay_ms(1000);
nokia_gotoxy(2,2);
while(1)
{
i = 0;

if(!input(PIN_A0)) //If the clear button pressed


{
output_high(PIN_C3); //LED ON
delay_ms(500); //Long Beep
output_low(PIN_C3); //LED OFF

nokia_clear_screen();
nokia_gotoxy(4,1);
printf(nokia_printchar," NO");
nokia_gotoxy(4,3);
printf(nokia_printchar," PENDING");

77
nokia_gotoxy(4,5);
printf(nokia_printchar," REQUESTS");
output_low(PIN_C4);
}
ch = fgetc(WIRELESS); //get character
nokia_clear_screen(); // clear Nokia screen LCD
nokia_gotoxy(1,1);
printf(nokia_printchar," SEAT NO: A9");
output_high(PIN_C4); //LED ON
switch(ch) //switch to the block based on character received.
{
case '1':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," WATER");
break;

case '2':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," FOOD");
break;

case '3':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," MEDICINE");
break;

case '4':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," BED SHEET");
break;
case '5':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," SNACKS");
break;
case '6':
nokia_gotoxy(4,3);
printf(nokia_printchar," REQUESTING");
nokia_gotoxy(4,5);
printf(nokia_printchar," MAGAZINE");
break;
}
output_high(PIN_C3); //buzzer ON
delay_ms(2000); //delay for long beep
output_low(PIN_C3); //Buzzer OFF
4.3 Loading program into micro controller

78
4.3.1 Writing source code:
Here we use pic’C’ software to write source code and to compile it. These
are the steps we follow to write source code:
• Start pic’C’ compiler.
• Click ‘new project -> source code’ from project drop down menu.
• Write source code in either embedded ‘C’ or Assembly language.
• Save the file with file name “airlines.c”.
• Compile the code and get output file(.hex file).

4.3.2 Loading .hex file into micro controller:
Here we use pickit2 software to dump program into micro controller. Steps
to follow:
• Start pickit2.
• Click check system from tools menu.
• Click load hex from file menu.
• Select the appropriate .hex file and then click ‘write’.

4.4 Conclusion
79
This project provides provides an efficient device that helps
dumb/illiterate to communicate with airhostess in airlines. Zigbee used in this project
provides a typical range of 50m. By using high power Zigbee module we can extend this
range up to 1.3 km. using Zigbee we can send text only. By using IR/RF transmitter and
receiver we can send audio and video signals also. But Zigbee provides better data
security and range is also more compared to IR. And another thing to be noted is Zigbee
works in license free bands. Zigbee is most preferable where data security is important.
Further enhancements yet to be made in field of Zigbee.

Touch screen used here is 4wire resistive touch screen. This is chosen
because resistive touch screen’s stability and durability are more compared to other touch
screens. Response time is also very less. Resistant to intense light and not very sensitive
as compared to other technologies. But it accepts only one touch at a time. By using
other technology like surface acoustic wave or infrared we can further improve project so
that it can accept more than touch at a time. But those touch screens are very sensitive
and less resistant to instance light. And also they can’t produce accurate results as they
are sensitive to environment changes.

80
81
REFERENCES
1. Datsheets of 16f73
2. Datasheets of 4-wire resistive touch screen
3. Datasheets of helicom IP-Link 1223-50xx
4. Datasheets of Nokia GLCD
5. Datasheets of IC7805

82
7.Appendix
Abbreviations

AUC Authentication Center


BTS Base Transceiver Station
BSC Base Station Controller
CEPT Conference of European Posts and Telegraphs
EIR Equipment Identity Register.
ETSI European Telecommunication Standards Institute
HLR Home Location Register
IMEI International Mobile Equipment Identity
ITU International Telecommunication Union
IMSI International Mobile Subscriber Identity
LA Last known Location Area
MSISDN Mobile Subscriber ISDN
MSC Mobile service Switching Center
MAP Mobile Application Part
MSRN Mobile Station Roaming Number
MS Mobile station
MM Mobility Management layer
POTS Plain Old Telephone Service
PSTN Public switched telephone network
PSPDN packet switched public data network
PLMN Public land mobile network
Radio Resources management (RR)
RBS Remote Base station
SIM Subscriber Identity Module
TCU Transcoding Unit
TRAU Transcoding Rate and Adaptation Unit
VLR Visitor Location Register

83

You might also like