Professional Documents
Culture Documents
CHAPTER 1 INTRODUCTION
1.1 INTRODUCTION
The overview of this project is to design MEMS and GSM based ATM SECURITY system using AT89S52.
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.4. SIGNIFICANCE
This System stops any sort of robbery by taking MEMS as its input functional bock. Its 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 .
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
S.R.T.I.S.T
S.R.T.I.S.T
S.R.T.I.S.T
S.R.T.I.S.T
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
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
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
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.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
interrupts. 8052 has 8K ROM, 256 bytes of RAM, three timers and 8
interrupts.
S.R.T.I.S.T
10
S.R.T.I.S.T
12
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
PIN DIAGRAM
S.R.T.I.S.T
14
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
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
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
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.
S.R.T.I.S.T
22
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
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
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
S.R.T.I.S.T .
26
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
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
S.R.T.I.S.T
29
S.R.T.I.S.T
30
S.R.T.I.S.T
31
S.R.T.I.S.T
32
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
S.R.T.I.S.T
35
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
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.
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
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.
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.
S.R.T.I.S.T
39
Facsimile group IIIGSM 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 GSMconnected 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
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 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
S.R.T.I.S.T
42
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
43
S.R.T.I.S.T
44
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
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.
Fig.7.1: Connection of Microcontroller with Serial Port Using MAX 232 S.R.T.I.S.T 46
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.
S.R.T.I.S.T
47
S.R.T.I.S.T
48
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.
S.R.T.I.S.T
49
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 LCDs are lightweight with only a few millimeters thickness. Since the LCDs consume less power, they are compatible with low power electronic circuits, and can be powered for long durations. The LCD s doesnt generate light and so light is needed to read the display. By using backlighting, reading is possible in the dark. The LCDs have long life and a wide operating temperature range. Changing the display size or the layout size is relatively simple which makes the LCDs 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 LCDs then describe how to program and interface an LCD to 8051 using Assembly and C.
S.R.T.I.S.T
50
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
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
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 53
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
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
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.
S.R.T.I.S.T
57
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
valves, move robotic limbs, and even actuate electric switch mechanisms and is used to actuate a set of switch contacts
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.
S.R.T.I.S.T
59
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
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 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
61
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:
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 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
S.R.T.I.S.T
63
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.
S.R.T.I.S.T
64
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.
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.
S.R.T.I.S.T
65
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.
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
S.R.T.I.S.T
66
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 1000F 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.
S.R.T.I.S.T
68
S.R.T.I.S.T
69
S.R.T.I.S.T
70
S.R.T.I.S.T
71
A powerful debugger.
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
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
S.R.T.I.S.T
73
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
#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
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
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
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
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
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 ICs and with the help of growing technology the project has been successfully implemented.
S.R.T.I.S.T
80
S.R.T.I.S.T
81
REFERENCES
TEXT BOOKS
S.NO
AUTHOR
PUBLICATIONS YEAR
01.
2009
02.
KENNETH J.AYALA
2004
03.
2007
WEB PREFERENCES
S.R.T.I.S.T
82