ATM Security System Using GSM and MEMS Module

Published on June 2016 | Categories: Documents | Downloads: 40 | Comments: 0 | Views: 276
of 82
Download PDF   Embed   Report

Comments

Content

ATM SECURITY USING GSM AND MEMS

CHAPTER 1 INTRODUCTION
1.1 INTRODUCTION
The overview of this project is to design MEMS and GSM based ATM SECURITY system using AT89S52.

1.2AIM OF THE PROJECT
To enhance the security system of present existing ATM machine.

1.3 METHODOLOGY
The Project ‘Atm security system using gsm and mems module ’ is designed using MEMS technology. According to this technology the communication takes place between two devices MEMS and microcontroller. The MEMS is a sensor device which identifies the tilt produced by the atm machine due to the irregular movement that occur during theft. This project makes best use of MEMS as a sensor device which identifies the tilt produced by the atm machine due to the irregular movement that occur.. The project basically consists of a MEMS sensor which identifies the tilt by the machine and activates the microcontroller to start the following sequence in which shutting the door using stepper motor and sending sms to vigilance system using gsm is involved.

S.R.T.I.S.T

1

ATM SECURITY USING GSM AND MEMS

1.4. SIGNIFICANCE
This System stops any sort of robbery by taking MEMS as its input functional bock. It’s the MEMS that is activating the total project by identifying the tilt caused by the thief during breaking down the ATM machine. Once the micro controller is activated the following sequence is started which involves shutting of the door using stepper motor and alerting the vigilance system by a sms using GSM .

1.5 BLOCK DIAGRAM
POWER SUPPLY

MEMS SENSOR

A D C 0 8 0 4

A T 8 9 S 5 2
Fig.1.1

LCD DISPL

GSM MODEM

MAX232

RELA Y

MOTO R

Fig 1.1 Block Diagram of the Project

S.R.T.I.S.T

2

ATM SECURITY USING GSM AND MEMS

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, MEMS 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, Mems section, GSM section, LCD display section, Max 232 serial driver section, ADC 0804 section, Motor section and Relay section.

1.6.1 Power Supply Section
This section is meant for supplying Power to all the sections mentioned above. It basically consists of a Transformer to step down the 230V ac to 9V ac followed by diodes. Here diodes are used to rectify the ac to dc. After rectification the obtained rippled dc is filtered using a capacitor Filter. A positive voltage regulator is used to regulate the obtained dc voltage. 1.6.2 Microcontroller Section This section forms the control unit of the whole project. This section basically consists of a Microcontroller with its associated circuitry like Crystal with capacitors, Reset circuitry, Pull up resistors (if needed) and so on. The Microcontroller forms the heart of the project because it controls the devices being interfaced and communicates with the devices according to the program being written.

1.6.3 MEMS Section
This is the input functional block which is used to identify the tilt that are occurred in the atm machine when a thief tries to break open the atm machine.

S.R.T.I.S.T

3

ATM SECURITY USING GSM AND MEMS

1.6.4 ADC 0804 Section
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-singleended analog signals. The device eliminates the need for external zero and full-scale adjustments.

1.6.5 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.6 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.7 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.

S.R.T.I.S.T

4

ATM SECURITY USING GSM AND MEMS

1.6.8 Motor Section
A stepper motor is an electromechanically device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied.

1.6.9 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
Embedded system is a combination of software and hardware designed and programmed to perform one/more particular task(s). The hardware is designed for specific application and then software is embedded in this hardware to perform the task. Both software and hardware are dedicated to that particular application. The heart of the system is either processor or controller. Processor / controller may be general purpose or special purpose that controls whole system. There may be more than one processor/controller if system is complex. It may be possible that there is one general purpose processor / controller and one or more special purpose processors / controllers. For example in 3G (or 4G) cell phones there is one general purpose processor that handles user commands, memory and display etc. And there are special purpose processors like DSP for voice communication and network management, display controller to generate real and reach images on color LCD screen. An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Physically embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. In terms of complexity embedded systems can range from very simple with a single microcontroller chip, to very complex with multiple units, peripherals and networks mounted inside a large chassis or enclosure.

S.R.T.I.S.T

6

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 Inertial guidance systems for aircraft and missiles Computer peripherals such as routers and printers engine controllers and antilock brake controllers for automobiles

S.R.T.I.S.T

7

ATM SECURITY USING GSM AND MEMS

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

