You are on page 1of 79

ATM SECURITY

USING GSM AND MEMS

CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION

The overview of this project is to design GSM based ATM SECURITY system
using AT89S52.

1.2 AIM OF THE PROJECT

To enhance the security system of present existing ATM machine.

1.3 METHODOLOGY

The Project ‘Atm security system using gsm module ’ is designed using GSM
technology. According to this technology the communication takes place between
GSM and microcontroller.

The project basically consists of a GSM module which activates the


microcontroller to start the processing of ATM card if the password received from the
preloaded GSM number is correct.

1.4. SIGNIFICANCE

This System stops any sort of robbery by taking GSM as its input functional
bock. It’s the GSM that is activating the total project by receiving the message from
the mobile number stored in the card. Once the micro controller is activated the
following sequence is started which involves entering of correct password once again
which is the CARD password for the further transaction to be continued.

S.R.T.I.S.T 1
ATM SECURITY
USING GSM AND MEMS

1.5 BLOCK DIAGRAM

Fig 1.1 Block Diagram of the Project

1.6 BLOCK DIAGRAM DESCRIPTION


The hardware involved in this project is a Power Supply, a LCD to display the
concerned information, a GSM is interfaced to the Microcontroller through MAX
232, GSM is interfaced through ADC 0804.
While execution, the tilt identified by the mems activates the microcontroller.
The microcontroller then starts the following sequence, it gives command to shut
down the door in order to avoid the thief to run away and also a sms is sent to the
vigilance system to alert them so that they can approach to the place as soon as
possible to catch the burglar.
This Project mainly consists of Power Supply section, Microcontroller section,
GSM section, LCD display section, Max 232 serial driver section,.

1.6.1 Power Supply Section

S.R.T.I.S.T 2
ATM SECURITY
USING GSM AND MEMS

. The input to the circuit is applied from the regulated power supply. The a.c. input
i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to
a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order
to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to
remove any a.c components present even after rectification. Now, this voltage is given
to a voltage regulator to obtain a pure constant dc voltage.

Transformer:
Usually, DC voltages are required to operate various electronic equipment and
these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly.
Thus the a.c input available at the mains supply i.e., 230V is to be brought down to
the required voltage level. This is done by a transformer. Thus, a step down
transformer is employed to decrease the voltage to a required level.

Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project,
a bridge rectifier is used because of its merits like good stability and full wave
rectification.
Filter:
Capacitive filter is used in this project. It removes the ripples from the output
of rectifier and smoothens the D.C. Output received from this filter is constant until
the mains voltage and load is maintained constant. However, if either of the two is

S.R.T.I.S.T 3
ATM SECURITY
USING GSM AND MEMS

varied, D.C. voltage received at this point changes. Therefore a regulator is applied at
the output stage.

Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant
voltage level. In this project, power supply of 5V and 12V are required. In order to
obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first
number 78 represents positive supply and the numbers 05, 12 represent the required
output voltage levels.

1.6.2 Microcontroller Section


Microprocessors and microcontrollers are widely used in embedded systems products.
Microcontroller is a programmable device. A microcontroller has a CPU in addition
to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single
chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in
microcontrollers makes them ideal for many applications in which cost and space are
critical.

The Intel 8051 is Harvard architecture, single chip microcontroller (µC) which was
developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s
and early 1990s, but today it has largely been superseded by a vast range of enhanced
devices with 8051-compatible processor cores that are manufactured by more than 20
independent manufacturers including Atmel, Infineon Technologies and Maxim
Integrated Products.

8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a
time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the
CPU. 8051 is available in different memory types such as UV-EPROM, Flash and
NV-RAM

S.R.T.I.S.T 4
ATM SECURITY
USING GSM AND MEMS

1.6.4 GSM Section


GSM (Global System for Mobile communications) is a cellular network,
which means that mobile phones connect to it by searching for cells in the immediate
vicinity. GSM networks operate in four different frequency ranges. Most GSM
networks operate in the 900 MHz or 1800 MHz bands.

1.6.5 MAX 232 Section


The microcontroller can communicate with the serial devices using its single
Serial Port. The logic levels at which this serial port operates is TTL logics. But some
of the serial devices operate at RS 232 Logic levels. For example PC and Smart Card
Reader etc. So in order to communicate the Microcontroller with either Smart Card
Reader or PC, a mismatch between the Logic levels occurs. In order to avoid this
mismatch, in other words to match the Logic levels, a Serial driver is used. And MAX
232 is a Serial Line Driver used to establish communication between microcontroller
and PC (or Smart Card Reader)

1.6.6 LCD Display Section


This section is basically meant to show up the status of the project. This
project makes use of Liquid Crystal Display to display / prompt for necessary
information.

1.6.7 Relay Section


A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet to
open or close one or many sets of contacts. A relay is able to control an output circuit
of higher power than the input circuit, it can be considered to be, in a broad sense, a
form of an electrical amplifier

S.R.T.I.S.T 5
ATM SECURITY
USING GSM AND MEMS

CHAPTER 2

LITERATURE REVIEW
2.1 INTRODUCTION TO EMBEDDED SYSTEMS
An embedded system can be defined as a computing device that does a specific
focused job. Appliances such as the air-conditioner, VCD player, DVD player,
printer, fax machine, mobile phone etc. are examples of embedded systems. Each of
these appliances will have a processor and special hardware to meet the specific
requirement of the application along with the embedded software that is executed by
the processor for meeting that specific requirement.

The embedded software is also called “firm ware”. The desktop/laptop computer
is a general purpose computer. You can use it for a variety of applications such as
playing games, word processing, accounting, software development and so on.

In contrast, the software in the embedded systems is always fixed listed below:
· Embedded systems do a very specific task, they cannot be programmed to do
different things. . Embedded systems have very limited resources, particularly the
memory. Generally, they do not have secondary storage devices such as the CDROM
or the floppy disk. Embedded systems have to work against some deadlines. A
specific job has to be completed within a specific time. In some embedded systems,
called real-time systems, the deadlines are stringent. Missing a deadline may cause a
catastrophe-loss of life or damage to property. Embedded systems are constrained for
power. As many embedded systems operate through a battery, the power consumption
has to be very low.
· Some embedded systems have to operate in extreme environmental conditions such
as very high temperatures and humidity.

Following are the advantages of Embedded Systems:

S.R.T.I.S.T 6
ATM SECURITY
USING GSM AND MEMS

1. They are designed to do a specific task and have real time performance
constraints which must be met.
2. They allow the system hardware to be simplified so costs are reduced.
3. They are usually in the form of small computerized parts in larger devices
which serve a general purpose.
4. The program instructions for embedded systems run with limited computer
hardware resources, little memory and small or even non-existent keyboard or
screen.

Introduction: The Evolution of Mobile Telephone Systems


Cellular is one of the fastest growing and most demanding telecommunications
applications. Today, it represents a continuously increasing percentage of all new
telephone subscriptions around the world. Currently there are more than 45 million
cellular subscribers worldwide, and nearly 50 percent of those subscribers are located
in the United States.

The concept of cellular service is the use of low power transmitters where frequencies
can be reused within a geographic area. The idea of cell based mobile radio service
was formulated in the United States at Bell Labs in the early 1970s. Cellular systems
began in the United States with the release of the advanced mobile phone service
(AMPS) system in 1983. The AMPS standard was adopted by Asia, Latin America
and Oceanic countries, creating the largest potential market in the world for cellular.

In the early 1980s, most mobile telephone systems were analog rather than digital,
like today's newer systems. One challenge facing analog systems was the inability to
handle the growing capacity needs in a cost efficient manner. As a result, digital
technology was welcomed.

The advantages of digital systems over analog systems include ease of signaling,
lower levels of interference, integration of transmission and switching and increased
ability to meet capacity demands. The table below shows the worldwide development
of mobile telephone systems.

S.R.T.I.S.T 7
ATM SECURITY
USING GSM AND MEMS

2.1.1 Application Areas


Nearly 99 per cent of the processors manufactured end up in embedded systems.
• Consumer appliances

• Office automation

• Industrial automation:

• Medical electronics.

• Telecommunications

• Wireless technologies

• Security& finance

Examples of embedded systems

 Calculators
 Laser Printer
 Security Systems
 Musical Instruments
 Medical Equipment's
 Automatic Teller Machines (ATMs)
 Cellular telephones and telephone switches

S.R.T.I.S.T 8
ATM SECURITY
USING GSM AND MEMS

 Inertial guidance systems for aircraft and missiles


 Computer peripherals such as routers and printers
 engine controllers and antilock brake controllers for automobiles

2.2 MICROCONTROLLER AND MICROPROCESSOR


 The prime use of a microcontroller is to control the operation of a
machine using fixed programs that is stored in ROM that doesn't change
over the life time of the system
 Processors have most of their op-codes moving data from external
memory to the CPU
 Generally controllers move data and code from internal memory to
ALU
 Processors have most of their instructions operating on a byte
 Controllers on the other hand, have many bit handling instructions
making it ideal for control applications.

2.3 MICROCONTROLLER
A Micro controller consists of a powerful CPU tightly coupled with memory
RAM, ROM or EPROM), various I / O features such as Serial ports, Parallel Ports,
Timer/Counters, Interrupt Controller, Data Acquisition interfaces-Analog to Digital
Converter (ADC), Digital to Analog Converter (ADC), everything integrated onto a
single Silicon Chip.

It does not mean that any micro controller should have all the above said
features on chip, Depending on the need and area of application for which it is
designed, the ON-CHIP features present in it may or may not include all the
individual section said above.
Any microcomputer system requires memory to store a sequence of
instructions making up a program, parallel port or serial port for communicating with
an external system, timer / counter for control purposes like generating time delays,
Baud rate for the serial port, apart from the controlling unit called the Central
Processing Unit.

S.R.T.I.S.T 9
ATM SECURITY
USING GSM AND MEMS

