Professional Documents
Culture Documents
INTRODUCTION
As the time moves the life style of the persons has completely changed and there is no time for the people for micro management of every issue personally. So, this is the right time to provide some space to the technology into our lives for monitoring the issues which requires our personal presence for the things to happen. One among those issues which require our personal presence is attendance system. Paper based attendance system is not efficient and easy when dealing with large number of people. So our project aims in providing a very reliable and very user friendly solution to overcome this kind of problem. As we know the advancements in the Radio Frequency and GSM technologies and making use of those existing technologies we can design a device which is capable of identifying the arrival of student and forward an SMS to the corresponding parent. The basic idea of the system is to employ a unique RFID tag to each student. As soon as the student enters the college/ class entrance, the RF reader reads the identity number of the tag and informs the same to a micro controller and compares it with the identity number in the database and if any match is found then it sends message to the parent of the corresponding student. To design the entire system we require a microcontroller which acts as a medium of communication between the RF reader and the GSM modem. The major advantage of this system is the presence of the GSM modem enables the device to communicate with the target (parent) no matter where ever he/she was present on the globe.
2. POWER SUPPLY
The power supply unit is used to provide a constant 5V of DC supply from a 230V of AC supply. These 5V DC will acts as power to different standard circuits. It mainly uses 2 devices 1. Bridge wave rectifier 2. Voltage regulator
In this only two diodes are activated at a time i.e. D1 and D3 activate for positive cycle and D2 and D4 activates for negative half cycle. D2 and D4 convert negative cycle to positive cycle as it as negative supply and negative cycle as positive cycle at its output.
Figure 2.3: Voltage Regulator The capacitor C2 is used to get thee ripple voltage as input to regulator instead of full positive cycles. For some devices we require 12V/9V/4V Dc supply at that time we go for 7812/7809/7804 regulator instead of 7805 regulator
3. EMBEDDED SYSTEMS
3.1 Introduction To Embedded System:
A general-purpose definition of embedded systems is that they are devices used to control, monitor or assist the operation of equipment, machinery or plant. Embedded reflects the fact that they are an integral part of the system. All embedded systems include computers or microprocessors. Some of these computers are however very simple systems as compared with a personal computer. The simplest devices consist of a single microprocessor (often called a chip), which may itself be packaged with other chips in a hybrid systems or Application Specific Integrated Circuit (ASIC). Its input comes from a detector or sensor and its output goes to a switch or an activator which (for example) may start or stop the operation of a machine or, operating a value, may control the flow of fuel to an engine.
3.2 Processors:
Processors are the ones which performs some specific task or operation. These are divided in to several types like: 1. Digital Signal Processors. 2. Application Specific Integrated Circuits. 3. Micro Processors. 4. Micro Controllers.
3.2.3 Microprocessors:
These are the ones which perform arithmetic and logical operations.
Arithmetic and logical unit performs arithmetical and logical calculations. Control unit controls all the peripheral devices connected to the microprocessors. Memory is a one which is used to store some data or information. Best Example for a microprocessor will be our Personal Computer.
(c) Transport: Aero planes Trains and Buses. Marine craft (known cases include: radar mapping; ballast monitoring; cargo loading; ship main control system) Automobiles Fuel services. Air Traffic Control Systems. Signaling system. Radar Systems. Traffic Lights. Ticketing systems and Machines. Car Parking and other meters.
(d) Buildings and premises: Electrically supply- supply, measurement, control, protection. Backing lighting and generators. Fire control systems. Heating and ventilating systems. Lifts Elevators, escalators. Security Systems. Security Cameras. Door locks.
(g) Office systems and mobile management: Telephone systems Faxes and Copier. Time recording systems. Mobile telephones Still and Video Cameras.
(h) Banking, Finance and Commercial: Automated teller systems. Credit card Systems. Point of scale systems including scanner / cash systems.
The basic circuit diagram of the project as shown in the Fig4.2 describes the necessary connections that are to be made while designing the hardware module of the project. There are different hardware modules in this project. They are: 1. 8051 Microcontroller (AT89C51) 2. 16X2 LCD DISPLAY 3. Real Time Clock 4. Serial communication 5. RFID MODEM 6. GSM MODEM
7. LED and Switches
10
5. MICROCONTROLLERS
A microcontroller is an integrated chip with minimum required devices. The microcontroller includes a CPU: ALU, PC,SP and registers, RAM, ROM, I/O ports, and timers like a standard computer, but because they are designed to execute only a single specific task to control a single system, they are much smaller and simplified so that they can include all the functions required on a single chip.
A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
I/O ALU ACCUMULATOR REGISTERS INTERNAL RAM INTERNAL ROM STACK POINTER I/O PORTS INTERNAL CIRCUITS CLOCK CIRCUIT PROGRAM COUNTER TIMER/COUNTER PORTS
11
package,
8051 through 80C51GB / 80C51Sl. They invented the 8051 IS80C51/31 runs up to 40MHz 80C154, mask parts 87C748 thru 89c588, mostly old legacy 8051 parts from signetics.
13
7. It has full duplex asynchronous serial port. 8. It can support up to 64KB of external memory with the help of PC and DPTR. 9. It has 16-bit address bus. 10. Six interrupts with two priority levels -2 general purpose interrupts (INT0, INT1). -4 preprogrammed interrupt (Timer0, Timer1, Serial interrupt, Reset interrupt). 11. Wide range of frequency of operation (0 to 24 MHz). 12. It will operate on 5V dc supply. 13. It can support maximum of 500mA of current.
18: Port 1: Each of these pins can be used as either input or output. Also, pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer 2. 9: Reset Signal: High logical state on this input halts the MCU and clears all the registers. Bringing this pin back to logical state zero starts the program anew as if the power had just been turned on. In another words, positive voltage impulse on this pin resets the MCU. Depending on the device's purpose and environs, this pin is usually connected to the push-button, reset-upon-start circuit or a brown out reset circuit.
10-17: Port 3: As with Port 1, each of these pins can be used as universal input or output. However, each pin of Port 3 has an alternative function: Pin 10: RXD - Serial input for asynchronous communication or serial output for synchronous communication. Pin 11: TXD - Serial output for asynchronous communication or clock output for synchronous communication Pin 12: INT0 - Input for interrupt 0 Pin 13: INT1 - Input for interrupt 1 Pin 14: T0 - Clock input of counter 0 Pin 15: T1 - Clock input of counter 1 Pin 16: WR - Signal for writing to external (add-on) RAM memory
16
Pin 17: RD - Signal for reading from external RAM memory 18-19: X2 and X1: Input and output of internal oscillator. Quartz crystal controlling the frequency commonly connects to these pins. Capacitances within the oscillator mechanism (see the image) are not critical and are normally about 30pF. New MCUs work at frequencies from 0Hz to 50MHz+.
20: GND: Ground 21- 28: Port 2: If external memory is not present, pins of Port 2 act as universal input/output. If external memory is present, then these pins serve as the location of the higher address byte, i.e. addresses A8 A15
29: PSEN: MCU activates this bit (brings to low state) upon each reading of byte (instruction) from program memory. If external ROM is used for storing the program, PSEN is directly connected to its control pins.
30: ALE: Before each reading of the external memory, MCU sends the lower byte of the address register (addresses A0 A7) to port P0 and activates the output ALE. External register (74HCT373 or 74HCT375 circuits are common), memorizes the state of port P0 upon receiving a signal from ALE pin, and uses it as part of the address for memory chip
31: EA: Bringing this pin to the logical state zero designates the ports P2 and P3 for transferring addresses regardless of the presence of the internal memory. This means that even if there is a program loaded in the MCU it will not be executed.
32-39: Port 0: Similar to Port 2, pins of Port 0 can be used as universal input/output, if external memory is not used. If external memory is used, P0 behaves as address output
17
(A0 A7) when ALE pin is at high logical level, or as data output (Data Bus) when ALE pin is at low logical level. 40: VCC: Power +5V
On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself. External Code Memory is code (or program) memory that resides offchip. This is often in the form of an external EPROM. External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM. ROM memory: In this MCU contain 4 kilobytes of the flash memory on the chip. It is of EEPROM. We can use 12v to program MCU. This option is cost-effective only for large series. The main purpose of ROM is to store the programs to be executed.
18
RAM memory: RAM is used for storing temporary data and auxiliary results generated during the runtime. Apart from that, RAM comprises a number of registers: hardware counters and timers, I/O ports, buffer for serial connection, etc. With older versions, RAM spanned 256 locations, while new models feature additional 128 registers. First 256 memory locations form the basis of RAM (addresses 0 FFH) of every 8051 MCU. Locations that are available to the user span addresses from 0 to 7Fh, i.e. first 128 registers, and this part of RAM is split into several blocks as can be seen in the following figure.
The main purpose of RAM is to provide synchronization between ROM and CPU so as to increase the speed of microcontroller.
Bit Memory: The 8051, being a communications-oriented microcontroller, gives the user the ability to access a number of bit variables. These variables may be either 1 or 0. There are 128 bit variables available to the user, numbered 00h through 7Fh. Special Function Register (SFR) Memory: Special Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. It may appear that SFR is part of Internal Memory. However, when using
19
this method of memory access (it is called direct address), any instruction that has an address of 00h through 7Fh refers to an Internal RAM memory address; any instruction with an address of 80h through FFh refers to an SFR control register.
5.10 Timers:
The 8051 comes equipped with two timers, both of which may be controlled, set, read, and configured individually. The 8051 timers have three general functions: 1) Keeping time and/or calculating the amount of time between events, 2) Counting the events themselves, or 3) Generating baud rates for the serial port. Timer SFRs: The 8051 has two timers which each function essentially the same way. One timer is TIMER0 and the other is TIMER1. The two timers share two SFRs (TMOD and TCON) which control the timers, and each timer also has two SFRs dedicated solely to itself (TH0/TL0 and TH1/TL1).
Bit Name
Explanation of Function When this bit is set the timer will only run when INT1
Timer
GATE1 (P3.3) is high. When this bit is clear the timer will run 1 regardless of the state of INT1.
C/T1
When this bit is set the timer will count events on T1 1 (P3.5). When this bit is clear the timer will be
21
incremented every machine cycle. 5 4 T1M1 T1M0 Timer mode bit (see below) Timer mode bit (see below) When this bit is set the timer will only run when INT0 3 GATE0 (P3.2) is high. When this bit is clear the timer will run 0 regardless of the state of INT0. When this bit is set the timer will count events on T0 2 C/T0 (P3.4). When this bit is clear the timer will be 0 incremented every machine cycle. 1 0 T0M1 T0M0 Timer mode bit (see below) Timer mode bit (see below) 0 0 1 1
The Four bits (two for each timer) are used to specify a mode of operation. operation are: TxM1 0 0 1 1 . TxM0 0 1 0 1 Timer Mode 0 1 2 3 Description of Mode 13-bit Timer. 16-bit Timer 8-bit auto-reload Split timer mode
modes of
22
Bit Name
Bit Address
Explanation of Function
Timer
TF1
8Fh
Timer 1 Overflow. This bit is set by the microcontroller when Timer 1 overflows. Timer 1 Run. When this bit is set Timer 1 is turned on. When this bit is clear Timer 1 is off. Timer 0 Overflow. This bit is set by the microcontroller when Timer 0 overflows.
TR1 8Eh
TF0
8Dh
TR0 8Ch
Timer 0 Run. When this bit is set Timer 0 is turned on. When this bit is clear Timer 0 is off.
Only four bits of SFR are used for timers, the remaining four are used for interrupts.
23
Figure 6.1 JHD 162A Liquid Crystal Display The features of JHD 162A LCD is as follows: 16 Characters x 2 Lines 5x7DotswithCursor Built-in controller +5v Power Supply
24
Pin number 1 2 3
Symbol Level
I/O Function
Power supply (GND) Power supply (+5V) Contrast adjust 0= 1 = Data input 0 = Write to LCD module Instruction input
RS
0/1
R/W
0/1
6 7 8 9 10 11 12 13 14
I/O Data bus line 0 (LSB) I/O Data bus line 1 I/O Data bus line 2 I/O Data bus line 3 I/O Data bus line 4 I/O Data bus line 5 I/O Data bus line 6 I/O Data bus line 7 (MSB)
25
The pin description of the JHD 162A LCD without backlight is as shown in Table. If the LCD is having Backlight, then it will have two more pins with pin numbers 15 & 16 connected to VCC and GND respectively. 4-bit mode is best used when the speed required in an application and at least 10 I/O pins are available. 4-bit mode requires minimum 6 bits. To wire a Microcontroller to an LCD 4-bit mode, just the top 4-bits (DB4-7) are written as shown in the Figure below:
26
27
29
8. SERIAL COMMUNICATION
8.1Introduction:
All IBM PC and compatible computers are typically equipped with two serial ports and one parallel port. Although these two types of ports are used for communicating with external devices, they work in different ways.
30
The TD (transmit data) wire is the one through which data from a DTE device is transmitted to a DCE device. The TD line is kept in a mark condition by the DTE device when it is idle. DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS line. DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some serial devices use DTR and DSR as signals to simply confirm that a device is connected and is turned on.
RS 232: RS-232 stands for Recommend Standard number 232 . The full RS-232C standard specifies a 25-pin "D" connector of which 22 pins are used. Most of these pins are not needed for normal PC communications, and indeed, most new PCs are equipped with male D type connectors having only 9 pins.
RS-232 Level Converters: Almost all digital devices required either TTL or CMOS logic levels. Therefore the first step to connecting a device to the RS-232 port is to transform the RS-232 levels back into 0 and 5 Volts, this is done by RS-232 Level Converters.
31
8.4 MAX-232:
It includes a Charge Pump, which generates +10V and -10V from a single 5v supply. This I.C. also includes two receivers and two transmitters in the same package. This is handy in many cases when you only want to use the Transmit and Receive data Lines. You don't need to use two chips, one for the receive line and one for the transmit.
9.2.2 Readers:
The reader, sometimes called an interrogator or scanner, sends and receives RF data to and from the tag via antennae. A reader may have multiple antennae that are responsible for sending and receiving radio waves. The readers can be fixed or mobile, can read information stored on the tags and write information to them. This can be achieved without direct line of sight and in environments where traditional data collection could not operate. A major advantage is that information can be written to the tag multiple times so storing a history that travels with the article.
34
Once the signal from a transponder has been correctly received and decoded, algorithms can be applied to decide whether the signal is a repeat transmission and may then instruct the transponder to stop transmitting. This is known as Command Response Protocol and is used to circumvent the problem of reading multiple tags in a short span of time.
Printed barcode labels generally conform to the Universal Product Code standard (UPC) of product identification. RFID tags used to identify products in the supply chain serve the same purpose, so its often expeditious to explain RFID tags simply as electronic barcodes. Both RFID tags and barcode labels digitally convey information about objects. Currently, Class 1+ RFID tags are available with a digital memory of 96 bits, each bit being either logic 1 or a logic 0. Because alphanumeric characters (i.e., AtoZ and 09) each require 8 bits of memory, its possible to store 12 characters in an RFID tag (which isnt saying much). On the other hand those 96 bits represent a possible 79,228,162,514,264,300,000,000,000,000 (thats over 79.2 trillion) unique numerical identities. Or you could split the 96 bits into fields that each represents some characteristic of the object, creating a sort of family tree of objects.
35
36
When the power pulse has finished, the transponder immediately transmits back its data, using the energy stored within its capacitor as its power source. The data is picked up by the receiving antenna and decoded by the reader unit. Once all the data has been transmitted, the storage capacitor is discharged resetting the transponder to make it ready for the next read cycle. The period between transmission pulses is called sync time and lasts between 20ms and 50ms depending on the system set up.
The scanning antennas can be permanently affixed to a surface; handheld antennas are also available. They can take whatever shape you need; for example, you could build them into a door frame to accept data from persons or objects passing through. When an RFID tag passes through the field of the scanning antenna, it detects the activation signal from the antenna. That "wakes up" the RFID chip, and it transmits the information on its microchip to be picked up by the scanning antenna.
37
9.6 Advantages:
RFID technology permits no line of sight reading. Robustness and reliability under difficult environmental conditions. These tags can be read through water, snow, concrete, bricks, plastics, wood, and most non-metallic materials Available in a wide variety of physical forms, shapes, sizes and protective housings. RFID tags can be read at very high speeds. The tag need not be on the surface of the object (and is therefore not subject to wear). The read time is typically less than 100 milliseconds Large numbers of tags can be read at once rather than item by item.
9.7 Applications:
Principle areas of applications of RFID include: 1. Transportation 2. Manufacturing and processing. 3. Security. Texas Instruments Radio Frequency Identification (TI-RFid) Systems has introduced its new RFID tag for textile rental and dry cleaning applications. TI-RFid tags provide more accurate identification and greater accountability as well as improved handling through each stage of cleaning and processing to final customer delivery. RFID system allows booksellers to gain such information as the range of books a shopper has browsed, the number of times a particular title was picked up, and even the length of time spent flipping through pages. The shelves can scan the contents of the shelves and, via computer, alert store employees when supplies are running low or when theft is detected.
38
Good subjective speech quality Low terminal and service cost Support for international roaming Ability to support handheld terminals Support for range of new services and facilities Spectral efficiency ISDN compatibility And interaction with the integrated service digital network (ISDN) which offers the
capability to extend the single-subscriber line system with the various to a multiservice system. The first commercial GSM system, called D2, was implemented in Germany in 1982.This valuable channel of communication can equip us with a powerful tool for controlling desired device or process parameter from distant location, through electromagnetic waves. With a little effort logic can be setup to even receive a feedback on the status of the device or the process being controlled.
39
interface or radio link. The Base Station Subsystem communicates with the Mobile services Switching Center across the A interface.
40
provides all the functionality needed to handle a mobile subscriber, such as registration, authentication, location updating, handovers, and call routing to a roaming subscriber.
Mobile Transport vehicles. LAN based SMS servers Alarm notification of critical events including Servers Network Monitoring and SMS reporting Data Transfer applications from remote locations Monitor and control of Serial services through GSM Network Integration to custom software for Warehouse, Stock, Production. AMR- Automatic Meter Reading and many more
Serial Port D-Type 9 pin connector which is male on the back of the GSM modem, thus you will require a female connector on your device. Below is a table of pin connections for the 9 pin DType connector.
Pin No. Abbreviation Full Name Pin 3 Pin 2 Pin 7 Pin 8 Pin 6 Pin 5 Pin 1 Pin 4 Pin 9 TD RD RTS CTS DSR SG CD DTR RI Transmit Data Receive Data Request To Send Clear To Send Data Set Ready Signal Ground Carrier Detect Data Terminal Ready Ring Indicator
Minute, Second and Time Zone [quarters of an hour] ) <fo> First Octet, coded like SMS-SUBMIT first octet in document [4], default value is 17 for SMS-SUBMIT <Index> <length> Place of storage in memory. Text mode (+CMGF=1): number of characters PDU mode (+CMGF=0): length of the TP data unit in octets <mem1> <mem2> <mid> <mr> <oa> <pid> <pdu> Memory used to list, read and delete messages (+CMGL, +CMGR and +CMGD). Memory used to write and send messages (+CMGW, +CMSS). CBM Message Identifier. Message Reference. Originator Address. Protocol Identifier. For SMS : GSM 04.11 SC address followed by GSM 03.40 TPDU in hexadecimal format, coded as specified in doc [4] For CBS : GSM 03.41 <ra> <sca> <scts> Recipient Address. Service Center Address Service Center Time Stamp in string format : yy/MM/dd,hh :mm :ss zz (Year/Month/Day, Hour: Min: Seconds Time Zone) <sn> <st> CBM Serial Number Status of a SMS-STATUS-REPORT
43
Status of message in memory. Type-of-Address of <oa>. Type-of-Address of <ra>. Type-of-Address of <sca>. Number of message locations in <mem1>. Number of messages locations in <mem2. Total number of messages locations in <mem1>. Total number of messages locations in <mem2. Validity Period of the short message, default value is 167
A message read with status REC UNREAD will be updated in memory with the status REC READ. Note : the <stat> parameter for SMS Status Reports is always READ.
The message reference, <mr>, which is returned to the application is allocated by the product. This number begins with 0 and is incremented by one for each outgoing message (successful and failure cases); it is cyclic on one byte (0 follows 255). Note: this number is not a storage number outgoing messages are not stored.
45
Leds are connect to the ports of microcontroller by using transistors and resisters. Transistor is used to decrease power dissipation and Leds are glow from external supply instead of microcontroller.
46
11.2 SWITCH
In this project Switch is used for editing of time and calendar
In electronics, a switch is an electronic electronics, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. The most familiar form of switch is a manually operated electromechanical device with one or more sets of electrical contacts. Each set of contacts can be in one of two states: either 'closed' meaning the contacts are touching and electricity can flow between them, or 'open', meaning the contacts are separated and non conducting. In this at the time of switch pressed (supply applied) the voltage across resister 8.2Kohms is VCC as capacitor is short circuit. And these switches are connected to LEDs by using microcontroller program. When we release the switch the capacitor get charges to VCC.
47
12.1 Introduction:
The software coding required to perform the control operations of AT89s52 micro controller developed was coded with the help of Keil Cx51 Complier package. Keil Cx51 Complier compiles the program written and checks for errors in the program. Then, the compiler generates a filename.hex file that can be burnt in EPROM of 89S52 Microcontroller. Finally the error free compiled filename.hex file was burnt into the CPU memory with the help of Keil Programmer.
12.3 Tools Used: Keil uv2 IDE. 12.3.1 Introduction To KeilCx51 Complier:
The Cx51 Complier package may be used on all 8051 family processors and is executable under the Windows 32-bit command line prompt. The C programming language is a generalpurpose programming language that provides code efficiency, elements of structured programming and a rich set of operators. C is not a big language and is not designed for a particular area of application. Some code of the C programming language and standard libraries are altered or enhanced as the peculiarities of an embedded processor.
After the compilation, the number of errors and warnings detected is the output to the screen. The Cx51 complier then sets the ERRORLEVEL to indicate the status of compilation. As shown below: ERRORLEVEL 0 1 2 3 MEANING No errors or warnings Warnings only Errors and possible warnings Fatal errors
50
Filename. I: Files with this extension contain the source text as expanded by the preprocessor. All macros are expanded and all comments are deleted in this listing. filename.SRC: Files with this extension are assembly source files generated from your C source code. These files can be assembled with the A51 assembler.
12.3.5 Debugging:
When micro-Vision2 IDH and the micro-Vision2 Debugger is being used, complete debug information is obtained when Options for Target - Output - Debug information is obtained. For command line tools the following rules apply. By default, the C51 complier uses the Intel Object Format (OFM2) for object files and generates complete symbol information. All Intel compatible emulators may be used for program debugging. The DEBG directive embeds debugging information in the object file. In addition, the OBJECTEXTEND directive embeds additional variable type information in the object file that allows type specific display of variables and structures when using certain emulators. The Cx51 complier uses the OFM2 object file format. The Cx51 complier also uses the OFM2 format when the directive OFM2 is active. The OFM2 format requires the extended Lx51 linker/locator and cannot be used with the BL51 linker/locator.
51
unsigned char read_i2c(unsigned char,unsigned char); void edit_hrs(unsigned char ,unsigned char,unsigned char); void edit_week(unsigned char ,unsigned char,unsigned char); void init_lcd(void); void cmd_lcd(unsigned char); void data_lcd(unsigned char); void display_lcd(unsigned char *); void delay_ms(int); void serial_send(unsigned char); void SEND_STR(unsigned char *); void send_data(void); void time(void); void edit_time(void);
char code *month[] = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NO V","DEC"}; unsigned char day[] = {31,28,31,30,31,30,31,31,30,31,30,31}; char code *week[] = {"SUN","MON","TUE","WED","THU","FRI","SAT"}; unsigned char key_code; char code *menu[] = {" EDIT TIME "};
53
void ext_int0(void) interrupt 0 { if(SEL == 0) key_code = 0x80; else if(INC == 0) key_code = 0x40; else if(DEC == 0) key_code = 0x20; else if(EXIT == 0) key_code = 0x10; while((P3 & 0xF0) != 0xF0); }
54
else { t_flag=1; TI=0; } } void main() { int i,sita,cm,suresh=0; init_lcd(); display_lcd(" cmd_lcd(0xC0); display_lcd("ATTANDACE SYSTEM "); delay_ms(100); cmd_lcd(0x01); SCON TMOD TH1 TR1 = 0x50; = 0x20; = -3; = 1; RFID BASED ");
55
56
display_lcd(buff); cmd_lcd(0x80); display_lcd("SENDING SMS........"); SEND_STR("AT+CMGS="); serial_send('"'); SEND_STR("917382374997"); serial_send('"'); SEND_STR("\r\n"); SEND_STR("D.VYSALI ID:08NT1A0411...IN"); serial_send(hour0); serial_send(hour1); serial_send(':'); serial_send(minute0); serial_send(minute1); SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); serial_send(mon0); serial_send(mon1); serial_send('/'); ");
57
serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); delay_ms(500); } else { cmd_lcd(0xc0); display_lcd(buff); cmd_lcd(0x80); display_lcd("SENDING SMS........"); SEND_STR("AT+CMGS="); serial_send('"'); SEND_STR("917382374997"); serial_send('"'); SEND_STR("\r\n"); SEND_STR("D.VYSALI ID:08NT1A0411...OUT"); serial_send(hour0); serial_send(hour1); serial_send(':');
58
serial_send(minute0); serial_send(minute1); SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); serial_send(mon0); serial_send(mon1); serial_send('/'); serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); delay_ms(500); cmd_lcd(0x01); } } else if(strcmp(buff,"41007641C0B6")) { strcpy(buff,"P.TEJA KUMAR"); sita=sita+1; ");
59
if(sita%2==1) { cmd_lcd(0xc0); display_lcd(buff); cmd_lcd(0x80); display_lcd("SENDING SMS........"); SEND_STR("AT+CMGS="); serial_send('"'); SEND_STR("919573477552"); serial_send('"'); SEND_STR("\r\n"); SEND_STR("P.TEJA KUMAR ID:08NT1A0438 ..IN"); serial_send(hour0); serial_send(hour1); serial_send(':'); serial_send(minute0); serial_send(minute1); SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); ");
60
serial_send(mon0); serial_send(mon1); serial_send('/'); serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); delay_ms(500); cmd_lcd(0x01); } else { cmd_lcd(0xc0); display_lcd(buff); cmd_lcd(0x80); display_lcd("SENDING SMS........"); SEND_STR("AT+CMGS="); serial_send('"'); SEND_STR("919573477552"); serial_send('"'); SEND_STR("\r\n");
61
SEND_STR("P.TEJA KUMAR ID:08NT1A0438 ..OUT"); serial_send(hour0); serial_send(hour1); serial_send(':'); serial_send(minute0); serial_send(minute1); SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); serial_send(mon0); serial_send(mon1); serial_send('/'); serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); delay_ms(500); cmd_lcd(0x01); } } ");
62
else if(strcmp(buff,"1C00A5A68E91")) { strcpy(buff,"K.NAVEEN KUMAR"); sita=sita+1; if(sita%2==1) { cmd_lcd(0xc0); display_lcd(buff); cmd_lcd(0x80); display_lcd("SENDING SMS........"); SEND_STR("AT+CMGS="); serial_send('"'); SEND_STR("919490009788"); serial_send('"'); SEND_STR("\r\n"); SEND_STR("K.NAVEEN KUMAR serial_send(hour0); serial_send(hour1); serial_send(':'); serial_send(minute0); serial_send(minute1); ID:09NT5A0403 ..IN");
63
SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); serial_send(mon0); serial_send(mon1); serial_send('/'); serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); delay_ms(500); cmd_lcd(0x01); } else { cmd_lcd(0xc0); display_lcd(buff); cmd_lcd(0x80);
");
64
serial_send('"'); SEND_STR("919490009788"); serial_send('"'); SEND_STR("\r\n"); SEND_STR("K.NAVEEN KUMAR serial_send(hour0); serial_send(hour1); serial_send(':'); serial_send(minute0); serial_send(minute1); SEND_STR(" serial_send(date0); serial_send(date1); serial_send('/'); serial_send(mon0); serial_send(mon1); serial_send('/'); serial_send(year0); serial_send(year1); SEND_STR("\r\n"); serial_send(0x1A); "); ID:09NT5A0403 ..OUT");
65
}while(key_code = 0x80);
if(i == 0) { edit_time(); }
66
} i = 1;
} } void init_lcd(void) { cmd_lcd(0x38); cmd_lcd(0x0C); cmd_lcd(0x06); cmd_lcd(0x01); } void cmd_lcd(unsigned char var) { LCD = ((var & 0xF0) | 0x08); LCD = 0; LCD = ((var << 4) | 0x08); LCD = 0; delay_ms(2); }
67
void data_lcd(unsigned char var) { LCD = ((var & 0xF0) | 0x0a); LCD = 0; LCD = ((var << 4) | 0x0a); LCD = 0; delay_ms(2); } void display_lcd(char *str) { while(*str) data_lcd(*str++); } void delay_ms(int cnt) { int i; while(cnt--) for(i=0;i<500;i++); } void time(void)
68
{ //unsigned char base_addr = 0x20; cmd_lcd(0x80); data_lcd((read_i2c(0xD0,0x02)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x02) % 0x10) + 0x30); hour0=(read_i2c(0xD0,0x02)/0x10)+0x30 ; hour1=(read_i2c(0xD0,0x02)%0x10)+0x30 ; data_lcd(':'); data_lcd((read_i2c(0xD0,0x01)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x01) % 0x10) + 0x30); minute0=((read_i2c(0xD0,0x01)/0x10) + 0x30); minute1=((read_i2c(0xD0,0x01)%0x10) + 0x30); data_lcd(':'); data_lcd((read_i2c(0xD0,0x00)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x00) % 0x10) + 0x30); display_lcd(" ");
69
data_lcd((read_i2c(0xD0,0x04)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x04) % 0x10) + 0x30); date0=((read_i2c(0xD0,0x04)/0x10) + 0x30); date1=((read_i2c(0xD0,0x04)%0x10) + 0x30); data_lcd('/'); data_lcd((read_i2c(0xD0,0x05)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x05) % 0x10) + 0x30); mon0=((read_i2c(0xD0,0x05)/0x10) + 0x30); mon1=((read_i2c(0xD0,0x05)%0x10) + 0x30); data_lcd('/'); data_lcd((read_i2c(0xD0,0x06)/0x10) + 0x30); data_lcd((read_i2c(0xD0,0x06) % 0x10) + 0x30); year0=((read_i2c(0xD0,0x06)/0x10) + 0x30); year1=((read_i2c(0xD0,0x06)%0x10) + 0x30); data_lcd(' '); data_lcd(' '); data_lcd(' '); data_lcd(' '); data_lcd(' '); data_lcd(' '); data_lcd(' ');
70
data_lcd(' '); data_lcd(' '); } void edit_time(void) { unsigned char var; flag=1; if(flag==1) { cmd_lcd(0x01); display_lcd("EDIT HRS : "); edit_hrs(0,23,02); } if(flag==1) { cmd_lcd(0x01); display_lcd("EDIT MINS"); edit_hrs(0,59,01); } if(flag==1) {
71
cmd_lcd(0x01); display_lcd("EDIT WEEK"); edit_hrs(0,6,3); } if(flag==1) { cmd_lcd(0x01); display_lcd("EDIT YEAR"); edit_hrs(0,99,6); } var = read_i2c(0xD0,0x06); if((var % 4) == 0) day[1] = 29; else day[1] = 28; if(flag==1) { cmd_lcd(0x01); display_lcd("EDIT MONTH"); edit_hrs(1,12,5); }
72
if(temp > MAX) temp = MIN; } else if(key_code == 0x20) { temp--; if(temp < MIN) temp = MAX; } } void SEND_STR(unsigned char *s) { while(*s) serial_send(*s++); } void serial_send(unsigned char buf) { t_flag= 0; SBUF = buf; while(t_flag == 0); }
74
14 FINAL OUTPUTS
In Ideal state, i.e. when no RFID tag is placed on the reader, the present date, time and calendar is displayed on the LCD screen.
75
76
15.1 CONCLUSION:
The project RFID AND GSM BASED STUDENT ATTENDANCE SYSTEM has been successfully designed and tested.
It has been developed by integrating features of all the hardware components used. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Thus the data to be sent is encoded within the transmitted signal so that a well designed receiver can separate the data from the signal upon reception of this signal. The decoded data can then be used to perform specified tasks.
Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.
This is a very useful technique over present conventional attendance systems. By using Microcontroller, we controlled the system according to zones .It is mainly useful in attendance system dealing with large number of people.
Finally by using these systems human work has been reduced and also errors in attendance system are also avoided.
77
15.1.1 Advantages:
It can also used in industries, colleges, police people, fire stations, hospitals. We can control the home appliances by sending a SMS to programmed home automation kit with coded instructions by the authenticated programmer simultaneously we will get a feedback and the status of the device. Since we have an option of Roaming Service provided by the GSM service providers hence we can get SMS at any place on the earth.
We can Switch ON/OFF the devices by sending a SMS from any place in the world. It is cheaper when compared to the other type of automation system. It is more effective when compared to the other type of automation system
15.1.2 Disadvantages:
It requires a continuous electrical power supply for its proper working We have to continuously recharge the GSM SIMCARD. Maintenance cost is high i.e. service charges are more per SMS. If the SIM gets damaged we need to reprogram with other number for security purposes because the cost depends on the service provider.
78
17 BIBLIOGRAPHIES
1. Design with PIC Microcontrollers-John B.Peatman, Pearson Education, 2005. 2. An Embedded System Primer-David E.Simon, Pearson Ed., 2005. 3. Wireless communications Principles & Practice-Theodore, S.Rappaport, PHI, 2ndEdn. 2002. 4. Mobile Cellular Telecommunocations-W.C.Y.Lee, MC Graw Hill, 2nd Edn, 1989.
REFERENCES
1. www.electronicstutorials.com 2. www.aimglobal.com 3. www.kernel.org 4. onlamp.com
79