GSM High Performance ATM Card Security System

32
GSM High Performance ATM Card Security System Branch: Office Automation Duration: Processor: AT89C51, PIC16F877A, X86 Hardware: Technology: C51, GSM -(FBUS) Software: KeilC51: CCS Windows - C Aim: To Secure the ATM Card in new way. The other user can Access the money from ATM Using Mobile Communication and secure the theft. Description: This system involves to any one access the ATM the auto SMS will come weather the money will transfer or not Using GSM Mobile for security System. This System is divided into three different modules, 1) SMS Access PC Unit 2) Out of coverage SMS Unit 3) Theft SMS Police information Unit 1

Transcript of GSM High Performance ATM Card Security System

Page 1: GSM High Performance ATM Card Security System

GSM High Performance ATM Card Security System

Branch:  Office Automation    Duration:   Processor:  AT89C51,

PIC16F877A, X86        Hardware:   

Technology:  C51, GSM -(FBUS)       

Software:  KeilC51: CCS Windows - C

Aim: To Secure the ATM Card in new way. The other user can Access the money from ATM

Using Mobile Communication and secure the theft.

Description:

This system involves to any one access the ATM the auto SMS will come weather the money

will transfer or not Using GSM Mobile for security System.

This System is divided into three different modules,

1) SMS Access PC Unit

2) Out of coverage SMS Unit

3) Theft SMS Police information Unit

1

Page 2: GSM High Performance ATM Card Security System

2. SMS Access PC Unit :

This Micro control unit is connected to PC unit with help of GSM.

2

Micro Control

MAX 232

MAX 232

Page 3: GSM High Performance ATM Card Security System

Transmitter Unit

This System is used to Read the user ID and Password, then read the money value PC to SMS communication. We can Access the money from ATM through GSM Technologies.

This system contains

1) Automatic Settings of SMS Money Access GSM Communication To read user name / ID and Password Read Money Value Conform to take to send SMS to User If User is Accepted money will transferred Else no Response

3

Page 4: GSM High Performance ATM Card Security System

More than 3 times the user or others access the ATM in Wrong code then the message will go to Police station, like ATM Number and address and ID number.

2) Out of coverage SMS Unit

Some time your giving ATM card to others to take money

But you’re going out of coverage then you to send before the amount details to ATM.

It will allow to transfer the amount

3) Theft SMS Police information Unit

Any thief will attack you to take money from ATM , then you have to type reverse password

ATM will communicate to nearest Police station

To safe your money securely

3. H/W Requirements:1) PIC16F877A2) RS2323) GSM FBUS - Protocol

4. S/W Requirements:1) C and MS XL2) CCS3) OS – Windows

4

Page 5: GSM High Performance ATM Card Security System

5

Page 6: GSM High Performance ATM Card Security System

6

Page 7: GSM High Performance ATM Card Security System

7

Page 8: GSM High Performance ATM Card Security System

AT89C2051 Features

• Compatible with MCS-51™ Products

• 2K Bytes of Reprogrammable Flash Memory

– Endurance: 1,000 Write/Erase Cycles

• 2.7V to 6V Operating Range

• Fully Static Operation: 0 Hz to 24 MHz

• Two-Level Program Memory Lock

• 128 x 8-Bit Internal RAM

• 15 Programmable I/O Lines

• Two 16-Bit Timer/Counters

• Six Interrupt Sources

• Programmable Serial UART Channel

• Direct LED Drive Outputs

8

Page 9: GSM High Performance ATM Card Security System

• On-Chip Analog Comparator

• Low Power Idle and Power Down Modes

DescriptionThe AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with2K Bytes of Flash programmable and erasable read only memory (PEROM). Thedevice is manufactured using Atmel’s high density nonvolatile memory technologyand is compatible with the industry standard MCS-51™ instruction set. By combininga versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerfulmicrocomputer which provides a highly flexible and cost effective solution tomany embedded control applications.

The AT89C2051 provides the following standard features: 2K Bytes of Flash, 128bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interruptarchitecture, a full duplex serial port, a precision analog comparator, on-chip oscillatorand clock circuitry. In addition, the AT89C2051 is designed with static logic for operationdown to zero frequency and supports two software selectable power savingmodes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serialport and interrupt system to continue functioning. The Power Down Mode saves theRAM contents but freezes the oscillator disabling all other chip functions until the next

hardware reset.

9

Page 10: GSM High Performance ATM Card Security System

10

Page 11: GSM High Performance ATM Card Security System

PIC16F877A