2.4 ADVANTAGES
If a system is developed with a microprocessor, the designer has to go for
external memory such as RAM, ROM or EPROM and peripherals and hence the size
of the PCB will be large enough to hold all the required peripherals. But, the micro
controller has got all these peripheral facilities on a single chip so development of a
similar system with a micro controller reduces PCB size and cost of the design.
One of the major differences between a micro controller and a microprocessor
is that a controller often deals with bits , not bytes as in the real world application, for
example switch contacts can only be open or close, indicators should be lit or dark
and motors can be either turned on or off and so forth

2.5 PROBLEM STATEMENT


Enhancing the security system of the atm machine. The present existing
system is not sufficient to stop the thief when he knows the password of the ATM
card and the account number.

2.6 SOLUTION

If we introduce the project then it would be easy to stop the thief without

drawing money from the ATM though he knew the password. As the thief inserts the

ATM into the machine, the GSM is activated. This gives signal to the microcontroller

to wait until it the GSM module receives the code from the pre defined user number

before the transaction is timed out.

2.7 DESCRIPTION
In this project, the GSM module is placed in the upper or lower panel of the

atm machine, when a thief inserts the ATM card into the machine or swipes the card,

a message is sent to the predefined mobile number and makes the controller to wait

until the password message is received from that number before the transaction timed

out. When the message is received to GSM module, it verifies the password. If the

S.R.T.I.S.T 10
ATM SECURITY
USING GSM AND MEMS

password received is correct then the further process of microcontroller is activated.

As the microcontroller is activated it then has to start a sequence which verifies the

CARD password and then start the further transaction.

CHAPTER 3
AT89S52 MICROCONTROLLER

3.1 AT89S52
3.1.1 A BRIEF HISTORY OF 8051
In 1981, Intel corporation introduced an 8 bit microcontroller called 8051. this
microcontroller had 128 bytes of RAM, 4K bytes of chip ROM, two timers, one serial
port, and four ports all on a single chip. At the time it was also referred as “ A
SYSTEM ON A CHIP”
The 8051 is an 8-bit processor meaning that the CPU can work only on 8 bits
data at a time. Data larger than 8 bits has to be broken into 8 bits pieces to be
processed by the CPU. The 8051 has a total of four I\O ports each 8 bit wide.
There are many versions of 8051 with different speeds and amount of on-chip
ROM and they are all compatible with the original 8051. this means that if you write a
program for one it will run on any of them.
The 8051 is an original member of the 8051 family. There are two other

members in the 8051 family of microcontrollers. They are 8052 and 8031. All the
three
microcontrollers will have the same internal architecture, but they differ in the
following
aspects.
 8031 has 128 bytes of RAM, two timers and 6 interrupts.

 8051 has 4K ROM, 128 bytes of RAM, two timers and 6

interrupts.

 8052 has 8K ROM, 256 bytes of RAM, three timers and 8

interrupts.

3.2 NECESSITY OF MICROCONTROLLERS

S.R.T.I.S.T 11
ATM SECURITY
USING GSM AND MEMS

Microprocessors brought the concept of programmable devices and made


many applications of intelligent equipment. Most applications, which do not need
large amount of data and program memory, tended to be costly.
The microprocessor system had to satisfy the data and program requirements
so, sufficient RAM and ROM are used to satisfy most applications .The peripheral
control equipment also had to be satisfied. Therefore, almost all-peripheral chips were
used in the design. Because of these additional peripherals cost will be comparatively
high.
Bulky:
On comparing a board full of chips (Microprocessors) with one chip with all
components in it (Microcontroller).
Debugging:
Lots of Microprocessor circuitry and program to debug. In Micro controller
there is no Microprocessor circuitry to debug.
Slower Development time: As we have observed Microprocessors need a lot of
debugging at board level and at program level, where as, Micro controller do not
have the excessive circuitry and the built-in peripheral chips are easier to program for
operation.
So peripheral devices like Timer/Counter, Parallel programmable port, Serial
Communication Port, Interrupt controller and so on, which were most often used were
integrated with the Microprocessor to present the Micro controller .RAM and ROM
also were integrated in the same chip. The ROM size was anything from 256 bytes to
32Kb or more. RAM was optimized to minimum of 64 bytes to 256 bytes or more.
Microprocessor has following instructions to perform:
1. Reading instructions or data from program memory ROM.
2. Interpreting the instruction and executing it.
3. Microprocessor Program is a collection of instructions stored in a Nonvolatile
memory.
4. Read Data from I/O device
5. Process the input read, as per the instructions read in program memory.
6. Read or write data to Data memory.
7. Write data to I/O device and output the result of processing to O/P device.

S.R.T.I.S.T 12
ATM SECURITY
USING GSM AND MEMS

3.3 Introduction to AT89S52


The AT89s52 is a low-voltage, high-performance CMOS 8bit
microcomputer with 8K bytes of Flash programmable memory. The device is
manufactured using Atmel’s high density nonvolatile memory technology and is
compatible with the industry-standard MCS-51 instruction set. The on chip flash
allows the program memory to be reprogrammed in system or by a conventional
non volatile memory programmer. By combining a versatile 8-bit CPU with Flash
on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which
provides a highly flexible and cost-effective solution to many embedded control
applications.
In addition, the AT89s52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM, timer/counters, serial port and
interrupt system to continue functioning. The power-down mode saves the RAM
contents but freezes the oscillator disabling all other chip functions until the next
hardware reset.

3.4 FEATURES
Compatible with MCS-51® Products
• 8K Bytes of In-System Programmable (ISP) Flash Memory
– Endurance: 1000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 256 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes

S.R.T.I.S.T 13
ATM SECURITY
USING GSM AND MEMS

• Interrupt Recovery from Power-down Mode


• Watchdog Timer
• Dual Data Pointer
-Power-off Flag
PIN DIAGRAM

FIG 3.1 PIN DIAGRAM OF AT89S52 IC

S.R.T.I.S.T 14
ATM SECURITY
USING GSM AND MEMS

3.5 PIN DESCRIPTION


Pin Description
VCC: Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND: Pin 20 is the ground.
Port 0

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data memory. In this mode,
P0 has internal pull-ups. Port 0 also receives the code bytes during Flash
programming and outputs the code bytes during Program verification. External pull-
ups are required during program verification

Port 1

S.R.T.I.S.T 15
ATM SECURITY
USING GSM AND MEMS

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
1 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger
input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also
receives the low-order address bytes during Flash programming and verification.

Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
2 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that uses 16-bit addresses
(MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. The
port also receives the high-order address bits and some control signals during Flash
programming and verification
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3

S.R.T.I.S.T 16
ATM SECURITY
USING GSM AND MEMS

output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pullups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source current (IIL) because of
the pullups. Port 3 also serves the functions of various special features of the
AT89C51, as shown in the following table.
Port 3 also receives some control signals for Flash pro- gramming and verification.

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write
P3.7 RD (external data memory read strobe)

RST
A high on this pin for two machine cycles while the oscillator is running resets
the device. This pin drives high for 98 oscillator periods after the Watchdog times out.
The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In
the default state of bit DISRTO, the RESET HIGH out feature is enabled
ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the
address during accesses to external mem- ory. This pin is also the program pulse
input (PROG) during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator
frequency and may be used for external timing or clocking Note, however, that
one ALE pulse is skipped during each access to external data memory. If
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the
bit set, ALE is active only dur-ing a MOVX or MOVC instruction. Otherwise, the

S.R.T.I.S.T 17
ATM SECURITY
USING GSM AND MEMS

pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.

FIG-3.2 Functional block diagram of micro controller


3.6 The 8052 Oscillator and Clock
The heart of the 8051 circuitry that generates the clock pulses by which all
the internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is
provided for connecting a resonant network to form an oscillator. Typically a quartz
crystal and capacitors are employed. The crystal frequency is the basic internal clock
frequency of the microcontroller. The manufacturers make 8051 designs that run at
specific minimum and maximum frequencies typically 1 to 16 MHz.

S.R.T.I.S.T 18
ATM SECURITY
USING GSM AND MEMS

Fig-3.3 Oscillator and timing circuit

3.7 MEMORIES
3.7.1 Types of memory:
The 8052 have three general types of memory. They are on-chip memory,
external Code memory and external Ram. On-Chip memory refers to physically
existing memory on the micro controller itself. External code memory is the code
memory that resides off chip. This is often in the form of an external EPROM.
External RAM is the Ram that resides off chip. This often is in the form of standard
static RAM or flash RAM.
a) Code memory
Code memory is the memory that holds the actual 8052 programs that is to be
run. This memory is limited to 64K. Code memory may be found on-chip or off-chip.
It is possible to have 8K of code memory on-chip and 60K off chip memory
simultaneously. If only off-chip memory is available then there can be 64K of off chip
ROM. This is controlled by pin provided as EA
b) Internal RAM

S.R.T.I.S.T 19
ATM SECURITY
USING GSM AND MEMS

The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is
found on-chip. So it is the fastest Ram available. And also it is most flexible in terms
of reading and writing. Internal Ram is volatile, so when 8051 is reset, this memory is
cleared. 256 bytes of internal memory are subdivided. The first 32 bytes are divided
into 4 register banks. Each bank contains 8 registers. Internal RAM also contains 256
bits, which are addressed from 20h to 2Fh. These bits are bit addressed i.e. each
individual bit of a byte can be addressed by the user. They are numbered 00h to FFh.
The user may make use of these variables with commands such as SETB and CLR.
Special Function registered memory:
Special function registers are the areas of memory that control specific
functionality of the 8052 micro controller.
a) Accumulator (0E0h)
As its name suggests, it is used to accumulate the results of large no of
instructions. It can hold 8 bit values.
b) B registers (0F0h)
The B register is very similar to accumulator. It may hold 8-bit value. The b
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the product gets stored in B register. In div AB the quotient gets stored in B
with the remainder in A.
c) Stack pointer (81h)
The stack pointer holds 8-bit value. This is used to indicate where the next
value to be removed from the stack should be taken from. When a value is to be
pushed onto the stack, the 8052 first store the value of SP and then store the value at
the resulting memory location
d) Data pointer
The SFRs DPL and DPH work together work together to represent a 16-bit
value called the data pointer. It is a 16-bit SFR and also an addressable SFR.
e) Program counter
The program counter is a 16 bit register, which contains the 2 byte address,
which tells the 8052 where the next instruction to execute to be found in memory.
And is incremented each time an instruction is executes. It is not addressable SFR.

