Professional Documents
Culture Documents
CHAPTER 1 INTRODUCTION
1.1 INTRODUCTION The overview of this project is to design GSM based ATM SECURITY system using AT89S52.
1.2
1.3 METHODOLOGY
The Project Atm security system using gsm module is designed using GSM technology. According to this technology the communication takes place between GSM and microcontroller. The project basically consists of a preloaded GSM number is correct. GSM module which activates the
microcontroller to start the processing of ATM card if the password received from the
1.4. SIGNIFICANCE
This System stops any sort of robbery by taking GSM as its input functional bock. Its the GSM that is activating the total project by receiving the message from the mobile number stored in the card. Once the micro controller is activated the following sequence is started which involves entering of correct password once again which is the CARD password for the further transaction to be continued.
S.R.T.I.S.T
Fig 1.1 Block Diagram of the Project 1.6 BLOCK DIAGRAM DESCRIPTION
The hardware involved in this project is a Power Supply, a LCD to display the concerned information, a GSM is interfaced to the Microcontroller through MAX 232, GSM is interfaced through ADC 0804. While execution, the tilt identified by the mems activates the microcontroller. The microcontroller then starts the following sequence, it gives command to shut down the door in order to avoid the thief to run away and also a sms is sent to the vigilance system to alert them so that they can approach to the place as soon as possible to catch the burglar. This Project mainly consists of Power Supply section, Microcontroller section, GSM section, LCD display section, Max 232 serial driver section,.
The input to the circuit is applied from the regulated power supply. The a.c. input
i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to
S.R.T.I.S.T
remove any a.c components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage.
Transformer: Usually, DC voltages are required to operate various electronic equipment and these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input available at the mains supply i.e., 230V is to be brought down to the required voltage level. This is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a required level. Rectifier: The output from the transformer is fed to the rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full wave rectification. Filter: Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens the D.C. Output received from this filter is constant until the mains voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage received at this point changes. Therefore a regulator is applied at the output stage. Voltage regulator:
S.R.T.I.S.T
As the name itself implies, it regulates the input applied to it. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. In this project, power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78 represents positive supply and the numbers 05, 12 represent the required output voltage levels. 1.6.2 Microcontroller Section Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products. 8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM
S.R.T.I.S.T
An embedded system can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. The embedded software is also called firm ware. The desktop/laptop computer is a general purpose computer. You can use it for a variety of applications such as playing games, word processing, accounting, software development and so on. In contrast, the software in the embedded systems is always fixed listed below: Embedded systems do a very specific task, they cannot be programmed to do different things. . Embedded systems have very limited resources, particularly the memory. Generally, they do not have secondary storage devices such as the CDROM or the floppy disk. Embedded systems have to work against some deadlines. A specific job has to be completed within a specific time. In some embedded systems, called real-time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded systems are constrained for power. As many embedded systems operate through a battery, the power consumption has to be very low. Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity. Following are the advantages of Embedded Systems: 1. They are designed to do a specific task and have real time performance constraints which must be met. 2. They allow the system hardware to be simplified so costs are reduced. 3. They are usually in the form of small computerized parts in larger devices which serve a general purpose. 4. The program instructions for embedded systems run with limited computer hardware resources, little memory and small or even non-existent keyboard or screen.
S.R.T.I.S.T
Introduction: The Evolution of Mobile Telephone Systems Cellular is one of the fastest growing and most demanding telecommunications applications. Today, it represents a continuously increasing percentage of all new telephone subscriptions around the world. Currently there are more than 45 million cellular subscribers worldwide, and nearly 50 percent of those subscribers are located in the United States. The concept of cellular service is the use of low power transmitters where frequencies can be reused within a geographic area. The idea of cell based mobile radio service was formulated in the United States at Bell Labs in the early 1970s. Cellular systems began in the United States with the release of the advanced mobile phone service (AMPS) system in 1983. The AMPS standard was adopted by Asia, Latin America and Oceanic countries, creating the largest potential market in the world for cellular. In the early 1980s, most mobile telephone systems were analog rather than digital, like today's newer systems. One challenge facing analog systems was the inability to handle the growing capacity needs in a cost efficient manner. As a result, digital technology was welcomed. The advantages of digital systems over analog systems include ease of signaling, lower levels of interference, integration of transmission and switching and increased ability to meet capacity demands. The table below shows the worldwide development of mobile telephone systems.
S.R.T.I.S.T
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
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.
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
S.R.T.I.S.T
2.6 SOLUTION
If we introduce the project then it would be easy to stop the thief without drawing money from the ATM though he knew the password. As the thief inserts the ATM into the machine, the GSM is activated. This gives signal to the microcontroller to wait until it the GSM module receives the code from the pre defined user number before the transaction is timed out.
2.7 DESCRIPTION
In this project, the GSM module is placed in the upper or lower panel of the atm machine, when a thief inserts the ATM card into the machine or swipes the card, a message is sent to the predefined mobile number and makes the controller to wait until the password message is received from that number before the transaction timed out. When the message is received to GSM module, it verifies the password. If the password received is correct then the further process of microcontroller is activated. As the microcontroller is activated it then has to start a sequence which verifies the CARD password and then start the further transaction.
S.R.T.I.S.T
10
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.
Slower Development time: As we have observed Microprocessors need a lot of debugging at board level and at program level, where as, Micro controller do not have the excessive circuitry and the built-in peripheral chips are easier to program for operation. So peripheral devices like Timer/Counter, Parallel programmable port, Serial Communication Port, Interrupt controller and so on, which were most often used were integrated with the Microprocessor to present the Micro controller .RAM and ROM also were integrated in the same chip. The ROM size was anything from 256 bytes to 32Kb or more. RAM was optimized to minimum of 64 bytes to 256 bytes or more. Microprocessor has following instructions to perform: 1. Reading instructions or data from program memory ROM. 2. Interpreting the instruction and executing it. 3. Microprocessor Program is a collection of instructions stored in a Nonvolatile memory. 4. Read Data from I/O device 5. Process the input read, as per the instructions read in program memory. 6. Read or write data to Data memory. 7. Write data to I/O device and output the result of processing to O/P device.
S.R.T.I.S.T
12
The AT89s52 is a low-voltage, high-performance CMOS 8bit microcomputer with 8K bytes of Flash programmable memory. The device is manufactured using Atmels high density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. The on chip flash allows the program memory to be reprogrammed in system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. In addition, the AT89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.
3.4 FEATURES
Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer -Power-off Flag
PIN DIAGRAM
S.R.T.I.S.T 13
S.R.T.I.S.T
14
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during Program verification. External pullups are required during program verification
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2
S.R.T.I.S.T 15
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. The port also receives the high-order address bits and some control signals during Flash programming and verification
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3 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) strobe)
RST
S.R.T.I.S.T 16
A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled
ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external mem- ory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only dur-ing a MOVX or MOVC instruction. Otherwise, the 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
S.R.T.I.S.T
18
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
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
The power control SFR is used to control the 8051s 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 8051s 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
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.
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 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 S.R.T.I.S.T 23
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: The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers0, 1, and 2), and the serial port
S.R.T.I.S.T
24
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
S.R.T.I.S.T .
26
4.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
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
S.R.T.I.S.T
28
S.R.T.I.S.T
29
S.R.T.I.S.T
30
Illustrated is a 3-bit flash ADC with resolution 1 volt (after Tocci). The resistor net and comparators provide an input to the combinational logic circuit, so the conversion time is just the propagation delay through the network - it is not limited by the clock rate or some convergence sequence. It is the fastest type of ADC available, but requires a comparator for each value of output (63 for 6-bit, 255 for 8-bit, etc.) Such ADCs are available in IC form up to 8-bit and 10-bit flash ADCs (1023 comparators) are planned. The encoder logic executes a truth table to convert the
S.R.T.I.S.T
31
4.5 Applications
AD converters are used virtually everywhere where an analog signal has to be processed, stored, or transported in digital form. Fast video ADCs are used, for example, in TV tuner cards. Slow on-chip 8, 10, 12, or 16 bit ADCs are common in microcontrollers. Very fast ADCs are needed in digital oscilloscopes, and are crucial for new applications like software defined radio and in music recording. ADC's dynamic range is also important.
S.R.T.I.S.T
32
S.R.T.I.S.T
33
S.R.T.I.S.T
34
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
35
S.R.T.I.S.T
36
S.R.T.I.S.T
37
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.
S.R.T.I.S.T
38
Voice mail: This service is actually an answering machine within the network, which is controlled by the subscriber. Calls can be forwarded to the subscriber's voice-mail box and the subscriber checks for messages via a personal security code. Fax mail: With this service, the subscriber can receive fax messages at any fax machine. The messages are stored in a service center from which they can be retrieved by the subscriber via a personal security code to the desired fax number
Supplementary Services:
Call forwarding: This service gives the subscriber the ability to forward incoming calls to another number if the called mobile unit is not reachable, if it is busy, if there is no reply, or if call forwarding is allowed unconditionally. Barring of outgoing calls: This service makes it possible for a mobile subscriber to prevent all outgoing calls. Barring of incoming calls: This function allows the subscriber to prevent incoming calls. The following two conditions for incoming call barring exist: baring of all incoming calls and barring of incoming calls when roaming outside the home PLMN. Advice of charge (AoC): The AoC service provides the mobile subscriber with an estimate of the call charges. There are two types of AoC information: one that 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 conversationthat 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 S.R.T.I.S.T 39
party. The restriction service enables the calling party to restrict the presentation. The restriction overrides the presentation. Closed user groups (CUGs): CUGs are generally comparable to a PBX. They are a group of subscribers who are capable of only calling themselves and certain numbers
S.R.T.I.S.T
40
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.
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.
S.R.T.I.S.T
41
S.R.T.I.S.T
42
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 6.1: Pin Functions of DB-9 Pin Connector (Note: DCD, DSR, RTS and CTS are active low pins.)
S.R.T.I.S.T
43
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
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.
S.R.T.I.S.T
44
Fig.6.1: Connection of Microcontroller with Serial Port Using MAX 232 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 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.
supplies. The MAX232 has two sets of line drivers for transferring and receiving data.
Embedded Controller
45
S.R.T.I.S.T
S.R.T.I.S.T
46
Pin 10, 11 form the dual inputs with TTL logic whereas 14, 7 form the outputs for RS 232 logic. And the 12, 9, 13, 8 form the vice versa inputs and outputs as shown in fig. The inputs and outputs of the drivers and receivers are shown in fig above.
CHAPTER 7
S.R.T.I.S.T
47
S.R.T.I.S.T
48
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 LCDs then describe how to program and interface an LCD to 8051 using Assembly and C.
S.R.T.I.S.T
49
Fig.7.1: Connection of LCD with Microcontroller The LCD can display a character successfully by placing the 1. Data in Data Register 2. Command in Command Register of LCD 1. Data corresponds to the ASCII value of the character to be printed. This can be done by placing the ASCII value on the LCD Data lines and selecting the Data Register of the LCD by selecting the RS (Register Select) pin. 2. Each and every display location is accessed and controlled by placing respective command on the data lines and selecting the Command Register of LCD by selecting the (Register Select) RS pin.
S.R.T.I.S.T
50
Pin 1 2 3 4
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
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
Command to LCD Instruction Register Clear display screen Return home Decrement cursor Increment cursor Shift display right Shift display left Display off, cursor off 51
A C E F 10 14 18 1C 80 C0 38
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 7.2: LCD Command Codes
7.4 Uses
The LCDs used exclusively in watches, calculators and measuring instruments are the simple seven-segment displays, having a limited amount of numeric data. The recent advances in technology have resulted in better legibility, more information displaying capability and a wider temperature range. These have resulted in the LCDs being extensively used in telecommunications and entertainment electronics. So in this project, the LCD is used to display the instantaneous information. The information may be prompting or alerting or instructing the user.
CHAPTER 8 RELAYS
8.1 Introduction
A relay is an electrical switch that opens and closes under the control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. A relay is able to control an output circuit of higher power than the input circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.
S.R.T.I.S.T
52
Fig 8.1 Relay Relays are usuallly SPDT (single pole double through switch)or DPDT (double pole double through switch) but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available.
S.R.T.I.S.T
53
Fig 8.2 Relay circuit Inductors react against changes in current because of the energy stored in this magnetic field. When we construct a transformer from two inductor coils around a common iron core, we use this field to transfer energy from one coil to the other. However, there are simpler and more direct uses for electromagnetic fields than the applications we've seen with inductors and transformers. The magnetic field produced by a coil of current-carrying wire can be used to exert a mechanical force on any magnetic object, just as we can use a permanent magnet to attract magnetic objects, except that this magnet (formed by the coil) can be turned on or off by switching the current on or off through the coil. If we place a magnetic object near such a coil for the purpose of making that object move when we energize the coil with electric current, we have what is called a solenoid. The movable magnetic object is called an armature, and most armatures can be moved with either direct current (DC) or alternating current (AC) energizing the coil. The polarity of the magnetic field is irrelevant for the purpose of attracting an iron armature. Solenoids can be used to electrically open door latches, open or shut valves, move robotic limbs, and even actuate electric switch mechanisms and is used to actuate a set of switch contacts
operation
S.R.T.I.S.T
54
S.R.T.I.S.T
55
which in turn may weld the contacts together.All relays have two operating values (voltages), one pick-up and the other other drop away. The pick-up value is higher than the drop away value.
8.4 Applications
To control a high-voltage circuit with a low-voltage signal, as in some types of modems or audio amplifiers, To control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile, To detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays), To isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. They may also be controlled by room occupancy detectors in an effort to conserve energy, 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. 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. 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
S.R.T.I.S.T
56
dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be varied by increasing or decreasing the flow rate. For longer time periods, a mechanical clockwork timer is installed
S.R.T.I.S.T
57
9.2 TRANSFORMER
A transformer is an electrical device which is used to convert electrical power from one Electrical circuit to another without change in frequency. Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC. Step-up transformers increase in output voltage, step-down transformers decrease in output voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. There is no electrical
S.R.T.I.S.T
58
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 turns 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
9.3 RECTIFIER
A circuit which is used to convert a.c to dc is known as RECTIFIER. The process of conversion a.c to d.c is called rectification.
S.R.T.I.S.T
60
9.3.5 Operation
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased while D1 and D4 are in reverse biased as shown in the fig(b). The current flow direction is shown in the fig (b) with dotted arrows.
Fig.11.4. (a): Operation Circuit of Bridge Rectifier 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.
S.R.T.I.S.T
61
9.4 FILTER
A Filter is a device which removes the a.c component of rectifier output but allows the d.c component to reach the load
S.R.T.I.S.T
62
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 800F hence large value of capacitor is placed to reduce ripples and to improve the DC component.
9.5 REGULATOR
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage regulators ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the output pin.
S.R.T.I.S.T
63
10.1 INTRODUCTION
ATM security system using GSM Modules is one of the hot topics in embedded systems industry. For providing Security at ATMs GSM Modules are controlled by using ATMEL Processor based AT89S52 Microcontroller. Probably the most useful thing to know about the global system for mobile communication is that it is an international standard. If you travel in parts of world, GSM is only type of cellular service available. Instead of analog services, GSM was developed as a digital system using TDMA technology. In this project ATMEL based AT89S52 Microcontroller monitors GSM Module . Whenever the user inserts his ATM card into ATM machine, a message will be sent to the user mobile providing the details like time of card insertion, date, name of the user and place where the card has been inserted. This database will be maintained both in the bank and at the ATM center. The microcontroller in the ATM machine asks for the confirmation from the user mobile. This user mobile can be changed whenever the user wishes to. As the details are received by the user in his mobile, he has to send the confirmation message to the modem. Thus, the microcontroller receives this message as the confirmation and allows the person to proceed with the further transactions.
S.R.T.I.S.T
64
S.R.T.I.S.T
65
S.R.T.I.S.T
66
S.R.T.I.S.T
67
The Express SCH schematic design program is very easy to use. This software enables the user to draw the Schematics with drag and drop options. A Quick Start Guide is provided by which the user can learn how to use it. Details: Express SCH, Version 5.6.0
10.6 EMBEDDED C
The programming Language used here in this project is an Embedded C Language. This Embedded C Language is different from the generic C language in few things like a) Data types b) Access over the architecture addresses. The Embedded C Programming Language forms the user friendly language with access over Port addresses, SFR Register addresses etc. Embedded C Data types: Data Types 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
68
The steps to develop 8051 project using keil are 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 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 NOmostly 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 For a program written in Assembly, then save it with extension . asm and for C based program save it with extension C
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.
S.R.T.I.S.T
69
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
70
ATM SECURITY USING GSM AND MEMS sbit sbit buz = sw = P2^7; P3^7;
unsigned char msg[10]; unsigned char mobilenum[]="9676899420"; unsigned charnumcnt,b11,XX,newmsg=0,a=0; void readmsg(); //to read the message from gsm modem unsigned int i;
void main() { lcd_init(); lcd_init(); msgdisplay("welcome"); UART_init(); delay(1000); lcdcmd(1); msgdisplay("CHECKING GSM"); EA=1;//global interuupt enable send_to_modem("ate0"); //to avoid echo signals, enter(); again: send_to_modem("at"); // TO CHECKING GSM MODEM... enter(); if(RI==0) // to checking wether GSM modem connected to system or goto again; ES=1; //enable serial interuupt xxx: newmsg=0; delay(20); send_to_modem("AT+CPIN?"); enter(); delay(500); if(newmsg==0) the
// sim checking
S.R.T.I.S.T
71
ATM SECURITY USING GSM AND MEMS goto xxx; lcdcmd(0XC0);//move the cursor to second line of lcd msgdisplay("MODEM CONNECTED"); send_to_modem("AT+CREG=0"); enter(); //
text
buz=0; //buzzer on send_to_modem("at+cmgf=1"); //to set message format as enter(); send_to_modem("at+cmgd=1"); enter(); send_to_modem("at+cmgd=2"); enter(); send_to_modem("at+cmgd=3"); enter(); delay(500); buz=1; //buzzer off //delecte the message1
back: delay(100); a=read_eeprom(1); if(a==0xff) goto back; if(a=='A') { lcdcmd(0X01); msgdisplay("CARD DETECTED"); send_to_modem("at+cmgs="); ch_send_to_modem('"'); send_to_modem(mobilenum); ch_send_to_modem('"'); enter(); delay(50); send_to_modem("SEND COMFIRMATION PASSWORS TO ACCESS YOUR ATM CARD"); ch_send_to_modem(0x1a);//control z delay(500); lcdcmd(0Xc0); msgdisplay("SEND PASSWORD"); buz=0; newmsg=0; while(newmsg==0); //wait till message is delivered succesfully buz=1;
S.R.T.I.S.T
72
delay(1000); newmsg=0; while(newmsg==0);//waiting for reply newmsg=0; ES=0; readmsg(); buz=1; if(!strcmp(msg,"123")) { lcdcmd(0X01); msgdisplay("thank you!!"); lcdcmd(0Xc0); msgdisplay("do transaction"); while(sw==1); //wait till switch is pressed lcdcmd(0x01); msgdisplay("THANK YOU!!!"); delay(500); dd: lcdcmd(0x01); msgdisplay("Remove ur card"); again1: delay(100); a=read_eeprom(1); if(a!=0xff) goto again1; ES=1; goto start; } else { buz=0; lcdcmd(0x01); msgdisplay("wrong password "); lcdcmd(0xc0); msgdisplay("no access"); delay(1000); buz=1; goto dd; } } } } /*****reading message from gsm modem*/ void readmsg(void) { unsigned char a,b,i,count,numcnt; delay(100); ES=1; delay(300); ES=0; while(RI==1)
S.R.T.I.S.T
73
RI=0; delay(100);
send_to_modem("at+cmgr=1"); enter(); count=0; i=0; a=0; numcnt=0; while(count!=3) { while(RI==0); b=SBUF; if((b==',')||(a==1)) { if(numcnt<15) { if(numcnt>4) { mobilenum[numcnt-5]=b; } a=1; numcnt++; } else a=0; } if(count==2) { msg[i++]=SBUF; } RI=0; if(b==10) count+=1; } msg[--i]='\0'; msg[--i]='\0'; mobilenum[10]='\0'; send_to_modem("at+cmgd=1"); enter();
S.R.T.I.S.T
74
1. The microcontroller in this project can be interfaced with smoke sensor to identify fire accidents and can be approached in time. 2. The GSM modem can be replaced with internet connection in which all the data which data base of all the users are maintained. Hence the sms is sent through the net to which the concerned bank and ATM are interlinked. 3. A virtual password can be generated and sent to the predefined number at each time of insertion of card instead of a fixed password to be entered at the ATM center.
CHAPTER 12 CONCLUSION
The project ATM SECURITY SYSTEM USING GSM MODULE has been successfully designed and tested. Integrating features of all the hardware components used have developed it. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.
S.R.T.I.S.T
75
S.R.T.I.S.T
76
REFERENCES
S.NO
AUTHOR
PUBLICATIONS YEAR
01.
MAZIDI &MAZIDI
2009
02.
KENNETH J.AYALA
2004
03.
2007
TEXT BOOKS
WEB PREFERENCES
S.R.T.I.S.T
77