High-Performance RISC CPU:

• Only 35 single-word instructions to learn• All single-cycle instructions except for programbranches, which are two-cycle• Operating speed: DC – 20 MHz clock inputDC – 200 ns instruction cycle• Up to 8K x 14 words of Flash Program Memory,Up to 368 x 8 bytes of Data Memory (RAM),Up to 256 x 8 bytes of EEPROM Data Memory• Pinout compatible to other 28-pin or 40/44-pinPIC16CXXX and PIC16FXXX microcontrollers

Peripheral Features:

• Timer0: 8-bit timer/counter with 8-bit prescaler• Timer1: 16-bit timer/counter with prescaler,can be incremented during Sleep via externalcrystal/clock• Timer2: 8-bit timer/counter with 8-bit periodregister, prescaler and postscaler• Two Capture, Compare, PWM modules- Capture is 16-bit, max. resolution is 12.5 ns- Compare is 16-bit, max. resolution is 200 ns- PWM max. resolution is 10-bit• Synchronous Serial Port (SSP) with SPI™(Master mode) and I2C™ (Master/Slave)• Universal Synchronous Asynchronous ReceiverTransmitter (USART/SCI) with 9-bit addressdetection

11

Page 12: GSM High Performance ATM Card Security System

• Parallel Slave Port (PSP) – 8 bits wide withexternal RD, WR and CS controls (40/44-pin only)• Brown-out detection circuitry forBrown-out Reset (BOR)

Analog Features:• 10-bit, up to 8-channel Analog-to-DigitalConverter (A/D)• Brown-out Reset (BOR)• Analog Comparator module with:- Two analog comparators- Programmable on-chip voltage reference(VREF) module- Programmable input multiplexing from deviceinputs and internal voltage reference- Comparator outputs are externally accessible

CMOS Technology:• Low-power, high-speed Flash/EEPROM technology• Fully static design• Wide operating voltage range (2.0V to 5.5V)• Commercial and Industrial temperature ranges• Low-power consumption

PIC16F877A

12

Page 13: GSM High Performance ATM Card Security System

MAX232

13

Page 14: GSM High Performance ATM Card Security System

Description

The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept 30-V inputs. Eachdriver converts TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments LinASIClibrary.

A Introduction to Nokia F-Bus

Disclaimer:The author takes no responsibility for the use of this information. Some commandscan be very hazardous to your phone and can make your phone useless! Use at your

14

Page 15: GSM High Performance ATM Card Security System

own risk, but have fun! Please Note: No Nokia fones were injured or kill in the production of this page!!

Most Nokia phones have F-Bus and M-Bus connections that can be used to connect aphone to a PC or in our case a microcontroller. The connection can be used forcontrolling just about all functions of the phone, as well as uploading new firmware etc.This bus will allow us to send and receive SMS messages. Want to turn your airconditioneron remotely?

The very popular Nokia 3310/3315 has the F/M Bus connection under the battery holder.This is a bit of a pain to get to and requires a special cable to make the connection. Theleft picture above shows the 4 gold pads used for the F and M Bus. The right pictureshows the F-Bus cable connected to my Nokia 3310.

15

Page 16: GSM High Performance ATM Card Security System

Nokia download cables are available from most mobile phone shops and some electronicsstores. I brought my cable from Dick Smith electronics in Australia. The cost of theNokia 3310 download cable is around $30AUD and is an excellent investment to get themost out of your phone. You can use PC software like Logomanager and Oxygen PhoneManager (See links below) to upload ringtones, graphics, phone numbers etc. No morepaying for those cool ringtones, just download them off the internet or record your own! Ihave even designed a ringtone doorbell, just what every house needs! The cable containselectronics to level convert 3V signals to RS232 type signals. There are also M and F busswitching in most cables.Some pages have schematics for making your own cable, however I think it's easier tobuy one, as the phone connectors are very hard to come by.

The differences of M-

M-Bus is a one pin bi-directional bus for both transmitting and receiving data from thephone. It is slow (9600bps) and only half-duplex. Only two pins on the phone are used.

16

Page 17: GSM High Performance ATM Card Security System

One ground and one data. M-Bus runs at 9600bps, 8 data bits, odd parity, one stop bit.The data terminal ready (DTR) pin must be cleared with the request to send (RTS). Thispowers the electronics in the cable and I think it sets it for M-Bus operation.F-Bus is the later high-speed full-duplex bus. It uses one pin for transmitting data and onepin for receiving data plus the ground pin. Very much like a standard serial port. It is fast115,200bps, 8 data bits, no parity, one stop bit. For F-Bus the data terminal ready (DTR)pin must be set and the request to send (RTS) pin cleared.