f) PCON (power control, 87h)

S.R.T.I.S.T 20
ATM SECURITY
USING GSM AND MEMS

The power control SFR is used to control the 8051’s power control modes.
Certain operation modes of the 8051 allow the 8051 to go into a type of “sleep
mode” which consumes much lee power.

g) TCON (timer control, 88h)


The timer control SFR is used to configure and modify the way in which the
8051’s two timers operate.. Additionally, some non-timer related bits are located in
TCON SFR. These bits are used to configure the way in which the external interrupt
flags are activated, which are set when an external interrupt occurs.

h) TMOD (Timer Mode, 89h)


The timer mode SFR is used to configure the mode of operation of each of the
two timers. Using this SFR your program may configure each timer to be a 16-bit
timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally
you may configure the timers to only count when an external pin is activated or to
count “events” that are indicated on an external pin.

i) TO (Timer 0 low/high, address 8A/8C h)


These two SFRs taken together represent timer 0. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up. What is configurable is how and when they increment in value.
j) T1 (Timer 1 Low/High, address 8B/ 8D h)
These two SFRs, taken together, represent timer 1. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up..
k) P0 (Port 0, address 90h, bit addressable)

S.R.T.I.S.T 21
ATM SECURITY
USING GSM AND MEMS

This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.
l) P1 (port 1, address 90h, bit addressable)
This is port latch1. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level
m) P2 (port 2, address 0A0h, bit addressable):
This is a port latch2. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.
n) P3 (port 3, address B0h, bit addressable) :
This is a port latch3. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.
o) IE (interrupt enable, 0A8h):
The Interrupt Enable SFR is used to enable and disable specific interrupts. The
low 7 bits of the SFR are used to enable/disable the specific interrupts, where the
MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of IE is 0
all interrupts are disabled regardless of whether an individual interrupt is enabled by
setting a lower bit.

S.R.T.I.S.T 22
ATM SECURITY
USING GSM AND MEMS

p) IP (Interrupt Priority, 0B8h)


The interrupt priority SFR is used to specify the relative priority of each
interrupt. On 8051, an interrupt maybe either low or high priority. An interrupt may
interrupt interrupts. For e.g., if we configure all interrupts as low priority other than
serial interrupt. However, if a serial interrupt is executing no other interrupt will be
able to interrupt the serial interrupt routine since the serial interrupt routine has the
highest priority.

q) PSW (Program Status Word, 0D0h)


The program Status Word is used to store a number of important bits that are
set and cleared by 8052 instructions. The PSW SFR contains the carry flag, the
auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also
contains the register bank select flags, which are used to select, which of the “R”
register banks currently in use.

r) SBUF (Serial Buffer, 99h)


SBUF is used to hold data in serial communication. It is physically two
registers. One is writing only and is used to hold data to be transmitted out of 8052 via
TXD. The other is read only and holds received data from external sources via RXD.
Both mutually exclusive registers use address 99h.
I/O ports:
One major feature of a microcontroller is the versatility built into the
input/output (I/O) circuits that connect the 8052 to the outside world. The main
constraint that limits numerous functions is the number of pins available in the 8051
circuit. The DIP had 40 pins and the success of the design depends on the flexibility
incorporated into use of these pins.

PORT 0

S.R.T.I.S.T 23
ATM SECURITY
USING GSM AND MEMS

Port 0 pins may serve as inputs, outputs, or, when used together, as a bi
directional low-order address and data bus for external memory. When used for
interfacing with the external memory, the lower byte of address is first sent via
PORT0, latched using Address latch enable (ALE) pulse and then the bus is turned
around to become the data bus for external memory.
PORT 1
Port 1 is exclusively used for input/output operations. PORTS 1 pin have no
dual function. When a pin is to be configured as input, 1 is to be written into the
corresponding Port 1 latch.
PORT 2
Port 2 maybe used as an input/output port. It may also be used to supply a
high –order address byte in conjunction with Port 0 low-order byte to address external
memory.. Port 2 latches remain stable when external memory is addressed, as they do
not have to be turned around (set to 1) for data input as in the case for Port 0.
PORT 3
Port 3 may be used to input /output port. The input and output functions can be
programmed under the control of the P3 latches or under the control of various special
function registers. Unlike Port 0 and Port 2, which can have external addressing
functions and change all eight-port b se, each pin of port 3 maybe individually
programmed to be used as I/O or as one of the alternate functions.
Pin (SFR) Alternate Use
P3.0-RXD (SBUF) Serial data input
P3.1-TXD (SBUF) Serial data output
3.8 P3.2-INTO 0 (TCON.1) External interrupt 0
P3.3 - INTO 1 (TCON.3) External interrupt 1
P3.4 - T0 (TMOD) External Timer 0 input
P3.5 – T1 (TMOD) External timer 1 input
P3.6 - WR External memory write pulse
P3.7 - RD External memory read pulse
INTERRUPTS:

The AT89S52 has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers0, 1, and 2), and the serial port

S.R.T.I.S.T 24
ATM SECURITY
USING GSM AND MEMS

interrupt. These interrupts are all shown in Figure 10. Each of these interrupt sources
can be individually enabled or disabled by setting or clearing a bit in Special Function
Register IE. IE also contains a global disable bit, EA, which disables all interrupts at
once. Note that Table 5 shows that bit position IE.6 is unimplemented. In the
AT89S52, bit position IE.5 is also unimplemented.Timer 2 interrupt is generated by
the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is
cleared by hardware when the service routine is vectored to. In fact, the service
routine may have to determine whether it was TF2 or EXF2 that generated the
interrupt, and that bit will have to be cleared in software.The Timer 0 and Timer 1
flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The
values are then polled by the circuitry in the next cycle. However, the Timer 2 flag,
TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows

S.R.T.I.S.T 25
ATM SECURITY
USING GSM AND MEMS

S.R.T.I.S.T 26
.
ATM SECURITY
USING GSM AND MEMS

CHAPTER 4
ADC 0804

4.1 Introduction

The ADC0808 data acquisition component is a monolithic CMOS device


with an 8-bit analog-to-digital converter, 8-channel multiplexer and microprocessor
compatible control logic. The 8-bit A/D converter uses successive approximation as
the conversion technique. The converter features a high impedance chopper stabilized
comparator, a 256R voltage divider with analog switch tree and a successive
approximation register. The 8-channel multiplexer can directly access any of 8-single-
ended analog signals. The device eliminates the need for external zero and full-scale
adjustments. Easy interfacing to microprocessors is provided by the latched and
decoded multiplexer address inputs and latched TTL tri-state outputs. The design of
the ADC0808 has been optimized by incorporating the most desirable aspects of
several A/D conversion techniques. The ADC0808 offers high speed, high accuracy,
minimal temperature dependence, excellent long-term accuracy and repeatability, and
consumes minimal power. These features make this device ideally suited to
applications from process and machine control to consumer and automotive
applications.
4.2 Features
1. Easy interface to all microprocessors
2. Operates ratio metrically or with 5 VDC or analog span
adjusted voltage reference
3. No zero or full-scale adjust required
4. 8-channel multiplexer with address logic
5. 0V to 5V input range with single 5V power supply
6. Outputs meet TTL voltage level specifications
7. Standard hermetic or molded 28-pin DIP package
8. 28-pin molded chip carrier package
9. ADC0808 equivalent to MM74C949

S.R.T.I.S.T 27
ATM SECURITY
USING GSM AND MEMS

4.3 Key Specifications

1. Resolution 8 Bits
2. Total Unadjusted Error ±1/2 LSB and ±1 LSB
3. Single Supply 5 VDC
4. Low Power 15 mW
5. Conversion Time 100 µs

Figure 4.1 Pin diagram:

S.R.T.I.S.T 28
ATM SECURITY
USING GSM AND MEMS

Fig 5.2 Molded chip carrier package

4.4 Types of ADC

 Digital-Ramp ADC
 Successive Approximation ADC
 Flash ADC

4.4.1 Digital-Ramp ADC:

Conversion from analog to digital form inherently involves comparator


action where the value of the analog voltage at some point in time is compared with
some standard. A common way to do that is to apply the analog voltage to one
terminal of a comparator and trigger a binary counter which drives a DAC. The output
of the DAC is applied to the other terminal of the comparator. Since the output of the
DAC is increasing with the counter, it will trigger the comparator at some point when
its voltage exceeds the analog input. The transition of the comparator stops the binary
counter, which at that point holds the digital value corresponding to the analog
voltage.

S.R.T.I.S.T 29
ATM SECURITY
USING GSM AND MEMS

Fig 4.3 Digital Ramp adc

4.4.2 Successive Approximation ADC:


The successive approximation ADC is much faster than the digital ramp ADC
because it uses digital logic to converge on the value closest to the input voltage. A
comparator and a DAC are used in the process. A flowchart explaining the working is
shown in the figure below.

Fig 4.4 Illustration of 4-bit SAC with 1 volt step size

S.R.T.I.S.T 30
ATM SECURITY
USING GSM AND MEMS

Fig 4.5 Flash ADC:

Illustrated is a 3-bit flash ADC with resolution 1 volt (after Tocci). The
resistor net and comparators provide an input to the combinational logic circuit, so the
conversion time is just the propagation delay through the network - it is not limited by
the clock rate or some convergence sequence. It is the fastest type of ADC available,
but requires a comparator for each value of output (63 for 6-bit, 255 for 8-bit, etc.)
Such ADCs are available in IC form up to 8-bit and 10-bit flash ADCs (1023
comparators) are planned. The encoder logic executes a truth table to convert the

S.R.T.I.S.T 31
ATM SECURITY
USING GSM AND MEMS

ladder of inputs to the binary number output.


4.5 Applications

AD converters are used virtually everywhere where an analog signal has to be