8

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 tries to break down the atm machine.

2.6 SOLUTION
If we introduce the project then it would be easy to stop the thief. As the thief tries to open the machine the MEMS is activated this gives signal to the microcontroller which shuts the door and alerts the vigilance system.

2.7 DESCRIPTION
In this project, the MEMS sensor is placed in the upper or lower panel of the atm machine, when a thief tries to open the machine he has to break the panel and open either the upper panel or lower panel. When he does so the MEMS sensor will be activated as it reads the tilt produced while lifting the panel, this will activate the microcontroller. As the microcontroller is activated it then has to start a sequence which should stop the thief from running away from the machine, for this purpose we need to shut the door, in order to shut the door we are using a stepper motor, also we have to alert the vigilance system here we are using GSM to send the SMS.

S.R.T.I.S.T

9

ATM SECURITY USING GSM AND MEMS

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.

S.R.T.I.S.T

10

ATM SECURITY USING GSM AND MEMS

3.2 NECESSITY OF MICROCONTROLLERS
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 11

ATM SECURITY USING GSM AND MEMS

3.3 Introduction to AT89S52
The system requirements and control specifications clearly rule out the use of 16, 32 or 64 bit micro controllers or microprocessors. Systems using these may be earlier to implement due to large number of internal features. They are also faster and more reliable but, the above application is satisfactorily served by 8-bit micro controller. Using an inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive market place. Coming to the question of why to use 89S52 of all the 8-bit Microcontroller available in the market the main answer would be because it has 8kB Flash and 256 bytes of data RAM32 I/O lines, three 16-bit timer/counters, a Eight-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. 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. The Flash program memory supports both parallel programming and in Serial In-System Programming (ISP). The 89S52 is also In-Application Programmable (IAP), allowing the Flash program memory to be reconfigured even while the application is running. 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.

S.R.T.I.S.T

12

ATM SECURITY USING GSM AND MEMS

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 • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer -Power-off Flag

S.R.T.I.S.T

13

ATM SECURITY USING GSM AND MEMS

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: Supply voltage. GND: Ground.

Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. W hen 1s are written to port 0 pins, the pins can be used as highimpedance inputs. Port 0 can also be configured to be the multiplexed low- o rder address/data bus during accesses to external pro-gram and data m em ory. In this mode, P0 has internal pullups Port 0 also receives the code bytes during Flash program- mi ng an d ou t pu t s t he c o de b y t es du r i n g pr o g r a m verification. External pullups are required during program verification.

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

S.R.T.I.S.T

15

ATM SECURITY USING GSM AND MEMS

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

Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal 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 P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 Alternate Functions RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T1 (timer 1 external input) WR (external data memory write RD (external data memory read strobe)

S.R.T.I.S.T

16

ATM SECURITY USING GSM AND MEMS

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

ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external 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 pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

S.R.T.I.S.T

17

ATM SECURITY USING GSM AND MEMS

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) P3.0-RXD (SBUF) P3.1-TXD (SBUF) P3.2-INTO 0 (TCON.1) P3.3 - INTO 1 (TCON.3) P3.4 - T0 (TMOD) P3.5 – T1 (TMOD) P3.6 - WR P3.7 - RD Alternate Use Serial data input Serial data output External interrupt 0 External interrupt 1 External Timer 0 input External timer 1 input External memory write pulse External memory read pulse

3.8 INTERRUPTS:

S.R.T.I.S.T

24

ATM SECURITY USING GSM AND MEMS

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 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 MEMS(Micro electro mechanical system) 4.1 Introduction
MEMS which is abbreviated as Micro electro mechanical system is a combination of mechanical and electrical systems. Its fabricated using micro fabrication technique. This acts as main functional block in our project. Its sensor device it has the capability of sensing the slightest tilt produced.

4.2 How it is applied in our project
The mems module is placed in the upper or the lower panel present in the ATM machine. When a thief tries to open the panels of the ATM machine the tilt produced during opening the panel is read by the MEMS, this activates the microcontroller then the following sequence is initiated which includes shutting the door and alerting the vigilance system by sending a sms through GSM.

4.3 Applications
 Scrolling of documents, maps and images larger than the display window.    Web page browsing. Menu navigation. Automatic portrait-landscape adaption.

 Motion control

S.R.T.I.S.T

27

ATM SECURITY USING GSM AND MEMS

CHAPTER 5 ADC 0804
5.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-singleended 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.