The F-Bus is bi-directional serial type bus running at 115,200bps, 8 data bits. The serialcable contains electronics for level conversion and therefore requires power. The firstthing to do is supply power to the cable electronics and this is done by setting the DTR(Data Terminal Ready) pin and clearing the RTS (Request to Send) pin.Added 29-Dec-2003 - For all you microcontroller DIYer's out there, connect the DTR pinto a +3 to 12 Volt supply and RTS to a -3 to -12Volt supply. The easy way to achieve thisis by using a Max232 or similar transceiver for the RS232 TX and RX pins and thenconnecting the DTR pin on the serial cable to the V+ pin on the Max232. Do the same forthe RTS, however connect it to the V- pin on the Max232. The V+ and V- pins arederived from internal charge pumps that double the input voltage. ie. for a 5V Max232,the V+ will +10V and the V- will be -10V. I hope this clears up this issue for mostpeople!The next step is to synchronize the UART in the phone with your PC or microcontroller.This is done by sending a string of 0x55 or 'U' 128 times. Simple! The bus is now readyto be used for sending frames.The Nokia protocol has a series of commands that allow the user to make calls, send andget SMS messages and lots more. If you have not already go to The Linux Gnokii Projectand download the source code. This group has excellent documentation on the commandsused with different Nokia phones. This is great work guys! Please do not email me for theNokia Commands - If you want them download the Linux Gnokii Project SourceSample frame sent to my Nokia 3310 (showed as a Hex dump)Byte: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15Data: 1E 00 0C D1 00 07 00 01 00 03 00 01 60 00 72 D5

This sample frame is used to get the hardware and software version from a Nokia phone.It is a good starting point to test if our implementation of the protocol is working.Byte 0: All frames sent by cable will start with the character 0x1E first. This is the F-BusFrame ID. Cable is 0x1E and InfraRed is 0x1C.Byte 1: This is the destination address. When sending data, it's the phone's device IDbyte. In our case it's always 00 for the phone.Byte 2: This is the source address. When sending data, it's the PC's device ID byte. In ourcase it's always 0x0C (Terminal).Byte 3: This is the message type or 'command'. 0xD1 is Get HW & SW version.Byte 4 & 5: Byte 4 & 5 is the message length. In our case it is 7 bytes long. Byte 4 is theMSB and byte 5 is the LSB. Thanks to Ron Reiter for comfirming this!Byte 6: The data segment starts here and goes for 7 bytes in our case. As The Nokia is a16 bit phone and therefore requires an even number of bytes. As ours is odd the last bytewill be a padding byte and the message will end at location 13.

17

Page 18: GSM High Performance ATM Card Security System

The last byte in the data segment (Byte 12 above) is the sequence number. The last 3 bitsof this byte increments from 0 to 7 for each frame. This part needs to be sent back to thephone in the acknowledge frame. The other bits I am unsure about what they mean!Bytes 14 & 15: The second to last byte is always the odd checksum byte and the last byteis the even checksum byte. The checksum is calculated by XORing all the odd bytes andplacing the result in the odd Checksum location and then XORing the even bytes andthen placing the result in the even byte.Well that is our first frame for our Nokia Phone. If the phone received it is show replywith the following data1E 0C 00 7F 00 02 D1 00 CF 711E 0C 00 D2 00 26 01 00 00 03 56 20 30 34 2E 34 35 0A 32 31 2D 30 36 2D30 31 0A 4E 48 4D 2D 35 0A 28 63 29 20 4E 4D50 2E 00 01 41 3F A4

The first line is an Acknowledge command frame. Notice how the destination and sourceaddresses are now swapped. This is because the Nokia phone is now talking. Thismessage is two bytes long with the two bytes representing the message type received(0xD1) and the sequence number (0x00). The last two bytes are the checksum and shouldbe checked to make sure the data is correct. The 3310 will be waiting for an acknowledgeframe after these two frames were sent. If the acknowledge frame is not sent the 3310will retry sending the data. The 3310 will only send the data 3 times and then gives up.The second frame from our Nokia 3310 is the data we requested. The message type is0xD2. This is 'receive Get HW&SW version'. This 38-byte (0x26) message should show0x0003 "V " "firmware\n" "firmware date\n" "model\n" "(c)NMP." The last byte in thedata is the sequence number. As with standard F-bus frames, the last two bytes in theframe are checksum bytes.The received data without f-bus frame01 00 00 03 56 20 30 34 2E 34 35 0A 32 31 2D 30 36 2D 30 31 0A 4E 48 4D2D 35 0A 28 63 29 20 4E 4D 50 2E 00 01 410003 V 0 4 . 4 5 \n 2 1 / 0 6 / 0 1 \n N H M- 5 \n ( c ) N M P . Sequence no.