processed, stored, or transported in digital form. Fast video ADCs are used, for
example, in TV tuner cards. Slow on-chip 8, 10, 12, or 16 bit ADCs are common in
microcontrollers. Very fast ADCs are needed in digital oscilloscopes, and are crucial
for new applications like software defined radio and in music recording. ADC's
dynamic range is also important.

CHAPTER 5
GSM (Global System for Mobile communications)

5.1 Introduction

GSM (Global System for Mobile communications) is a cellular network,


which means that mobile phones connect to it by searching for cells in the immediate
vicinity. GSM networks operate in four different frequency ranges. Most GSM
networks operate in the 900 MHz or 1800 MHz bands. Some countries in the
Americas use the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz
frequency bands were already allocated.The rarer 400 and 450 MHz frequency bands
are assigned in some countries, where these frequencies were previously used for
first-generation systems.GSM-900 uses 890–915 MHz to send information from the
mobile station to the base station (uplink) and 935–960 MHz for the other direction
(downlink), providing 124 RF channels (channel numbers 1 to 124) spaced at 200
kHz. Duplex spacing of 45 MHz is used. In some countries the GSM-900 band has
been extended to cover a larger frequency range. This 'extended GSM', E-GSM, uses
880–915 MHz (uplink) and 925–960 MHz (downlink), adding 50 channels (channel
numbers 975 to 1023 and 0) to the original GSM-900 band. Time division
multiplexing is used to allow eight full-rate or sixteen half-rate speech channels per
radio frequency channel. There are eight radio timeslots (giving eight burst periods)
grouped into what is called a TDMA frame. Half rate channels use alternate frames in

S.R.T.I.S.T 32
ATM SECURITY
USING GSM AND MEMS

the same timeslot. The channel data rate is 270.833 kbit/s, and the frame duration is
4.615 ms.

5.2 GSM Advantages

GSM also pioneered a low-cost, to the network carrier, alternative to voice


calls, the Short t message service (SMS, also called "text messaging"), which is now
supported on other mobile standards as well. Another advantage is that the standard
includes one worldwide Emergency telephone number, 112. This makes it easier for
international travelers to connect to emergency services without knowing the local
emergency number.

5.3 The GSM Network

GSM provides recommendations, not requirements. The GSM specifications


define the functions and interface requirements in detail but do not address the
hardware. The GSM network is divided into three major systems: the switching
system (SS), the base station system (BSS), and the operation and support system
(OSS).

S.R.T.I.S.T 33
ATM SECURITY
USING GSM AND MEMS

Fig 5.1 GSM Network

5.3.1 The Switching System:

The switching system (SS) is responsible for performing call processing and
subscriber-related functions. The switching system includes the following functional
units.

 Home location register (HLR): The HLR is a database used for storage and
management of subscriptions. The HLR is considered the most important
database, as it stores permanent data about subscribers, including a
subscriber's service profile, location information, and activity status. When an

S.R.T.I.S.T 34
ATM SECURITY
USING GSM AND MEMS

individual buys a subscription from one of the PCS operators, he or she is


registered in the HLR of that operator.

 Mobile services switching center (MSC): The MSC performs the telephony
switching functions of the system. It controls calls to and from other telephone
and data systems. It also performs such functions as toll ticketing, network
interfacing, common channel signaling, and others.

 Visitor location register (VLR): The VLR is a database that contains


temporary information about subscribers that is needed by the MSC in order to
service visiting subscribers. The VLR is always integrated with the MSC.
When a mobile station roams into a new MSC area, the VLR connected to that
MSC will request data about the mobile station from the HLR. Later, if the
mobile station makes a call, the VLR will have the information needed for call
setup without having to interrogate the HLR each time.

 Authentication center (AUC): A unit called the AUC provides authentication


and encryption parameters that verify the user's identity and ensure the
confidentiality of each call. The AUC protects network operators from
different types of fraud found in today's cellular world.

 Equipment identity register (EIR): The EIR is a database that contains


information about the identity of mobile equipment that prevents calls from
stolen, unauthorized, or defective mobile stations. The AUC and EIR are
implemented as stand-alone nodes or as a combined AUC/EIR node.

5.3.2 The Base Station System (BSS):

All radio-related functions are performed in the BSS, which consists of base
station controllers (BSCs) and the base transceiver stations (BTSs).

 BSC: The BSC provides all the control functions and physical links between
the MSC and BTS. It is a high-capacity switch that provides functions such as
handover, cell configuration data, and control of radio frequency (RF) power
levels in base transceiver stations. A number of BSCs are served by an MSC.

S.R.T.I.S.T 35
ATM SECURITY
USING GSM AND MEMS

 BTS: The BTS handles the radio interface to the mobile station. The BTS is
the radio equipment (transceivers and antennas) needed to service each cell in
the network. A group of BTSs are controlled by a BSC.

5.3.3 The Operation and Support System

The operations and maintenance center (OMC) is connected to all equipment


in the switching system and to the BSC. The implementation of OMC is called the
operation and support system (OSS). The OSS is the functional entity from which the
network operator monitors and controls the system. The purpose of OSS is to offer the
customer cost-effective support for centralized, regional and local operational and
maintenance activities that are required for a GSM network. An important function of
OSS is to provide a network overview and support the maintenance activities of
different operation and maintenance organizations.

5.4 Additional Functional Elements

 Message center (MXE): The MXE is a node that provides integrated voice,
fax, and data messaging. Specifically, the MXE handles short message service,
cell broadcast, voice mail, fax mail, e-mail, and notification.

 Mobile service node (MSN): The MSN is the node that handles the mobile
intelligent network (IN) services.

 Gateway mobile services switching center (GMSC): A gateway is a node


used to interconnect two networks. The gateway is often implemented in an
MSC. The MSC is then referred to as the GMSC.

 GSM inter-working unit (GIWU): The GIWU consists of both hardware


and software that provides an interface to various networks for data
communications. Through the GIWU, users can alternate between speech and
data during the same call. The GIWU hardware equipment is physically
located at the MSC/VLR.

S.R.T.I.S.T 36
ATM SECURITY
USING GSM AND MEMS

5.5 GSM Network Areas

The GSM network is made up of geographic areas. As shown in bellow figure, these
areas include cells, location areas (LAs), MSC/VLR service areas, and public land
mobile network (PLMN) areas.

Fig 5.2 GSM Network Areas

5.5.1 Location Areas

The cell is the area given radio coverage by one base transceiver station. The GSM
network identifies each cell via the cell global identity (CGI) number assigned to each
cell. The location area is a group of cells. It is the area in which the subscriber is
paged. Each LA is served by one or more base station controllers, yet only by a single
MSC Each LA is assigned a location area identity (LAI) number.

5.5.2 MSC/VLR service areas

An MSC/VLR service area represents the part of the GSM network that is covered by
one MSC and which is reachable, as it is registered in the VLR of the MSC.

5.5.3 PLMN service areas

The PLMN service area is an area served by one network operator.

5.6 GSM Specifications

S.R.T.I.S.T 37
ATM SECURITY
USING GSM AND MEMS

Specifications for different personal communication services (PCS) systems vary


among the different PCS networks. Listed below is a description of the specifications
and characteristics for GSM.

 Frequency band: The frequency range specified for GSM is 1,850 to 1,990
MHz (mobile station to base station).

 Duplex distance: The duplex distance is 80 MHz. Duplex distance is the


distance between the uplink and downlink frequencies. A channel has two
frequencies, 80 MHz apart.

 Channel separation: The separation between adjacent carrier frequencies. In


GSM, this is 200 kHz.

 Modulation: Modulation is the process of sending a signal by changing the


characteristics of a carrier frequency. This is done in GSM via Gaussian
minimum shift keying (GMSK).

 Transmission rate: GSM is a digital system with an over-the-air bit rate of


270 kbps.

 Access method: GSM utilizes the time division multiple access (TDMA)
concept. TDMA is a technique in which several different calls may share the
same carrier. Each call is assigned a particular time slot.

 Speech coder: GSM uses linear predictive coding (LPC). The purpose of
LPC is to reduce the bit rate. The LPC provides parameters for a filter that
mimics the vocal tract. The signal passes through this filter, leaving behind a
residual signal. Speech is encoded at 13 kbps.

5.7 GSM Subscriber Services

Dual-tone multifrequency (DTMF): DTMF is a tone signaling scheme often used


for various control purposes via the telephone network, such as remote control of an
answering machine. GSM supports full-originating DTMF.

Facsimile group III—GSM supports CCITT Group 3 facsimile. As standard fax


machines are designed to be connected to a telephone using analog signals, a special
fax converter connected to the exchange is used in the GSM system. This enables a
GSM–connected fax to communicate with any analog fax in the network.

S.R.T.I.S.T 38
ATM SECURITY
USING GSM AND MEMS

Short message services: A convenient facility of the GSM network is the short
message service. A message consisting of a maximum of 160 alphanumeric characters
can be sent to or from a mobile station. This service can be viewed as an advanced
form of alphanumeric paging with a number of advantages. If the subscriber's mobile
unit is powered off or has left the coverage area, the message is stored and offered
back to the subscriber when the mobile is powered on or has reentered the coverage
area of the network. This function ensures that the message will be received.

Cell broadcast: A variation of the short message service is the cell broadcast facility.
A message of a maximum of 93 characters can be broadcast to all mobile subscribers
in a certain geographic area. Typical applications include traffic congestion warnings
and reports on accidents.

Voice mail: This service is actually an answering machine within the network, which
is controlled by the subscriber. Calls can be forwarded to the subscriber's voice-mail
box and the subscriber checks for messages via a personal security code.

Fax mail: With this service, the subscriber can receive fax messages at any fax
machine. The messages are stored in a service center from which they can be
retrieved by the subscriber via a personal security code to the desired fax number

Supplementary Services:

Call forwarding: This service gives the subscriber the ability to forward incoming
calls to another number if the called mobile unit is not reachable, if it is busy, if there
is no reply, or if call forwarding is allowed unconditionally.