5.2 Features
1. 2. 3. 4. 5. 6. 7. 8. 9. Easy interface to all microprocessors Operates ratio metrically or with 5 VDC or analog span adjusted voltage reference No zero or full-scale adjust required 8-channel multiplexer with address logic 0V to 5V input range with single 5V power supply Outputs meet TTL voltage level specifications Standard hermetic or molded 28-pin DIP package 28-pin molded chip carrier package ADC0808 equivalent to MM74C949

S.R.T.I.S.T

28

ATM SECURITY USING GSM AND MEMS

5.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 5.1 Pin diagram:

S.R.T.I.S.T

29

ATM SECURITY USING GSM AND MEMS

Fig 5.2 Molded chip carrier package

5.4 Types of ADC
  

Digital-Ramp ADC Successive Approximation ADC Flash ADC

5.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

30

ATM SECURITY USING GSM AND MEMS

Fig 5.3 Digital Ramp adc

5.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 5.4 Illustration of 4-bit SAC with 1 volt step size

S.R.T.I.S.T

31

ATM SECURITY USING GSM AND MEMS

Fig 5.5 Flash ADC:

S.R.T.I.S.T

32

ATM SECURITY USING GSM AND MEMS

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 ladder of inputs to the binary number output.

5.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.

S.R.T.I.S.T

33

ATM SECURITY USING GSM AND MEMS

CHAPTER 6 GSM (Global System for Mobile communications)
6.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 the same timeslot. The channel data rate is 270.833 kbit/s, and the frame duration is 4.615 ms.

6.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. S.R.T.I.S.T 34

ATM SECURITY USING GSM AND MEMS

6.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).

Fig 6.1 GSM Network

S.R.T.I.S.T

35

ATM SECURITY USING GSM AND MEMS

6.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 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.

S.R.T.I.S.T

36

ATM SECURITY USING GSM AND MEMS

6.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.



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.

6.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.

6.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.

S.R.T.I.S.T

37

ATM SECURITY USING GSM AND MEMS •

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.

6.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 6.2 GSM Network Areas 6.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.

6.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. S.R.T.I.S.T 38

ATM SECURITY USING GSM AND MEMS

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

6.6 GSM Specifications
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.

6.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.

S.R.T.I.S.T

39

ATM SECURITY USING GSM AND MEMS

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. 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.

S.R.T.I.S.T

40

ATM SECURITY USING GSM AND MEMS

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 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

41

ATM SECURITY USING GSM AND MEMS

CHAPTER 7 MAX 232
7.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.

7.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

42

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.

7.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

43

ATM SECURITY USING GSM AND MEMS

7.2.2 Start and stop bits
Asynchronous serial data communication is widely used for characteroriented 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)

7.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.

7.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

44

ATM SECURITY USING GSM AND MEMS

7.3.1 DB-9 pin connector
12345 6789

Pin 1 2 3 4 5 6 7 8 9

Description Data carrier detect (DCD) Received data (RXD) Transmitted data (TXD) Data terminal ready(DTR) Signal ground (GND) Data set ready (DSR) Request to send (RTS) Clear to send (CTS) Ring indicator (RI)

Table 7.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

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 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.

7.3.2 8051 connection to RS232

Fig.7.1: Connection of Microcontroller with Serial Port Using MAX 232 S.R.T.I.S.T 46

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.

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

Fig.7.2: MAX 232E Dual Driver/Receiver

S.R.T.I.S.T

47

ATM SECURITY USING GSM AND MEMS

7.4.1 MAX 232 Operating Circuit

Fig.7.3: MAX 232 Operating Circuit

S.R.T.I.S.T

48

ATM SECURITY USING GSM AND MEMS

Table 7.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 8 LIQUID CRYSTAL DISPLAY
8.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

49

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.