All that is required now is to send a acknowledge frame back to the phone to say 'I got it!'1E 00 0C 7F 00 02 D2 01 C0 7C

0x7F is the acknowledge frame's command. We are only required to send a two-bytemessage so length is set to 0x02. The message contains the acknowledged message type(0xD2) and the sequence no. (0x01). The sequence number is made from the last 3 bits ofthe sequence number in the previous frame. The checksum needs to be calculated andsent.

How to send a SMS message with F-Bus?Now that we know how to send frames on the bus, we should look at sending an SMSmessage. It is not a hard process, once you can pack the message into 7-bit characters!

The first thing you should do is download GSM 03.38 - Alphabets and language-specificinformation. This is the Technical Specification that describes the packing of 7-bitcharacters and shows the standard character map. Packing ASCII into 7-bit characters is a

18

Page 19: GSM High Performance ATM Card Security System

pain, but is quite easy to do. Here is a quick example.Let's say we want to decode the string 'hello'. First I have displayed 'hello' in hexadecimalusing the character map provided in GSM 03.38. For A to Z and numbers its just thestandard ASCII conversion.h e l l o (ASCII characters)68 65 6C 6C 6F (In hexadecimal)1101000 1100101 1101100 1101100 1101111 (In Binary)

When dealing with binary, it makes life easier to write everything backwards. The firstbyte in the string is on the right. The least significant bit is then displayed on the left withthe most significant bit on the left. Shown below is the same string of 'hello' justdisplayed backwards. Then it's just a matter to dividing the binary values into bytesstarting with the first character in the string. (Start from right and go to left.) The firstdecoded byte is simply the first 7 bits of the first character with the first bit of the secondcharacter added to the end as shown below. The next decoded byte in then the remaining6 bits from the second character with two bits of the third byte added to the end. Thisprocess just keeps going until all characters are decoded. The last decoded byte is theremaining bits from the last character with the most significant bits packed with zeros.6F 6C 6C 65 681101111 1101100 1101100 1100101 1101000 (The ASCII characters shown inbinary)110 11111101 10011011 00110010 11101000 (The above binary just splitinto 8 bit segments)06 FD 9B 32 E8 (The 8 bit segments decoded intohex)

The message hello is therefore E8 32 9B FD 06 when packed.When playing with sending SMS messages a lot of decoding is required. Therefore Iwrote a few small programs to automatically pack and unpack the data for me. The firstprogram allows me to input the string to be packed in the top memo box and when thebutton 'Pack' is pressed the top string is packed ready to go!

19

Page 20: GSM High Performance ATM Card Security System

20

Page 21: GSM High Performance ATM Card Security System

21

Page 22: GSM High Performance ATM Card Security System

22

Page 23: GSM High Performance ATM Card Security System

TSOP1738

DescriptionThe TSOP17.. – series are miniaturized receivers for infraredremote control systems. PIN diode andpreamplifier are assembled on lead frame, the epoxypackage is designed as IR filter. The demodulated outputsignal can directly be decoded by a microprocessor.TSOP17.. is the standard IR remote control receiver series,supporting all major transmission codes.

Features

_ Photo detector and preamplifier in one package_ Internal filter for PCM frequency_ Improved shielding against electrical field disturbance_ TTL and CMOS compatibility_ Output active low_ Low power consumption_ High immunity against ambient light_ Continuous data transmission possible (1200 bit/s)

_ Suitable burst length 10 cycles/burst

23

Page 24: GSM High Performance ATM Card Security System

NE555

Features• High Current Drive Capability (200mA)• Adjustable Duty Cycle• Temperature Stability of 0.005%/C• Timing From Sec to Hours• Turn off Time Less Than 2Sec

Description

The LM555/NE555/SA555 is a highly stable controllercapable of producing accurate timing pulses. Withmonostable operation, the time delay is controlled by oneexternal resistor and one capacitor. With astable operation,the frequency and duty cycle are accurately controlled with

two external resistors and one capacitor.

Applications

• Precision Timing• Pulse Generation• Time Delay Generation• Sequential Timing

24

Page 25: GSM High Performance ATM Card Security System

25