Barring of outgoing calls: This service makes it possible for a mobile subscriber to
prevent all outgoing calls.

Barring of incoming calls: This function allows the subscriber to prevent incoming
calls. The following two conditions for incoming call barring exist: baring of all
incoming calls and barring of incoming calls when roaming outside the home PLMN.

Advice of charge (AoC): The AoC service provides the mobile subscriber with an
estimate of the call charges. There are two types of AoC information: one that

S.R.T.I.S.T 39
ATM SECURITY
USING GSM AND MEMS

provides the subscriber with an estimate of the bill and one that can be used for
immediate charging purposes. AoC for data calls is provided on the basis of time
measurements.

Call hold: This service enables the subscriber to interrupt an ongoing call and then
subsequently reestablish the call. The call hold service is only applicable to normal
telephony.

Call waiting: This service enables the mobile subscriber to be notified of an


incoming call during a conversation. The subscriber can answer, reject, or ignore the
incoming call. Call waiting is applicable to all GSM telecommunications services
using a circuit-switched connection.

Multiparty service: The multiparty service enables a mobile subscriber to establish a


multiparty conversation—that is, a simultaneous conversation between three and six
subscribers. This service is only applicable to normal telephony.

Calling line identification presentation/restriction: These services supply the


called party with the integrated services digital network (ISDN) number of the calling
party. The restriction service enables the calling party to restrict the presentation. The
restriction overrides the presentation.

Closed user groups (CUGs): CUGs are generally comparable to a PBX. They are a
group of subscribers who are capable of only calling themselves and certain numbers

S.R.T.I.S.T 40
ATM SECURITY
USING GSM AND MEMS

CHAPTER 6
MAX 232
6.1 INTRODUCTION

To allow compatibility among data communication equipment made by


various manufacturers, an interfacing standard called RS232 was set by the
Electronics Industries Association (EIA) in 1960. In 1963 it was modified and called
RS232A. RS232B AND RS232C were issued in 1965 and 1969, respectively. Today,
RS232 is the most widely used serial I/O interfacing standard. This standard is used
in PCs and numerous types of equipment. However, since the standard was set long
before the advert of the TTL logic family, its input and output voltage levels are not
TTL compatible. In RS232, a 1 is represented by -3 to -25V, while a 0 bit is +3 to
+25V, making -3 to +3 undefined. For this reason, to connect any RS232 to a
microcontroller system we must use voltage converters such as MAX232 to convert
the TTL logic levels to the RS232 voltage levels, and vice versa. MAX232 IC chips
are commonly referred to as line drivers.

6.2 SERIAL COMMUNICATION

Computers can transfer data in two ways: parallel and serial. In parallel data
transfers, often 8 or more lines (wire conductors) are used to transfer data to a device
that is only a few feet away. Examples of parallel data transfer are printers and hard
disks; each uses cables with many wire strips. Although in such cases a lot of data
can be transferred in a short amount of time by using many wires in parallel, the
distance cannot be great. To transfer to a device located many meters away, the serial
method is used. In serial communication, the data is sent one bit at a time, in contrast
to parallel communication, in which the data is sent a byte or more at a time. Serial
communication of the 8051 is the topic of this chapter.

S.R.T.I.S.T 41
ATM SECURITY
USING GSM AND MEMS

The 8051 has serial communication capability built into it, there by making
possible fast data transfer using only a few wires.

If data is to be transferred on the telephone line, it must be converted from


0s and 1s to audio tones, which are sinusoidal-shaped signals. A peripheral device
called a modem, which stands for “modulator/demodulator”, performs this
conversion.

Serial data communication uses two methods, asynchronous and


synchronous. The synchronous method transfers a block of data at a time, while the
asynchronous method transfers a single byte at a time.

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


duplex transmission. This is in contrast to simplex transmissions such as with
printers, in which the computer only sends data. Duplex transmissions can be half or
full duplex, depending on whether or not the data transfer can be simultaneous. If
data is transmitted one way at a time, it is referred to as half duplex. If the data can go
both ways at the same time, it is full duplex. Of course, full duplex requires two wire
conductors for the data lines, one for transmission and one for reception, in order to
transfer and receive data simultaneously.

6.2.1 Asynchronous serial communication and data framing

The data coming in at the receiving end of the data line in a serial data
transfer is all 0s and 1s; it is difficult to make sense of the data unless the sender and
receiver agree on a set of rules, a protocol, on how the data is packed, how many bits
constitute a character, and when the data begins and endsbits. This is called framing.
In the data framing for asynchronous communications, the data, such as ASCII
characters, are packed between a start bit and a stop bit.

S.R.T.I.S.T 42
ATM SECURITY
USING GSM AND MEMS

6.2.2 Start and stop bits


Asynchronous serial data communication is widely used for character-
oriented transmissions, while block-oriented data transfers use the synchronous
method. In the asynchronous method, each character is placed between start and stop
The start bit is always one bit, but the stop bit can be one or two bits. The start bit is
always a 0 (low) and the stop bit (s) is 1 (high)

6.2.3 Data transfer rate


The rate of data transfer in serial data communication is stated in bps (bits
per second). Another widely used terminology for bps is baud rate. However, the
baud and bps rates are not necessarily equal. This is due to the fact that baud rate is
the modem terminology and is defined as the number of signal changes per second.
In modems a single change of signal, sometimes transfers several bits of data. As far
as the conductor wire is concerned, the baud rate and bps are the same, and for this
reason we use the bps and baud interchangeably.
The data transfer rate of given computer system depends on communication
ports incorporated into that system. For example, the early IBMPC/XT could transfer
data at the rate of 100 to 9600 bps. In recent years, however, Pentium based PCS
transfer data at rates as high as 56K bps. It must be noted that in asynchronous serial
data communication, the baud rate is generally limited to 100,000bps.

6.3 RS232 PINS


RS232 cable is commonly referred to as the DB-25 connector. In labeling,
DB-25P refers to the plug connector (male) and DB-25S is for the socket connector
(female). Since not all the pins are used in PC cables, IBM introduced the DB-9
Version of the serial I/O standard, which uses 9 pins only, as shown in table.

S.R.T.I.S.T 43
ATM SECURITY
USING GSM AND MEMS

6.3.1 DB-9 pin connector

12345
6789

Pin Description
1 Data carrier detect (DCD)
2 Received data (RXD)
3 Transmitted data (TXD)
4 Data terminal ready(DTR)
5 Signal ground (GND)
6 Data set ready (DSR)
7 Request to send (RTS)
8 Clear to send (CTS)
9 Ring indicator (RI)

Table 6.1: Pin Functions of DB-9 Pin Connector

(Note: DCD, DSR, RTS and CTS are active low pins.)
The method used by RS-232 for communication allows for a simple
connection of three lines: Tx, Rx, and Ground.

The three essential signals for 2-way RS-232 Communications are these:

TXD: carries data from DTE to the DCE.


RXD: carries data from DCE to the DTE.
SG: signal ground

S.R.T.I.S.T 44
ATM SECURITY
USING GSM AND MEMS

The RS232 standard is not TTL compatible; therefore, it requires a line


driver such as the MAX232 chip to convert RS232 voltage levels to TTL levels, and
vice versa. The interfacing of 8051 with RS232 connectors via the MAX232 chip is
the main topic.

The 8051 has two pins that are used specifically for transferring and receiving
data serially. These two pins are called TXD and RXD and a part of the port 3 group
(P3.0 and P3.1). Pin 11 of the 8051 is assigned to TXD and pin 10 is designated as
RXD. These pins are TTL compatible; therefore, they require a line driver to make
them RS232 compatible. One such line driver is the MAX232 chip.

MAX232 converts from RS232 voltage levels to TTL voltage levels, and
vice versa. One advantage of the MAX232 chip is that it uses a +5V power source
which, is the same as the source voltage for the 8051. In the other words, with a
single +5V power supply we can power both the 8051 and MAX232, with no need for
the power supplies that are common in many older systems. The MAX232 has two
sets of line drivers for transferring and receiving data. The line drivers used for TXD
are called T1 and T2, while the line drivers for RXD are designated as R1 and R2. In
many applications only one of each is used.

6.3.2 8051 connection to RS232

Fig.6.1: Connection of Microcontroller with Serial Port Using MAX 232

S.R.T.I.S.T 45
ATM SECURITY
USING GSM AND MEMS

The RS232 standard is not TTL compatible; therefore, it requires a Line


Driver such as the MAX232 chip to convert RS232 voltage levels to TTL levels, and
vice versa.

The 8051 has two pins that are used specifically for transferring and receiving
data serially. These two pins are TXD and RXD and are a part of the port 3 (P3.0 and
P3.1). Pin 11 of the 8051 is designated as TXD and pin 10 as RXD. These pins are
TTL compatible; therefore, they require a line driver to make them RS232 compatible.
One such line driver is the MAX232 chip.

MAX232 converts from RS232 voltage levels to TTL voltage levels, and vice
versa. One advantage of the MAX232 chip is that it uses a +5V power source which,
is the same as the source voltage for the 8051. In the other words, with a single +5V
power supply we can power both the 8051 and MAX232, with no need for the power
supplies. The MAX232 has two sets of line drivers for transferring and receiving data.
The line drivers used for TXD are called T1 and T2, while the line drivers for RXD
are designated as R1 and R2. In many applications only one of each is used.

6.4 MAX 232 SERIAL LINEDRIVER

The pin-out diagram of MAX 232 is shown below.

Fig.6.2: MAX 232E Dual Driver/Receiver

S.R.T.I.S.T 46
ATM SECURITY
USING GSM AND MEMS

6.4.1 MAX 232 Operating Circuit

Fig.6.3: MAX 232 Operating Circuit

S.R.T.I.S.T 47
ATM SECURITY
USING GSM AND MEMS

Table 6.2: Function Tables of MAX 232

Pin 10, 11 form the dual inputs with TTL logic whereas 14, 7 form the outputs
for RS 232 logic. And the 12, 9, 13, 8 form the vice versa inputs and outputs as shown
in fig.
The inputs and outputs of the drivers and receivers are shown in fig above.