8.2 LCD OPERATION
In recent years the LCD is finding widespread use replacing LED s (sevensegment 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

50

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

51

ATM SECURITY USING GSM AND MEMS

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

Fig.8.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 52

ATM SECURITY USING GSM AND MEMS

Pin 1 2 3 4

symbol Vss Vcc VEE RS

I/O ---I

Description Ground +5V power supply Power supply to contrast RS=0 to register select control command

5 6 7 8 9 10 11 12 13 14

R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7

I I/O I/O I/O I/O I/O I/O I/O I/O I/O

RS=1 to select data register R/W=0 for write R/W=1 for read Enable The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus

Table 8.1: Pin Description for LCD

Code (hex) 1 2 4 6 5 S.R.T.I.S.T

Command to LCD Instruction Register Clear display screen Return home Decrement cursor Increment cursor Shift display right 53

ATM SECURITY USING GSM AND MEMS

7 8 A C E F 10 14 18 1C 80 C0 38

Shift display left Display off, cursor off Display off, cursor on Display on, cursor off Display on, cursor on Display on, cursor blinking Shift cursor position to left Shift cursor position to right Shift the entire display to the left Shift the entire display to the right Force cursor to beginning of 1st line Force cursor to beginning of 2nd line 2 lines and 5x7 matrix Table 8.2: LCD Command Codes

8.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.

CHAPTER 9 MOTOR
9.1 Introduction
A stepper motor is an electromechanically device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied.

S.R.T.I.S.T

54

ATM SECURITY USING GSM AND MEMS

9.2 Stepper motor advantages
1. The rotation angle of the motor is proportional to the input pulse 2. The motor has full torque at standstill (if the windings are energized) 3. Precise positioning and repeatability of movement since good stepper motors have an accuracy of 3-5% of a step and this error is non cumulative from one step to the next. 4. Excellent response to starting/stopping/reversing. 5. Very reliable since there are no contact brushes in the motor. Therefore the life of the motor is simply dependant on the life of the bearing. 6. The motors response to digital input pulses provides open-loop control, making the motor simpler and less costly to control. 7. It is possible to achieve very low speed synchronous rotation with a load that is directly coupled to the shaft.
8. A wide range of rotational speeds can be realized as the speed is proportional

to the frequency of the input pulses.

9.3 Stepper motor disadvantages
1. Resonances can occur if not properly controlled. 2. Not easy to operate at extremely high speeds.

9.4 Stepper Motor Types
There are three basic stepper motor types. They are : • Variable-reluctance • Permanent-magnet • Hybrid

9.5 When to Use a Stepper Motor
S.R.T.I.S.T 55

ATM SECURITY USING GSM AND MEMS

A stepper motor can be a good choice whenever controlled movement is required. They can be used to advantage in applications where you need to control rotation angle, speed, position and synchronism. Because of the inherent advantages listed previously, stepper motors have found their place in many different applications. Some of these include printers, plotters, highend office equipment, hard diskdrives, medical equipment, fax machines, automotive and many more.

CHAPTER 10 RELAYS
10.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 S.R.T.I.S.T 56

ATM SECURITY USING GSM AND MEMS

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 10.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.

10.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,

S.R.T.I.S.T

57

ATM SECURITY USING GSM AND MEMS

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 10.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. 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

S.R.T.I.S.T

58

ATM SECURITY USING GSM AND MEMS

valves, move robotic limbs, and even actuate electric switch mechanisms and is used to actuate a set of switch contacts

10.3 Relays can be categorized according to the magnetic system and

operation
10.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.

10.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.

10.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.

10.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.

S.R.T.I.S.T

59

ATM SECURITY USING GSM AND MEMS

10.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.

10.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.

10.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,









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.

S.R.T.I.S.T

60

ATM SECURITY USING GSM AND MEMS 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. Safety-critical logic. Because relays are much more resistant than semiconductors to nuclear radiation, they are widely used in safetycritical logic, such as the control panels of radioactive waste-handling machinery.

o



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

CHAPTER 11 REGULATED POWER SUPPLY
11.1 INTRODUCTION

S.R.T.I.S.T

61

ATM SECURITY USING GSM AND MEMS

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 62

ATM SECURITY USING GSM AND MEMS

11.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

63

ATM SECURITY USING GSM AND MEMS

11.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”.

11.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.

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

Table 11.1: Comparison of Rectifier Circuits

11.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.

11.3.4 Bridge Rectifier

S.R.T.I.S.T

64

ATM SECURITY USING GSM AND MEMS

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.11.3: Circuit diagram of Bridge Rectifier

11.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

65

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.11.4. (b): Operation Circuit of Bridger Rectifier

11.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

11.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

66

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 1000µF hence large value of capacitor is placed to reduce ripples and to improve the DC component.

11.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 67

ATM SECURITY USING GSM AND MEMS

CHAPTER 12 CIRCUIT DESCRIPTION
12.1 INTRODUCTION
ATM security system using GSM and MEMS Modules is one of the hot topics in embedded systems industry. For providing Security at ATMs GSM and MEMS 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. Micro Electrical Mechanical Systems (MEMS) is the integration of mechanical elements, sensors, actuators, and electronics on a common silicon substrate through micro fabrication technology. The broadest requirement for these very small devices is ability to sense the environment, to collect necessary data and to create a signal or action to make desired changes to the environment. In this project ATMEL based AT89S52 Microcontroller monitors MEMS Module , GSM and motor. MEMS module is placed on the outer panel of the ATM Machine, if any tilt is identified by this block, MEMS send a signal to AT89S52 and as the signal is received, it locks the ATM door and Alert message is send to the Security using GSM Module.

S.R.T.I.S.T

68

ATM SECURITY USING GSM AND MEMS

12.2 SCHEMATIC DIAGRAM OF THE PROJECT

Fig.12.1: Schematic Diagram of the Project

S.R.T.I.S.T

69

ATM SECURITY USING GSM AND MEMS

12.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 18th & 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 11th & 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

70

ATM SECURITY USING GSM AND MEMS

12.4 HARDWARE COMPONENTS
The Hardware components used in this project are  Regulated Power Supply  Microcontroller  MEMS Sensor  ADC 0804  GSM  MAX 232  LCD  Motor  Relay

12.5 SOFTWARE COMPONENTS
12.5.1 About Software
Software used is: *Keil software for C programming *Express PCB for lay out design *Express SCH for schematic design

12.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.

S.R.T.I.S.T

71

ATM SECURITY USING GSM AND MEMS



A powerful debugger.

12.5.3 Express PCB
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

12.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

12.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 unsigned char signed char unsigned int signed int sbit Bit sfr 8-bit 8-bit 16-bit 16-bit 1-bit 1-bit 8-bit Size in Bits 0-255 -128 to +127 0 to 65535 -32,768 to +32,767 SFR bit addressable only RAM bit addressable only RAM addresses 80-FFH only Data Range/Usage

S.R.T.I.S.T

72

ATM SECURITY USING GSM AND MEMS

12.6.1 8051 project development cycle
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. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.

Click on the Keil uVision Icon on Desktop Click on the Project menu from the title bar Then Click on New Project Save the Project by typing suitable project name with no extension in u r own folder sited in either C:\ or D:\ Then Click on save button above. Select the component for u r project. i.e. Atmel…… Click on the + Symbol beside of Atmel Select AT89C51 as shown below Then Click on “OK” Then Click either YES or NO………mostly “NO” Now your project is ready to USE Now double click on the Target1, you would get another option “Source group 1” as shown in next page. Click on the file option from menu bar and select “new” The next screen will be as shown in next page, and just maximize it by double clicking on its blue boarder. Now start writing program in either in “C” or “ASM”

S.R.T.I.S.T

73

ATM SECURITY USING GSM AND MEMS

16.

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

17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27.

Now right click on Source group 1 and click on “Add files to Group Source” Now you will get another window, on which by default “C” files will appear. Now select as per your file extension given while saving the file Click only one time on option “ADD” Now Press function key F7 to compile. Any error will appear if so happen. If the file contains no error, then press Control+F5 simultaneously. Then Click “OK”. Now Click on the Peripherals from menu bar, and check your required port as shown in fig below. Drag the port a side and click in the program file. Now keep Pressing function key “F11” slowly and observe. You are running your program successfully

S.R.T.I.S.T

74

ATM SECURITY USING GSM AND MEMS

12.7 SOURCE CODE
============================================================ //<<<<<<<<<<ATM Security System Using GSM and MEMS MODULE>>>>>>>>>>// ============================================================

#include<reg52.h> #include<lcd.h> #include<intrins.h> sbit motor=P0^0; sbit sw=P0^1; void SEND_CHR(unsigned char); void RECEIVE_CHR(); void SEND_SMS(unsigned char *nm); void GSM_INIT(void); unsigned char rch; unsigned char buff[40]; void print(char *str) { while(*str) { SBUF = *str++; while(TI == 0); TI = 0; } } /*void RECEIVE_MEM() { unsigned int i=0; while(1) { do { RECEIVE_CHR(); }while(rch != '$'); RECEIVE_CHR(); if(rch == '3') { RECEIVE_CHR(); S.R.T.I.S.T 75

ATM SECURITY USING GSM AND MEMS

if(rch == 'A') { RECEIVE_CHR(); if(rch == '0') { RECEIVE_CHR(); if(rch == 'M') { RECEIVE_CHR(); if(rch == 'D') { RECEIVE_CHR(); if(rch == 'S') { i = 0; do { RECEIVE_CHR(); buff[i] = rch; }while(buff[i++]!='$'); goto nex; } } } } } } } nex:; } */ void main() { unsigned char i=0; motor=0; sw=1; TMOD = 0x20; SCON = 0x50; TH1 = 0xFA; TR1 = 1; init_lcd(); display_lcd("MAES BASED"); cmd_lcd(0xC0); display_lcd("SECURITY SYSTEM"); delay_ms(300); init_lcd(); //GSM_INIT(); print("AT+CMGF=1\r\n"); delay_ms(300); S.R.T.I.S.T 76

ATM SECURITY USING GSM AND MEMS

TH1 = 0xFD; init_lcd(); while(1) { TH1=0xFD; delay_ms(75); init_lcd(); display_lcd("MEMS BASED"); cmd_lcd(0xC0); display_lcd("SECURITY SYSTEM"); for(i=0;i<32;i++) { RECEIVE_CHR(); buff[i]=rch; } //init_lcd(); if(buff[29]=='L' || buff[29]=='R' || buff[29]=='S' || buff[29]=='I') { TH1=0xFA; delay_ms(75); motor=1; SEND_SMS("9032323048"); //SEND_SMS("9701515557"); motor=0; delay_ms(200); init_lcd(); display_lcd("WAIT FOR DOOR"); cmd_lcd(0xC0); display_lcd("OPEN"); while(sw==1); motor=1; init_lcd(); display_lcd("DOOR OPENED"); delay_ms(300); motor=0; TH1=0xFD; } } } void RECEIVE_CHR() { while(RI==0); rch = SBUF; RI=0; } void SEND_CHR(unsigned char c) { SBUF = c; while(TI==0); S.R.T.I.S.T 77

ATM SECURITY USING GSM AND MEMS

TI=0; } void SEND_SMS(unsigned char *nm) { unsigned int i=0,j=0; TH1=0xFA; cmd_lcd(0x01); display_lcd("SENDING SMS..."); print("AT+CMGS="); SEND_CHR('"'); print(nm); SEND_CHR('"'); print("\r\n"); delay_ms(500); print("SOMEBODY IS TRYING TO ROBERY"); print("\r\n"); print("\r\n"); i=0; SEND_CHR(0x1A); SEND_CHR(0x1A); //END OF MESSAGE INDICATION. (ctrl + z) delay_ms(500); } void GSM_INIT(void) { cmd_lcd(0x01); display_lcd("GSM INITIALIZING"); cmd_lcd(100); print("AT\r\n"); delay_ms(300); print("AT\r\n"); delay_ms(300); print("AT\r\n"); delay_ms(300); print("AT+IPR=4800\r\n"); delay_ms(300); print("AT+CMGF=1\r\n"); delay_ms(300); print("AT+CNMI=0,1,0,0,0\r\n"); delay_ms(300); print("ATE0\r\n"); delay_ms(300); print("AT&W\r\n"); delay_ms(300); print("AT+CREG?\r\n"); delay_ms(300); print("AT+CREG?\r\n"); delay_ms(300); } S.R.T.I.S.T 78

ATM SECURITY USING GSM AND MEMS

CHAPTER 13 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. A smart card system can be developed that which helps in opening the door after locking down the door when MEMS is activated. This smart card will be available only with the authorized person.

S.R.T.I.S.T

79

ATM SECURITY USING GSM AND MEMS

CHAPTER 14 CONCLUSION

The project “ATM SECURITY SYSTEM USING GSM AND MEMS 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

80

ATM SECURITY USING GSM AND MEMS

S.R.T.I.S.T

81

ATM SECURITY USING GSM AND MEMS

REFERENCES

TEXT BOOKS

S.NO

TITLE OF THE TEXT BOOK

AUTHOR

PUBLICATIONS YEAR

01.

8051 Microcontroller and embedded systems (2nd Edition)

MAZIDI &MAZ IDI

Prentice Hall Publications

2009

02.

8051 Microcontroller (3rd Edition)

KENNETH J.AYALA

Thomson Publications Newness Publications

2004

03.

Embedded controller KEN hardware design ARNOLD

2007

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

82

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close