CHAPTER 7
LIQUID CRYSTAL DISPLAY

7.1 INTRODUCTION

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

S.R.T.I.S.T 48
ATM SECURITY
USING GSM AND MEMS

When the LCD is in the off state, light rays are rotated by the two polarisers
and the liquid crystal, such that the light rays come out of the LCD without any
orientation, and hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal
molecules would be aligned in a specific direction. The light rays passing through the
LCD would be rotated by the polarizers, which would result in activating /
highlighting the desired characters.
The LCD’s are lightweight with only a few millimeters thickness. Since the
LCD’s consume less power, they are compatible with low power electronic circuits,
and can be powered for long durations.
The LCD s doesn’t generate light and so light is needed to read the display. By
using backlighting, reading is possible in the dark. The LCD’s have long life and a
wide operating temperature range.
Changing the display size or the layout size is relatively simple which makes
the LCD’s more customer friendly.

The LCDs used exclusively in watches, calculators and measuring instruments


are the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics. The
LCDs have even started replacing the cathode ray tubes (CRTs) used for the display
of text and graphics, and also in small TV applications.

This section describes the operation modes of LCD’s then describe how to
program and interface an LCD to 8051 using Assembly and C.

7.2 LCD OPERATION

In recent years the LCD is finding widespread use replacing LED s (seven-
segment LED s or other multi-segment LED s).This is due to the following reasons:
1. The declining prices of LCDs.

S.R.T.I.S.T 49
ATM SECURITY
USING GSM AND MEMS

2. The ability to display numbers, characters and graphics. This is in contrast to


LED which is limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by relieving the
CPU of the task of refreshing the LCD. In the case of LED s, they must be
refreshed by the CPU to keep on displaying the data.
4. Ease of programming for characters and graphics.

S.R.T.I.S.T 50
ATM SECURITY
USING GSM AND MEMS

7.3 LCD PIN DESCRIPTION

The LCD discussed in this section has 14 pins. The function of each pin is
given in table.

Fig.7.1: Connection of LCD with Microcontroller

The LCD can display a character successfully by placing the


1. Data in Data Register
2. Command in Command Register of LCD
1. Data corresponds to the ASCII value of the character to be printed. This can
be done by placing the ASCII value on the LCD Data lines and selecting the
Data Register of the LCD by selecting the RS (Register Select) pin.
2. Each and every display location is accessed and controlled by placing
respective command on the data lines and selecting the Command Register of
LCD by selecting the (Register Select) RS pin.

S.R.T.I.S.T 51
ATM SECURITY
USING GSM AND MEMS

Pin symbol I/O Description


1 Vss -- Ground
2 Vcc -- +5V power supply
3 VEE -- Power supply to control
contrast
4 RS I RS=0 to select command
register
RS=1 to select data register
5 R/W I R/W=0 for write
R/W=1 for read
6 E I/O Enable
7 DB0 I/O The 8-bit data bus
8 DB1 I/O The 8-bit data bus
9 DB2 I/O The 8-bit data bus
10 DB3 I/O The 8-bit data bus
11 DB4 I/O The 8-bit data bus
12 DB5 I/O The 8-bit data bus
13 DB6 I/O The 8-bit data bus
14 DB7 I/O The 8-bit data bus

Table 7.1: Pin Description for LCD

S.R.T.I.S.T 52
ATM SECURITY
USING GSM AND MEMS

Code (hex) Command to LCD Instruction Register


1 Clear display screen
2 Return home
4 Decrement cursor
6 Increment cursor
5 Shift display right
7 Shift display left
8 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on, cursor on
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right
18 Shift the entire display to the left
1C Shift the entire display to the right
80 Force cursor to beginning of 1st line
C0 Force cursor to beginning of 2nd line
38 2 lines and 5x7 matrix

Table 7.2: LCD Command Codes

7.4 Uses
The LCDs used exclusively in watches, calculators and measuring instruments
are the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics.
So in this project, the LCD is used to display the instantaneous information. The
information may be prompting or alerting or instructing the user.

S.R.T.I.S.T 53
ATM SECURITY
USING GSM AND MEMS

CHAPTER 8
RELAYS
8.1 Introduction

A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet to
open or close one or many sets of contacts. A relay is able to control an output circuit
of higher power than the input circuit, it can be considered to be, in a broad sense, a
form of an electrical amplifier.

Fig 8.1 Relay

Relays are usuallly SPDT (single pole double through switch)or DPDT (double
pole double through switch) but they can have many more sets of switch contacts, for
example relays with 4 sets of changeover contacts are readily available.

S.R.T.I.S.T 54
ATM SECURITY
USING GSM AND MEMS

8.2 Basic operation of a relay


An electric current through a conductor will produce a magnetic field at right
angles to the direction of electron flow. If that conductor is wrapped into a coil shape,
the magnetic field produced will be oriented along the length of the coil. The greater
the current, the greater the strength of the magnetic field, all other factors being equal.

Fig 8.2 Relay circuit

Inductors react against changes in current because of the energy stored in this
magnetic field. When we construct a transformer from two inductor coils around a
common iron core, we use this field to transfer energy from one coil to the other.
However, there are simpler and more direct uses for electromagnetic fields than the
applications we've seen with inductors and transformers. The magnetic field produced
by a coil of current-carrying wire can be used to exert a mechanical force on any
magnetic object, just as we can use a permanent magnet to attract magnetic objects,
except that this magnet (formed by the coil) can be turned on or off by switching the
current on or off through the coil.

S.R.T.I.S.T 55
ATM SECURITY
USING GSM AND MEMS

If we place a magnetic object near such a coil for the purpose of making that object
move when we energize the coil with electric current, we have what is called a
solenoid. The movable magnetic object is called an armature, and most armatures can
be moved with either direct current (DC) or alternating current (AC) energizing the
coil. The polarity of the magnetic field is irrelevant for the purpose of attracting an
iron armature. Solenoids can be used to electrically open door latches, open or shut
valves, move robotic limbs, and even actuate electric switch mechanisms and is used
to actuate a set of switch contacts

8.3 Relays can be categorized according to the magnetic system and


operation

8.3.1 Neutral Relays

This is the most elementary type of relay. The neutral relays have a magnetic
coil, which operates the relay at a specified current, regardless of the polarity of the
voltage applied.

8.3.2 Biased Relays

Biased relays have a permanent magnet above the armature. The relay
operates if the current through the coil winding establishes a magneto-motive force
that opposes the flux by the permanent magnet. If the fluxes are in the same direction,
the relay will not operate, even for a greater current through the coil.

8.3.3 Polarized Relays

Like the biased relays, the polarized relays operate only when the current
through the coil in one direction. But there the principle is different. The relay coil has
a diode connected in series with it. This blocks the current in the reverse direction.The
major difference between biased relays and polarized relays is that the former allows
the current to pass through in the reverse direction, but does the not operate the relay
and the later blocks the current in reverse direction.  You can imagine how critical
these properties when relays are connected in series to form logic circuits.

S.R.T.I.S.T 56
ATM SECURITY
USING GSM AND MEMS

8.3.4 Magnetic Stick Relays or Perm polarized Relays

These relays have a magnetic circuit with high permanence.  Two coils, one to
operate (pick up) and one to release (drop) are present.  The relay is activated by a
current in the operate coil. On the interruption of the current the armature remains in
picked up position by the residual magnetism. The relay is released by a current
through the release coil.

8.3.5 Slow Release Relays

These relays have a capacitor connected in parallel to their coil. When the
operating current is interrupted the release of relay is delayed by the stored charge in
the capacitor. The relay releases as the capacitor discharges through the coil.

8.3.6 Relays for AC

These are neutral relays and picked up for a.c. current through their coil. These
are very fast in action and used on power circuits of the point motors, where high
current flows through the contacts. A normal relay would be slow and make sparks
which in turn may weld the contacts together.All relays have two operating values
(voltages), one pick-up and the other other drop away. The pick-up value is higher
than the drop away value.

8.4 Applications

 To control a high-voltage circuit with a low-voltage signal, as in some types of


modems or audio amplifiers,
 To control a high-current circuit with a low-current signal, as in the starter
solenoid of an automobile,
 To detect and isolate faults on transmission and distribution lines by opening
and closing circuit breakers (protection relays),
 To isolate the controlling circuit from the controlled circuit when the two are
at different potentials, for example when controlling a mains-powered device
from a low-voltage switch. They may also be controlled by room occupancy
detectors in an effort to conserve energy,

S.R.T.I.S.T 57
ATM SECURITY
USING GSM AND MEMS

 To perform logic functions. For example, the boolean AND function is


realised by connecting NO relay contacts in series, the OR function by
connecting NO contacts in parallel. The change-over or Form C contacts
perform the XOR (exclusive or) function. Similar functions for NAND and
NOR are accomplished using NC contacts. The Ladder programming language
is often used for designing relay logic networks.
o Early computing. Before vacuum tubes and transistors, relays were
used as logical elements in digital computers. See ARRA (computer),
Harvard Mark II, Zuse Z2, and Zuse Z3.
o Safety-critical logic. Because relays are much more resistant than
semiconductors to nuclear radiation, they are widely used in safety-
critical logic, such as the control panels of radioactive waste-handling
machinery.
 To perform time delay functions. Relays can be modified to delay opening or
delay closing a set of contacts. A very short (a fraction of a second) delay
would use a copper disk between the armature and moving blade assembly.
Current flowing in the disk maintains magnetic field for a short time,
lengthening release time. For a slightly longer (up to a minute) delay, a
dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape
slowly. The time period can be varied by increasing or decreasing the flow
rate. For longer time periods, a mechanical clockwork timer is installed

S.R.T.I.S.T 58
ATM SECURITY
USING GSM AND MEMS

CHAPTER 9
REGULATED POWER SUPPLY

9.1 INTRODUCTION

The power supplies are designed to convert high voltage AC mains electricity
to a suitable low voltage supply for electronics circuits and other devices. A RPS
(Regulated Power Supply) is the Power Supply with Rectification, Filtering and
Regulation being done on the AC mains to get a Regulated power supply for
Microcontroller and for the other devices being interfaced to it.

A power supply can by broken down into a series of blocks, each of which
performs a particular function. A d.c power supply which maintains the output voltage
constant irrespective of a.c mains fluctuations or load variations is known as
“Regulated D.C Power Supply”

For example a 5V regulated power supply system as shown below:

Fig.11.1: Block Diagram of the Power Supply

S.R.T.I.S.T 59
ATM SECURITY
USING GSM AND MEMS

9.2 TRANSFORMER
A transformer is an electrical device which is used to convert electrical power
from one Electrical circuit to another without change in frequency. Transformers
convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity
is AC. Step-up transformers increase in output voltage, step-down transformers
decrease in output voltage. Most power supplies use a step-down transformer to
reduce the dangerously high mains voltage to a safer low voltage. The input coil is
called the primary and the output coil is called the secondary. There is no electrical
connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of
the circuit symbol represent the core. Transformers waste very little power so the
power out is (almost) equal to the power in. Note that as voltage is stepped down
current is stepped up. The ratio of the number of turns on each coil, called the turn’s
ratio, determines the ratio of the voltages. A step-down transformer has a large
number of turns on its primary (input) coil which is connected to the high voltage
mains supply, and a small number of turns on its secondary (output) coil to give a low
output voltage.

Fig.11.2: An Electrical Transformer


Turns ratio = Vp/ VS = Np/NS
Power Out= Power In
VS x IS=VP x IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip  = primary (input) current    

S.R.T.I.S.T 60
ATM SECURITY
USING GSM AND MEMS

9.3 RECTIFIER

A circuit which is used to convert a.c to dc is known as RECTIFIER. The


process of conversion a.c to d.c is called “rectification”.

9.3.1 Types of Rectifiers


1. Half wave Rectifier
2. Full wave Rectifier
1. Centre tap full wave rectifier.
2. Bridge type full bridge rectifier.
9.3.2 Comparison of rectifier circuits
Type of Rectifier
Parameter Half wave Full wave Bridge
Number of diodes 1 2 4
PIV of diodes Vm 2Vm Vm
D.C output voltage Vm/ 2Vm/ 2Vm/
Vdc,at no-load 0.318Vm 0.636Vm 0.636Vm
Ripple factor 1.21 0.482 0.482
Ripple frequency f 2f 2f
Rectification 0.406 0.812 0.812
efficiency
Transformer
Utilization 0.287 0.693 0.812
Factor(TUF)
RMS voltage Vrms Vm/2 Vm/√2 Vm/√2

Table 9.1: Comparison of Rectifier Circuits

9.3.3 Full-wave Rectifier


From the above comparison we came to know that full wave bridge rectifier
as more advantages than the other two rectifiers. So, in our project we are using full
wave bridge rectifier circuit.

S.R.T.I.S.T 61
ATM SECURITY
USING GSM AND MEMS

9.3.4 Bridge Rectifier

A bridge rectifier makes use of four diodes in a bridge arrangement to


achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the diode
bridge is wired internally.

A bridge rectifier makes use of four diodes in a bridge arrangement as


shown in fig (a) to achieve full-wave rectification. This is a widely used
configuration, both with individual diodes wired as shown and with single component
bridges where the diode bridge is wired internally.

Fig.9.3: Circuit diagram of Bridge Rectifier


9.3.5 Operation
During positive half cycle of secondary, the diodes D2 and D3 are in
forward biased while D1 and D4 are in reverse biased as shown in the fig(b). The
current flow direction is shown in the fig (b) with dotted arrows.

Fig.11.4. (a): Operation Circuit of Bridge Rectifier

S.R.T.I.S.T 62
ATM SECURITY
USING GSM AND MEMS

During negative half cycle of secondary voltage, the diodes D1 and D4 are in
forward biased while D2 and D3 are in reverse biased as shown in the fig(c). The
current flow direction is shown in the fig (c) with dotted arrows.

Fig.9.4. (b): Operation Circuit of Bridger Rectifier


9.4 FILTER
A Filter is a device which removes the a.c component of rectifier output but
allows the d.c component to reach the load

9.4.1 Capacitor Filter


We have seen that the ripple content in the rectified output of half wave
rectifier is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48%
such high percentages of ripples is not acceptable for most of the applications.
Ripples can be removed by one of the following methods of filtering.
(a) A capacitor, in parallel to the load, provides an easier by –pass for the
ripples voltage though it due to low impedance. At ripple frequency and
leave the D.C. to appear at the load.
(b) An inductor, in series with the load, prevents the passage of the ripple
current (due to high impedance at ripple frequency) while allowing the d.c
(due to low resistance to d.c)
(c) Various combinations of capacitor and inductor, such as L-section filter
section filter, multiple section filter etc. which make use of both the
properties mentioned in (a) and (b) above. Two cases of capacitor filter, one
applied on half wave rectifier and another with full wave rectifier.

S.R.T.I.S.T 63
ATM SECURITY
USING GSM AND MEMS

Filtering is performed by a large value electrolytic capacitor connected across


the DC supply to act as a reservoir, supplying current to the output when the varying
DC voltage from the rectifier is falling. The capacitor charges quickly near the peak
of the varying DC, and then discharges as it supplies current to the output. Filtering
significantly increases the average DC voltage to almost the peak value (1.4 × RMS
value).
To calculate the value of capacitor(C),
C = ¼*√3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 800µF hence large value of capacitor is
placed to reduce ripples and to improve the DC component.
9.5 REGULATOR
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or
variable output voltages. The maximum current they can pass also rates them.
Negative voltage regulators are available, mainly for use in dual supplies.
Most regulators include some automatic protection from excessive current
('overload protection') and overheating ('thermal protection'). Many of the fixed
voltage regulators ICs have 3 leads and look like power transistors, such as the 7805
+5V 1A regulator shown on the right. The LM7805 is simple to use. You simply
connect the positive lead of your unregulated DC power supply (anything from 9VDC
to 24VDC) to the Input pin, connect the negative lead to the Common pin and then
when you turn on the power, you get a 5 volt supply from the output pin.

Fig. 11.5: A Three Terminal Voltage Regulator

S.R.T.I.S.T 64
ATM SECURITY
USING GSM AND MEMS

CHAPTER 10
CIRCUIT DESCRIPTION

10.1 INTRODUCTION

ATM security system using GSM Modules is one of the hot topics in
embedded systems industry. For providing Security at ATMs GSM Modules are
controlled by using ATMEL Processor based AT89S52 Microcontroller.
Probably the most useful thing to know about the global system for mobile
communication is that it is an international standard. If you travel in parts of world,
GSM is only type of cellular service available. Instead of analog services, GSM was
developed as a digital system using TDMA technology.
In this project ATMEL based AT89S52 Microcontroller monitors GSM
Module . Whenever the user inserts his ATM card into ATM machine, a message will
be sent to the user mobile providing the details like time of card insertion, date, name
of the user and place where the card has been inserted. This database will be
maintained both in the bank and at the ATM center.
The microcontroller in the ATM machine asks for the confirmation from the user
mobile. This user mobile can be changed whenever the user wishes to. As the details
are received by the user in his mobile, he has to send the confirmation message to the
modem. Thus, the microcontroller receives this message as the confirmation and
allows the person to proceed with the further transactions.

S.R.T.I.S.T 65
ATM SECURITY
USING GSM AND MEMS

10.2 SCHEMATIC DIAGRAM OF THE PROJECT

Fig.10.1: Schematic Diagram of the Project

S.R.T.I.S.T 66
ATM SECURITY
USING GSM AND MEMS

10.3 SCHEMATIC DESCRIPTION

Firstly, the required operating voltage for Microcontroller 89S52 is 5V. Hence
the 5V D.C. power supply is needed by the same. This regulated 5V is generated by
first stepping down the 230V to 9V by the step down transformer.
The step downed a.c. voltage is being rectified by the Bridge Rectifier. The
diodes used are 1N4007. The rectified a.c voltage is now filtered using a ‘C’ filter.
Now the rectified, filtered D.C. voltage is fed to the Voltage Regulator. This voltage
regulator allows us to have a Regulated Voltage which is +5V.The rectified; filtered
and regulated voltage is again filtered for ripples using an electrolytic capacitor
100μF. Now the output from this section is fed to 40 th pin of 89S52 microcontroller to
supply operating voltage.
The microcontroller 89S52 with Pull up resistors at Port0 and crystal oscillator
of 11.0592 MHz crystal in conjunction with couple of capacitors of is placed at 18 th
& 19th pins of 89S52 to make it work (execute) properly.
The LCD is interfaced to Microcontroller. The data pins and control pins of
LCD are connected to Port 0 as shown in schematic. The GSM is interfaced to
microcontroller through a voltage level converter i.e. MAX 232.
The GSM o/p & i/p pins i.e. RX and TX are connected to MAX 232 serial
drivers 7th and 13th pins and its output to Microcontroller from 11 th & 12th of MAX to
TX and RX pins of Microcontroller.
A Motor is connected across port 2 at 24th pin.
And the main functional input block MEMS is interfaced at port 1,at p1.0 to
p1.7 with 18th to 11th pins of ADC 0804 and in turn this ADC 0804 is connected with
mems at 2nd 3rd and 5th pins.

S.R.T.I.S.T 67
ATM SECURITY
USING GSM AND MEMS

10.4 HARDWARE COMPONENTS


The Hardware components used in this project are
 Regulated Power Supply
 Microcontroller
 GSM
 MAX 232
 LCD
 Relay
10.5 SOFTWARE COMPONENTS
10.5.1 About Software
Software used is:
*Keil software for C programming
*Express PCB for lay out design
*Express SCH for schematic design

10.5.2 KEIL µVision3

What's New in µVision3?

µVision3 adds many new features to the Editor like Text Templates, Quick
Function Navigation, and Syntax Coloring with brace high lighting Configuration
Wizard for dialog based startup and debugger setup. µVision3 is fully compatible to
µVision2 and can be used in parallel with µVision2.

What is µVision3?

µVision3 is an IDE (Integrated Development Environment) that helps you


write, compile, and debug embedded programs. It encapsulates the following
components:
 A project manager.
 A make facility.
 Tool configuration.
 Editor.
 A powerful debugger.

10.5.3 Express PCB

S.R.T.I.S.T 68
ATM SECURITY
USING GSM AND MEMS

Express PCB is a Circuit Design Software and PCB manufacturing service.


One can learn almost everything you need to know about Express PCB from the help
topics included with the programs given.
Details: Express PCB, Version 5.6.0
10.5.4 Express SCH
The Express SCH schematic design program is very easy to use. This software
enables the user to draw the Schematics with drag and drop options.
A Quick Start Guide is provided by which the user can learn how to use it.
Details:
Express SCH, Version 5.6.0
10.6 EMBEDDED C
The programming Language used here in this project is an Embedded C
Language. This Embedded C Language is different from the generic C language in
few things like
a) Data types
b) Access over the architecture addresses.
The Embedded C Programming Language forms the user friendly language
with access over Port addresses, SFR Register addresses etc.
Embedded C Data types:
Data Types Size in Bits Data Range/Usage

unsigned char 8-bit 0-255


signed char 8-bit -128 to +127
unsigned int 16-bit 0 to 65535
signed int 16-bit -32,768 to +32,767
sbit 1-bit SFR bit addressable only

Bit 1-bit RAM bit addressable only

sfr 8-bit RAM addresses 80-FFH only

12.6.1 8051 project development cycle

S.R.T.I.S.T 69
ATM SECURITY
USING GSM AND MEMS

1. Create source files in C or assembly.


2. Compile or assemble source files.
3. Correct errors in source files.
4. Link object files from compiler and assembler.
5. Test linked application.

The steps to develop 8051 project using keil are

1. Click on the Keil uVision Icon on Desktop

2. Click on the Project menu from the title bar

3. Then Click on New Project

4. Save the Project by typing suitable project name with no extension in u r


own folder sited in either C:\ or D:\
5. Then Click on save button above.

6. Select the component for u r project. i.e. Atmel……

7. Click on the + Symbol beside of Atmel

8. Select AT89C51 as shown below

9. Then Click on “OK”

10. Then Click either YES or NO………mostly “NO”

11. Now your project is ready to USE

12. Now double click on the Target1, you would get another option “Source
group 1” as shown in next page.
13. Click on the file option from menu bar and select “new”

14. The next screen will be as shown in next page, and just maximize it by
double clicking on its blue boarder.
15. Now start writing program in either in “C” or “ASM”

16. For a program written in Assembly, then save it with extension “. asm”
and for “C” based program save it with extension “ C”

S.R.T.I.S.T 70
ATM SECURITY
USING GSM AND MEMS

17. Now right click on Source group 1 and click on “Add files to Group
Source”
18. Now you will get another window, on which by default “C” files will
appear.
19. Now select as per your file extension given while saving the file

20. Click only one time on option “ADD”

21. Now Press function key F7 to compile. Any error will appear if so happen.

22. If the file contains no error, then press Control+F5 simultaneously.

23. Then Click “OK”.

24. Now Click on the Peripherals from menu bar, and check your required port
as shown in fig below.
25. Drag the port a side and click in the program file.

26. Now keep Pressing function key “F11” slowly and observe.

27. You are running your program successfully

S.R.T.I.S.T 71
ATM SECURITY
USING GSM AND MEMS

10.7 SOURCE CODE


============================================================

//<<<<<<<<<<ATM Security System Using GSM MODULE>>>>>>>>>>//

============================================================

#include<reg51.h>
#include<string.h>

#include"UART.h"

#include"eeprom.h"

#include "lcddisplay.H"

sbit buz = P2^7;

sbit sw = P3^7;

unsigned char msg[10];


unsigned char mobilenum[]="9676899420";
unsigned charnumcnt,b11,XX,newmsg=0,a=0;

void readmsg(); //to read the message from gsm modem

unsigned int i;

void serintr(void) interrupt 4


{
if(RI==1)
{
XX=SBUF;
if(XX=='+')
newmsg=1;
RI=0;

void main()
{

lcd_init();

S.R.T.I.S.T 72
ATM SECURITY
USING GSM AND MEMS

lcd_init();
msgdisplay("welcome");
UART_init();
delay(1000);
lcdcmd(1);
msgdisplay("CHECKING GSM");

EA=1;//global interuupt enable

send_to_modem("ate0"); //to avoid echo signals,


enter();
again: send_to_modem("at"); // TO CHECKING GSM MODEM...
enter();

if(RI==0) // to checking wether the


GSM modem connected to system or
goto again;
ES=1; //enable serial interuupt

newmsg=0;
xxx: delay(20);
send_to_modem("AT+CPIN?"); // sim checking
enter();
delay(500);
if(newmsg==0)
goto xxx;
lcdcmd(0XC0);//move the cursor to second line of lcd
msgdisplay("MODEM CONNECTED");

send_to_modem("AT+CREG=0"); //
enter();

buz=0; //buzzer on
send_to_modem("at+cmgf=1"); //to set message format as
text
enter();
send_to_modem("at+cmgd=1"); //delecte the message1
enter();
send_to_modem("at+cmgd=2");
enter();
send_to_modem("at+cmgd=3");
enter();
delay(500);
buz=1; //buzzer off

start:
while(1)
{
lcdcmd(0x01);
msgdisplay("ATM SECURITY ");
lcdcmd(0xC0);
msgdisplay("SYSTEM");

back:
delay(100);
a=read_eeprom(1);

S.R.T.I.S.T 73
ATM SECURITY
USING GSM AND MEMS

if(a==0xff)
goto back;

if(a=='A')
{
lcdcmd(0X01);
msgdisplay("CARD DETECTED");

send_to_modem("at+cmgs=");
ch_send_to_modem('"');
send_to_modem(mobilenum);
ch_send_to_modem('"');
enter();
delay(50);
send_to_modem("SEND COMFIRMATION PASSWORS TO ACCESS YOUR ATM CARD");
ch_send_to_modem(0x1a);//control z

delay(500);
lcdcmd(0Xc0);
msgdisplay("SEND PASSWORD");
buz=0;
newmsg=0;
while(newmsg==0); //wait till message is delivered succesfully
buz=1;

delay(1000);
newmsg=0;
while(newmsg==0);//waiting for reply
newmsg=0;
ES=0;
readmsg();
buz=1;
if(!strcmp(msg,"123"))
{
lcdcmd(0X01);
msgdisplay("thank you!!");
lcdcmd(0Xc0);
msgdisplay("do transaction");
while(sw==1); //wait till switch is pressed
lcdcmd(0x01);
msgdisplay("THANK YOU!!!");
delay(500);
dd: lcdcmd(0x01);
msgdisplay("Remove ur card");
again1:
delay(100);
a=read_eeprom(1);
if(a!=0xff)
goto again1;
ES=1;
goto start;
}

else
{
buz=0;
lcdcmd(0x01);

S.R.T.I.S.T 74
ATM SECURITY
USING GSM AND MEMS

msgdisplay("wrong password ");


lcdcmd(0xc0);
msgdisplay("no access");
delay(1000);
buz=1;
goto dd;
}

/*****reading message from gsm modem*/


void readmsg(void)
{
unsigned char a,b,i,count,numcnt;

delay(100);
ES=1;
delay(300);
ES=0;

while(RI==1)
{
RI=0;
delay(100);
}

send_to_modem("at+cmgr=1");
enter();

count=0;
i=0;
a=0;
numcnt=0;

while(count!=3)
{
while(RI==0);
b=SBUF;

if((b==',')||(a==1))
{
if(numcnt<15)
{
if(numcnt>4)
{
mobilenum[numcnt-5]=b;
}
a=1;
numcnt++;
}
else

S.R.T.I.S.T 75
ATM SECURITY
USING GSM AND MEMS

a=0;
}
if(count==2)
{
msg[i++]=SBUF;

RI=0;
if(b==10)
count+=1;
}

msg[--i]='\0';
msg[--i]='\0';
mobilenum[10]='\0';
send_to_modem("at+cmgd=1");
enter();

CHAPTER 11
FUTURE ASPECTS

1. The microcontroller in this project can be interfaced with smoke sensor to identify
fire accidents and can be approached in time.
2. The GSM modem can be replaced with internet connection in which all the data
which data base of all the users are maintained. Hence the sms is sent through the
net to which the concerned bank and ATM are interlinked.
3. A virtual password can be generated and sent to the predefined number at each
time of insertion of card instead of a fixed password to be entered at the ATM
center.

S.R.T.I.S.T 76
ATM SECURITY
USING GSM AND MEMS

CHAPTER 12
CONCLUSION

The project “ATM SECURITY SYSTEM USING GSM MODULE” has


been successfully designed and tested. Integrating features of all the hardware
components used have developed it. Presence of every module has been reasoned out
and placed carefully thus contributing to the best working of the unit. Secondly, using
highly advanced IC’s and with the help of growing technology the project has been
successfully implemented.

S.R.T.I.S.T 77
ATM SECURITY
USING GSM AND MEMS

S.R.T.I.S.T 78
ATM SECURITY
USING GSM AND MEMS

REFERENCES

TEXT BOOKS

S.NO TITLE OF THE AUTHOR PUBLICATIONS YEAR


TEXT BOOK

01. 8051 Microcontroller MAZIDI Prentice Hall 2009


and embedded &MAZIDI Publications
systems (2nd Edition)

02. 8051 Microcontroller KENNETH Thomson 2004


Publications
(3rd Edition) J.AYALA

03. Embedded controller KEN Newness 2007


hardware design Publications
ARNOLD

WEB PREFERENCES

 http://www.aaroncake.net/circuits/supply.asp
 http://www.8052.com/tut8051
 http://electrosofts.com/serial/
 http://www.8052.com/tuttimer.phtml
 www.tkk.fi/Misc/Electronics/circuits/ir_send.html

S.R.T.I.S.T 79

You might also like