You are on page 1of 63

INTRODUCTION

1. INTRODUCTION
This project is use to verify the student ID in collages. At presently printed card
based system is running in the collage. If student enter the class room
attendance is taken by manually in the book. In library book keeping inwards
and outwards maintain by manually. In exam hall ticket verified by manually.
This is all time wasting jobs. Our project eliminate all above told disadvantages.
And it also environment friendly system. Because there is no need paper book
keeping and in hall ticket and ID card there is no use of plastic laminations.

This low cost project can be directly implemented in real time, without any
much hardware alterations. Microcontroller PIC 16F877A is heart of the project
.We have used Assembly language to program our microcontroller. This is a
purely an embedded project.

.






SYSTEM
REQUIREMENTS







2. SYSTEM REQUIREMENTS
Following requirements have been identified after analysis:
Software Requirements
Hardware Requirements
2.1 SOFTWARE REQUIREMENTS
Protonix (integrated development environment) is a windows based front end
for assembler. Protonix is used for writing mc program .std libraries are
altered or enhanced to address the peculiarities of an embedded target processor.
Uploader Atmel Flash Programmer software is used to download program to
microcontroller At89C51.
2.2 HARDWARE REQUIREMENTS
Microcontroller PIC 16F877A:
This is an PIC Microcontroller which are using in our project
Memory 24C32:
This is an 8 pin DIP IC is used to store data like college ID, hall ticket etc



HARDWARE
IMPLEMENTATION

3.1 BLOCK DIAGRAM









DESCRIPTION
In memory card 2404 is programmed with student ID i.e., name, roll number,
photo and collage name. The microcontroller will read this information stored
in the memory IC and it is send to the RS 232 communicator IC. These data is
sending to the PC database. It is stored in notepad format. When student insert
the ID memory card in this system. The Pc data base record the in time and
student name. When student insert the Library Memory Card the data base will
show the book transactions. When student insert the Hall Ticket ID Memory
Card PC will show the student photo and incoming time. So by using this
system we can reduce lot of time wastage and paper and plastic consumption.

Power Supply
PC
RS232
Communicator
Microcontroller
89C51


Memory Card
24032

3.2 CIRCUIT DIAGRAM



COMPONENTS LIST

4. COMPONENTS LIST
1. SEMICONDUCTORS:
MICROCONTROLLER PIC 16F877A
MAX 232
MEMORY 24C32
REGULATOR IC7805
1N4007*4
LED
2. RESISTORS:
2k2
2k2
2k2
3. CAPACITORS:
22pF*2
0.1MF*2
1MF*4
1000MF
4. MISCELLANEOUS:
AC MAINS CORD
CRYSTAL 4MHz
SERIAL PORT
TRANSFORMER 12V





SYSTEM
SPECIFICATIONS

5.1 MICROCONTROLLER PIC 16F877A
MICROCONTROLLER CORE FEATURES
High-performance RISC CPU
Only 35 single word instructions to learn
All single cycle instructions except for program
branches which are two cycle
Operating speed: DC - 20 MHz clock input
DC - 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 the PIC16C73B/74B/76/77
Interrupt capability (up to 14 sources)
Eight level deep hardware stack
Direct, indirect and relative addressing modes
Power-on Reset (POR)
Power-up Timer (PWRT) and
Oscillator Start-up Timer (OST)
Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
Programmable code-protection
Power saving SLEEP mode
Selectable oscillator options
Low-power, high-speed CMOS FLASH/EEPROM technology
Fully static design
In-Circuit Serial Programming (ICSP) via two pins
Single 5V In-Circuit Serial Programming capability
In-Circuit Debugging via two pins
Processor read/write access to program memory
Wide operating voltage range: 2.0V to 5.5V
High Sink/Source Current: 25 mA
Commercial and Industrial temperature ranges
Low-power consumption:
< 2 mA typical @ 5V, 4 MHz
20 mA typical @ 3V, 32 kHz

PIN DIAGRAM


BLOCK DIAGRAM OF PIC 16F877A



MICROCONTROLLER FEATURES
Microcontrollers from different manufacturers have different architectures and
different capabilities. Some may suit a particular application while others may
be totally unsuitable for the same application.
SUPPLY VOLTAGE
Most microcontrollers operate with the standard logic voltage of _5V. Some
microcontrollers
can operate at as low as _2.7 V and some will tolerate _6 V without any
problems. You should check the manufacturers data sheets about the allowed
limits of the power supply voltage. A voltage regulator circuit is usually used to
obtain the required power supply voltage when the device is to be operated from
a mains adaptor or batteries. For example, a 5 V regulator is required if the
microcontroller is to be operated from a 5 V supply using a 9 V battery.
THE CLOCK
All microcontrollers require a clock (or an oscillator) to operate. The clock is
usually provided by connecting external timing devices to the microcontroller.
Most microcontrollers will generate clock signals when a crystal and two small
capacitors are connected. Some will operate with resonators or external
resistorcapacitor pair. Some microcontrollers have built-in timing circuits and
they do not require any external timing components. If your application is not
time-sensitive you should use external or internal (if available) resistor
capacitor timing components for simplicity and low cost. An instruction is
executed by fetching it from the memory and then decoding it. This usually
takes several clock cycles and is known as the instruction cycle. In PIC
microcontrollers an instruction cycle takes four-clock periods. Thus, the
microcontroller is actually operated at a clock rate which is a quarter of the
actual oscillator frequency.
TIMERS
Timers are important parts of any microcontroller. A timer is basically a counter
which is driven either from an external clock pulse or from the internal
oscillator of the microcontroller. A timer can be 8-bits or 16-bits wide. Data can
be loaded into a timer under program control and the timer can be stopped or
started by program control. Most timers can be configured to generate an
interrupt when they reach a certain count (usually when they overflow). The
interrupt can be used by the user program to carry out accurate-timing-related
operations inside the microcontroller. Some microcontrollers offer capture and
compare facilities where a timer value can be read when an external event
occurs, or the timer value can be compared to a preset value and an interrupt can
be generated when this value is reached. It is typical to have at least one timer in
every microcontroller. Some microcontrollers may have two, three, or even
more timers where some of the timers can be cascaded for longer counts.
WATCHDOG
Most microcontrollers have at least one watchdog facility. The watchdog is
basically a timer which is refreshed by the user program and a reset occurs if the
program fails to refresh the watchdog. The watchdog timer is used to detect a
system problem, such as the program being in an endless loop. A watchdog is a
safety feature that prevents runaway software and stops the microcontroller
from executing meaningless and unwanted code. Watchdog facilities are
commonly used in real-time systems where it is required to regularly check the
successful termination of one or more activities.
RESET INPUT
A reset input is used to reset a microcontroller. Resetting puts the
microcontroller into a known state such that the program execution starts from
address 0 of the program memory. An external reset action is usually achieved
by connecting a push-button switch to the reset input such that the
microcontroller can be reset when the switch is pressed.
INTERRUPTS
Interrupts are very important concepts in microcontrollers. An interrupt causes
the microcontroller to respond to external and internal (e.g. a timer) events very
quickly. When an interrupt occurs the microcontroller leaves its normal flow of
program execution and jumps to a special part of the program, known as the
Interrupt Service Routine (ISR). The program code inside the ISR is executed
and upon return from the ISR the program resumes its normal flow of
execution. The ISR starts from a fixed address of the program memory. This
address is also known as the interrupt vector address. For example, in a
PIC16F84 microcontroller the ISR starting address is 4 in the program memory.
Some microcontrollers with multi-interrupt features have just one interrupt
vector address, while some others have unique interrupt vector addresses, one
for each interrupt source. Interrupts can be nested such that a new interrupt can
suspend the execution of another interrupt. Another important feature of a
microcontroller with multi-interrupt capability is that different interrupt sources
can be given different levels of priority.
BROWN-OUT DETECTOR
Brown-out detectors are also common in many microcontrollers and they reset a
microcontroller if the supply voltage falls below a nominal value. Brown-out
detectors are safety features and they can be employed to prevent unpredictable
operation at low voltages, especially to protect the contents of EEPROM-type
memories.
ANALOGUE-TO-DIGITAL CONVERTER
An analogue-to-digital converter (A/D) is used to convert an analogue signal
such as voltage to a digital form so that it can be read by a microcontroller.
Some microcontrollers have built-in A/D converters. It is also possible to
connect an external A/D converter to any type of microcontroller. A/D
converters are usually 8-bits, having 256 quantisation levels. Some
microcontrollers have 10-bit A/D converters with 1024 quantisation levels.
Most PIC microcontrollers with A/D features have multiplexed
The A/D conversion process must be started by the user program and it may
take several hundreds of microseconds for a conversion to complete. A/D
converters usually generate interrupts when a conversion is complete so that the
user program can read the converted data quickly. A/D converters are very
useful in control and monitoring applications since most sensors (e.g.
temperature sensor, pressure sensor, force sensor, etc.) produce analogue output
voltages.
SERIAL I/O
Serial communication (also called RS232 communication) enables a
microcontroller to be connected to another microcontroller or to a PC using a
serial cable. Some microcontrollers have built-in hardware called USART
(Universal SynchronousAsynchronous ReceiverTransmitter) to implement a
serial communication interface. The baud rate and the data format can usually
be selected by the user program. If any serial I/O hardware is not provided, it is
easy to develop software to implement serial data communication using any I/O
pin of a microcontroller. Pro statements to send and receive serial data from any
pin of a PIC microcontroller. Some microcontrollers incorporate SPI (Serial
Peripheral Interface) or I2C (Integrated Inter Connect) hardware bus interfaces.
These enable a microcontroller to interface to other compatible devices easily.
EEPROM DATA MEMORY
EEPROM type data memory is also very common in many microcontrollers.
The advantage of an EEPROM memory is that the programmer can store non-
volatile data in such a memory, and can also change this data whenever
required. For example, in a temperature monitoring application the maximum
and the minimum temperature readings can be stored in an EEPROM memory.
Then, if the power supply is removed for whatever reason, the values of the
latest readings will still be available in the EEPROM memory. PicBasic and
PicBasic Pro languages provide special instructions for reading and writing to
the EEPROM memory of a microcontroller which has such memory built-in.
Some microcontrollers have no built-in EEPROM memory, some provide only
16 bytes of EEPROM memory, while some others may have as much as 256
bytes of EEPROM memories.
LCD DRIVERS
LCD drivers enable a microcontroller to be connected to an external LCD
display directly.
These drivers are not common since most of the functions provided by them can
be implemented in software.
ANALOGUE COMPARATOR
Analogue comparators are used where it is required to compare two analogue
voltages. Although these circuits are implemented in most high-end PIC
microcontrollers they are not common in other microcontrollers.
REAL-TIME CLOCK
Real-time clock enables a microcontroller to have absolute date and time
information continuously. Built-in real-time clocks are not common in most
microcontrollers since they can easily be implemented by either using a
dedicated real-time clock chip, or by writing a program.
SLEEP MODE
Some microcontrollers (e.g. PIC) offer built-in sleep modes where executing
this instruction puts the microcontroller into a mode where the internal
oscillator is stopped and the power consumption is reduced to an extremely low
level. The main reason of using the sleep mode is to conserve the battery power
when the microcontroller is not doing anything useful. The microcontroller
usually wakes up from the sleep mode by external reset or by a watchdog time-
out.
POWER-ON RESET
Some microcontrollers (e.g. PIC) have built-in power-on reset circuits which
keep the microcontroller in reset state until all the internal circuitry has been
initialised. This feature is very useful as it starts the microcontroller from a
known state on power-up. An external reset can also be provided where the
microcontroller can be reset when an external button is pressed.
LOW POWER OPERATION
Low power operation is especially important in portable applications where the
microcontroller based equipment is operated from batteries. Some
microcontrollers (e.g. PIC) can operate with less than 2 mA with 5 V supply,
and around 15_A at 3 V supply. Some other microcontrollers, especially
microprocessor-based systems where there could be several chips may consume
several hundred milliamperes or even more.
CURRENT SINK/SOURCE CAPABILITY
This is important if the microcontroller is to be connected to an external device
which may draw large current for its operation. PIC microcontrollers can source
and sink 25 mA of current from each output port pin. This current is usually
sufficient to drive LEDs, small lamps, buzzers, small relays, etc. The current
capability can be increased by connecting external transistor switching
INSTRUCTION SET





DESCRIPTION OF INSTRUCTION
ADDLW Add Literal and W
Syntax: [label] ADDLW k
Operands: 0 k 255
Operation: (W) + k (W)
Status Affected: C, DC, Z
Description: The contents of the W register are added to the eight bit literal k
and the result is placed in the W register.
ADDWF Add W and f
Syntax: [label] ADDWF f,d
Operands: 0 s f s 127 d e |0,1|
Operation: (W) + (f) (destination)
Status Affected: C, DC, Z
Description: Add the contents of the W register with register f. If d is 0, the
result
is stored in the W register. If d is 1, the result is stored back in register f.
ANDLW AND Literal with W
Syntax: [label] ANDLW k
Operands: 0 s k s 255
Operation: (W) .AND. (k) (W)
Status Affected: Z
Description: The contents of W register are ANDed with the eight bit literal 'k'.
The result is placed in the W register.
ANDWF AND W with f
Syntax: [label] ANDWF f,d
Operands: 0 s f s 127 d e |0,1|
Operation: (W) .AND. (f) (destination)
Status Affected: Z
Description: AND the W register with register 'f'. If 'd' is 0, the result is stored
in
the W register. If 'd' is 1, the result is stored back in register 'f'.
BCF Bit Clear f
Syntax: [label] BCF f,b
Operands: 0 s f s 127 0 s b s 7
Operation: 0 (f<b>)
Status Affected: None
Description: Bit 'b' in register 'f' is cleared.
BSF Bit Set f
Syntax: [label] BSF f,b
Operands: 0 s f s 127 0 s b s 7
Operation: 1 (f<b>)
Status Affected: None
Description: Bit 'b' in register 'f' is set.
BTFSS Bit Test f, Skip if Set
Syntax: [label] BTFSS f,b
Operands: 0 s f s 127 0 s b < 7
Operation: skip if (f<b>) = 1
Status Affected: None
Description: If bit b in register f is 0, the next instruction is executed. If bit
b is 1, then the next instruction is discarded and a NOP is executed instead
making this a 2TCY instruction.
BTFSC Bit Test, Skip if Clear
Syntax: [label] BTFSC f,b
Operands: 0 s f s 127 0 s b s 7
Operation: skip if (f<b>) = 0
Status Affected: None
Description: If bit b in register f is 1, the next instruction is executed. If bit
b, in register f, is 0, the next instruction is discarded, and a NOP is
executed instead, making
this a 2TCY instruction.
CALL Call Subroutine
Syntax: [ label ] CALL k
Operands: 0 s k s 2047
Operation: (PC)+ 1 TOS, k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
Status Affected: None
Description: Call Subroutine. First, return address (PC+1) is pushed onto the
stack. The eleven bit immediate address is loaded into PC bits <10:0>. The
upper bits of the PC are loaded from PCLATH. CALL is a two cycle
instruction.
CLRF Clear f
Syntax: [label] CLRF f
Operands: 0 s f s 127
Operation: 00h (f) 1 Z
Status Affected: Z
Description: The contents of register f are cleared and the Z bit is set.
CLRW Clear W
Syntax: [ label ] CLRW
Operands: None
Operation: 00h (W)
1 Z
Status Affected: Z
Description: W register is cleared. Zero bit (Z) is set.
CLRWDT Clear Watchdog Timer
Syntax: [ label ] CLRWDT
Operands: None
Operation: 00h WDT
0 WDT prescaler,
1 TO
1 PD
Status Affected: TO, PD
Description: CLRWDT instruction resets the Watchdog Timer. It also resets the
prescaler of the WDT. Status bits TO and PD are set.
COMF Complement f
Syntax: [ label ] COMF f,d
Operands: 0 s f s 127
d e [0,1]
Operation: (f) (destination)
Status Affected: Z
Description: The contents of register f are complemented. If d is 0, the result
is stored in W. If d is 1, the result is stored back in register f.
DECF Decrement f
Syntax: [label] DECF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) - 1 (destination)
Status Affected: Z
Description: Decrement register f. If d is 0, the result is stored in the W
register. If d is 1, the result is stored back in register f.
DECFSZ Decrement f, Skip if 0
Syntax: [ label ] DECFSZ f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) - 1 (destination);
skip if result = 0
Status Affected: None
Description: The contents of register f are decremented. If d is 0, the result is
placed in the W register. If d is 1, the result is placed back in register
f. If the result is 1, the next instruction is executed. If the result is 0, then a
NOP is executed instead making it a 2TCY instruction
GOTO Unconditional Branch
Syntax: [ label ] GOTO k
Operands: 0 s k s 2047
Operation: k PC<10:0>
PCLATH<4:3> PC<12:11>
Status Affected: None
Description: GOTO is an unconditional branch.The eleven bit immediate value
is loaded into PC bits <10:0>. The upper bits of PC are loaded from
PCLATH<4:3>. GOTO is a two cycle instruction.
INCF Increment f
Syntax: [ label ] INCF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) + 1 (destination)
Status Affected: Z
Description: The contents of register f are incremented. If d is 0, the result is
placed in the W register. If d is 1, the result is placed back in register f.
INCFSZ Increment f, Skip if 0
Syntax: [ label ] INCFSZ f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) + 1 (destination),
skip if result = 0
Status Affected: None
Description: The contents of register f are incremented. If d is 0, the result is
placed in the W register. If d is 1, the result is placed back in register f. If the
result is 1, the next instruction is executed. If the result is 0, a NOP is executed
instead making it a 2TCY instruction.
IORLW Inclusive OR Literal with W
Syntax: [ label ] IORLW k
Operands: 0 s k s 255
Operation: (W) .OR. k (W)
Status Affected: Z
Description: The contents of the W register are ORed with the eight bit literal
'k'. The result is placed in the W register.
IORWF Inclusive OR W with f
Syntax: [ label ] IORWF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (W) .OR. (f) (destination)
Status Affected: Z
Description: Inclusive OR the W register with register 'f'. If 'd' is 0 the result is
placed in the W register. If 'd' is 1 the result is placed back in register 'f'.
MOVF Move f
Syntax: [ label ] MOVF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) (destination)
Status Affected: Z
Description: The contents of register f are moved to a destination dependant
upon the status of d. If d = 0, destination is W register. If d = 1, the destination
is file register f itself. D = 1 is useful to test a file register since status flag Z is
affected.
MOVLW Move Literal to W
Syntax: [ label ] MOVLW k
Operands: 0 s k s 255
Operation: k (W)
Status Affected: None
Description: The eight bit literal 'k' is loaded into W register. The dont cares
will assemble as 0s.
MOVWF Move W to f
Syntax: [ label ] MOVWF f
Operands: 0 s f s 127
Operation: (W) (f)
Status Affected: None
Description: Move data from W register to register 'f'.
NOP No Operation
Syntax: [ label ] NOP
Operands: None
Operation: No operation
Status Affected: None
Description: No operation.
RETFIE Return from Interrupt
Syntax: [ label ] RETFIE
Operands: None
Operation: TOS PC, 1 GIE
Status Affected: None
RETLW Return with Literal in W
Syntax: [ label ] RETLW k
Operands: 0 s k s 255
Operation: k (W);
TOS PC
Status Affected: None
Description: The W register is loaded with the eight bit literal k. The program
counter is loaded from the top of the stack (the return address). This is a two
cycle instruction.
RETURN Return from Subroutine
Syntax: [ label ] RETURN
Operands: None
Operation: TOS PC
Status Affected: None
Description: Return from subroutine. The stack is POPed and the top of the
stack (TOS) is loaded into the program counter. This is a two cycle instruction.
RLF Rotate Left f through Carry
Syntax: [ label ] RLF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: See description below
Status Affected: C
Description: The contents of register f are rotated one bit to the left through
the Carry Flag. If d is 0, the result is placed in the W register. If d is 1, the
result is stored back in register f.
RRF Rotate Right f through Carry
Syntax: [ label ] RRF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: See description below
Status Affected: C
Description: The contents of register f are rotated one bit to the right through
the Carry Flag. If d is 0, the result is placed in the W register. If d is 1, the
result is placed back in register f.
SLEEP
Syntax: [ label] SLEEP
Operands: None
Operation: 00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected: TO, PD
Description: The power-down status bit, PD is cleared. Time-out status bit, TO
is set. Watchdog Timer and its prescaler are cleared. The processor is put into
SLEEP mode with the oscillator stopped.
SUBLW Subtract W from Literal
Syntax: [ label ] SUBLW k
Operands: 0 s k s 255
Operation: k - (W) (W)
Status Affected: C, DC, Z
Description: The W register is subtracted (2s complement method) from
theeight bit literal 'k'. The result is placed in the W register.
SUBWF Subtract W from f
Syntax: [ label ] SUBWF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f) - (W) (destination)
Status Affected: C, DC, Z
Description: Subtract (2s complement method) W register from register 'f'. If 'd'
is 0,the result is stored in the W register. If 'd' is 1, the result is stored back in
register 'f'.
SWAPF Swap Nibbles in f
Syntax: [ label ] SWAPF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Status Affected: None
Description: The upper and lower nibbles of register 'f' are exchanged. If 'd' is 0,
the result is placed in W register. If 'd' is 1, the result is placed in register 'f'.
XORLW Exclusive OR Literal with W
Syntax: [label] XORLW k
Operands: 0 s k s 255
Operation: (W) .XOR. k (W)
Status Affected: Z
Description: The contents of the W register are XORed with the eight bit literal
'k'. The result is placed in the W register.
XORWF Exclusive OR W with f
Syntax: [label] XORWF f,d
Operands: 0 s f s 127 d e [0,1]
Operation: (W) .XOR. (f) (destination)
Status Affected: Z
Description: Exclusive OR the contents of the W register with register 'f'. If 'd'
is 0, the result is stored in the W register. If 'd' is 1, the result is stored back in
register 'f'.
5.2 MEMORY 24C04/02
FEATURES
Low-Voltage and Standard-Voltage Operation
2.7 (VCC = 2.7V to 5.5V)
1.8 (VCC = 1.8V to 5.5V)
Low-Power Devices (ISB = 2 A at 5.5V) Available
Internally Organized 4096 x 8, 8192 x 8
2-Wire Serial Interface
Schmitt Trigger, Filtered Inputs for Noise Suppression
Bidirectional Data Transfer Protocol
100 kHz (1.8V, 2.5V, 2.7V) and 400 kHz (5V) Clock Rate
Write Protect Pin for Hardware Data Protection
32-Byte Page Write Mode (Partial Page Writes Allowed)
Self-Timed Write Cycle (10 ms max)
High Reliability
Endurance: 1 Million Write Cycles
Data Retention: 100 Years
Automotive Grade and Extended Temperature Devices Available
8-Pin JEDEC PDIP, 8-Pin JEDEC SOIC, 8-Pin EIAJ SOIC,and 8-pin
TSSOP Packages
DESCRIPTION
The AT24C32/64 provides 32,768/65,536 bits of serial electrically erasable and
programmable read only memory (EEPROM) organized as 4096/8192 words of
8 bits each. The devices cascadable feature allows up to 8 devices to share a
common 2- wire bus. The device is optimized for use in many industrial and
commercial applications where low power and low voltage operation are
essential. The AT24C32/64 is available in space saving 8-pin JEDEC PDIP, 8-
pin JEDEC SOIC, 8-pin EIAJ SOIC, and 8-pin TSSOP (AT24C64) packages
and is accessed via a 2-wire serial interface. In addition, the entire family is
available in 2.7V (2.7V to 5.5V) and 1.8V (1.8V to 5.5V) versions.
PIN DESCRIPTION

BLOCK DIAGRAM

SERIAL CLOCK (SCL):
The SCL input is used to positive edge clock data into each EEPROM device
and negative edge clock data out of each device.
SERIAL DATA (SDA)
The SDA pin is bidirectional for serial data transfer. This pin is open-drain
driven and may be wire-O Red with any number of other open-drain or open
Collector devices.
DEVICE/PAGE ADDRESSES (A2, A1, A0):
The A2, A1 and A0 pins are device address inputs that are hard wired for the
AT24C01A and the AT24C02. As many as eight 1K/2K devices may be
addressed on a single bus system (device addressing is discussed in detail under
the Device Addressing section). The AT24C04 uses the A2 and A1 inputs for
hard wire addressing and a total of four 4K devices may be addressed on a
single bus system. The A0 pin is a no connect. The AT24C08 only uses the A2
input for hardwire addressing and a total of two 8K devices may be addressed
on a single bus system. The A0 and A1 pins are no connects. The AT24C16
does not use the device address pins which limits the number of devices on a
single bus to one. The A0, A1 and A2 pins are no connects.
WRITE PROTECT (WP)
The AT24C01A/02/04/16 has a Write Protect pin that provides hardware data
protection. The Write Protect pin allows normal read/write operations when
connected to ground (GND). When the Write Protect pin is connected to VCC,
the write protection feature is enabled.
MEMORY ORGANIZATION
AT24C32/64, 32K/64K SERIAL EEPROM: The 32K/64K is internally
organized as 256 pages of 32 bytes each. Random word addressing requires a
12/13 bit data word address.




5.3 POWER SUPPLY SECTION
One transformer is used in this section to powering the Micro Controller
section. This transformer is used to step down the 220 volts A.C mains supply
into 12 volts A.C supply. Current handling capacity of the transformer is 500
ma. The primary resistance of the transformer is about 700 ohms; secondary
resistance is about 4 ohms.
POWER SUPPLY REGULATION STAGE
This section is 4 bridge rectifier diode D1 to D4 identification No is 1N4007.
The current handling capacity of this diode is 1 amps and voltage handling
capacity is 1000 volts. These 4 diodes are used rectifier the low voltage i.e. 12
volt A.C into 12 volt D.C
Electrolytic capacitor 1000MF 63 volt is used to filter the unregulated D.C
voltage. By this capacitor D.C ripples are removed.
Two 0.1mF capacitors are used to remove the EMI noises.
LM7805 is used to regulate the unregulated D.C power.
78 means positive end regulations 05 stands for 5 volt regulation. Current
carrying capacity of this IC is 1 amp.

7805 VOLTAGE REGULATOR
3-TERMINAL 1A POSITIVE VOLTAGE REGULATOR
FEATURES
Output Current up to 1A
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating Area Protection
DESCRIPTION
The KA78XX/KA78XXA series of three-terminal positive regulator are
available in the TO-220/D-PAK package and with several fixed output voltages,
making them useful in a wide range of applications. Each type employs internal
current limiting, thermal shut down and safe operating area protection, making
it essentially indestructible. If adequate heat sinking is provided, they can
deliver over 1A output current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain
adjustable voltages and currents.

TO-220 D-PAK
1 1


1.Input 2. GND 3. Output


Internal Block Diagram


5.4 MAX 232 DRIVER
FEATURES
Meet or Exceed TIA/EIA-232-F and ITU
Recommendation V.28
Operate With Single 5-V Power Supply
Operate Up to 120 kbit/s
Two Drivers and Two Receivers
30-V Input Levels
Low Supply Current . . . 8 mA Typical
Designed to be Interchangeable With
Maxim MAX232
ESD Protection Exceeds JESD 22
2000-V Human-Body Model (A114-A)
APPLICATIONS
TIA/EIA-232-F
Battery-Powered Systems
Terminals
Modems
Computers
PIN DIAGRAM

PIN DESCRIPTION

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. Each driver converts TTL/CMOS input levels into EIA-
232 levels.



MAX 232 CONNECTIONS WITH MICROCONTROLLER AND
SERIAL PORT





SYSTEM WORKING

6.1 WORKING
CARD
We can divide the card in three major parts one receiving section, two
processing section, three transmitting section. The receiving section receives the
data & send to processing unit decides about the output for received data, now
the output data sent to the transmitting section.
RECEIVING SECTION
In this section we are use I2C type data transfer method. The output switches
between TTL leaves (5V or 0V) according to the condition of the data.
Although the O/P voltage level of the TTL logic but it cannot sink or source
much current so we need an amplifier with higher input impedance to reduce
the current drawn from memory IC.
Now this serial data is applied at the pin no. 2 of the microcontroller from this
pin microcontroller reads the data, test for the condition using software & send
the output (serial output) at pin no.26, flow chart shows the structure of the
software we developed.
Here we see that some other components are connected with microcontroller
there function are explained below.
4MHZ XTAL, microcontroller requires this produce the 4MHz clock for the
functioning of microcontroller the two 33 pF capacitors supports the OSC
Circuit.
Pin 11 and 32 of the micro controller is positive supply pin hence connected
with +5V, Pin 12 and 31 is grounded.
Pin 1 of micro controller is use to reset the microcontroller .
PC UNIT
The transmitting & receiving unit of this section work in same way as in card
but here we use the PC to show the details.
In our project we are using the serial port to communicate with PC & as we
know that on serial communication mode it uses the RS232 standard for which
logic 1 is assigned to a voltage less than 3V & logic 0 to greater than +3V
because Rx.,Tx. Sections & microcontroller provides the O/P at TTL level, we
use here MAX232 as level converter which have two TTL to RS232 converter
& two RS232 to TTL converter hence the O/P of serial port available at pin3 is
applied to one of the two RS232 to TTL converter & I/P to serial port is fed
through TTL to RS232 converter.
WORKING
When we switch ON supply voltage, AC is step-down into 12v AC and fed to
the bridge rectifier. Here it converts AC into unregulated DC. By using filter
capacitor (1000mF) line noises are suppressed. Two 0.1mF capacitors are used
to remove the noises generated by the circuit power sources. 7805 is voltage
regulator, is used limit or maintain 5v maximum. Current loading capacity is 1
amps, this powered to the microcontroller and RS 232. As soon as we connect
the RS232 port to the PC, microcontroller get acknowledge signal from the PC
i.e., GUI software (Graphic User Interface).
GUI software generates one hand shake signal to communicate with
microcontroller. When we insert the I2C memory chip in the socket, the ID card
information are transferred to the I2C bus. Microcontroller is also having one
built-in one memory chip. Resent user access the data are stored in the I2C
memory. From here it send the picture information in serial form to the PC.


6.2 FLOW CHART

6.3 PROGRAM
include "def.inc"
;_MCLRE_OFF EQU H'3FDF'
;_PWRTE_OFF EQU H'3FFF'
;_WDT_ON EQU H'3FFF'
;_LP_OSC EQU H'3FF8'
;_XT_OSC EQU H'3FF9'
;_HS_OSC EQU H'3FFA'
;_EC_OSC EQU H'3FFB'
;_INTRC_OSC_CLKOUT EQU H'3FFD'
;_EXTRC_OSC_NOCLKOUT EQU H'3FFE'
;_EXTRC_OSC_CLKOUT EQU H'3FFF'

org 00h
goto startup
org 04h
movwf w_temp
swapf status,w
clrf status
movwf status_temp
movf pclath,w
movwf pclath_temp
clrf pclath ;page zero regardless of current page
;************************************************************
bcf intcon,02
movlw .142
movwf tmr0

movf default_delta_tmr,f
btfsc status,z
goto int_default_delta_tmrx
decf default_delta_tmr,f
btfss status,z
goto int_default_delta_tmrx

movf set_delta_tmr,w
movwf delta_tmr
btfsc status,z
btfsc status,z
bsf led_delta_f
int_default_delta_tmrx:
movf delta_tmr,f
btfsc status,z
goto int_deltax

decf delta_tmr,f
btfsc status,z
btfsc status,z
bsf led_delta_f
int_deltax:
incf ms_cnt,f
movlw .242
subwf ms_cnt,w
btfss status,c
goto intx
clrf ms_cnt

; incf ms_cnt_h,f
; movlw .2
; subwf ms_cnt_h,w
; btfss status,c
; goto intx
; clrf ms_cnt_h
; after each 250 milli seconds

;********************************************************
movf star_default_tmr,f
btfsc status,z
goto int_star_default_tmrx
decf star_default_tmr,f
btfss status,z
goto int_star_default_tmrx

movf set_star_tmr,w
movwf star_tmr
btfsc status,z
goto load_delta_tmr
int_star_default_tmrx:
movf star_tmr,f
btfsc status,z
goto intx

decf star_tmr,f
btfss status,z
goto intx
load_delta_tmr:
bcf led_star_f
movlw .64 ;for 30 msec => 30/0.47=63.5
movwf default_delta_tmr
;************************************************************
intx:
movf pclath_temp,w
movwf pclath
swapf status_temp,w
movwf status
swapf w_temp,f
swapf w_temp,w
retfie

;*********************************************************************************
*************
startup: ;statrtup initialisation
clrf tmr0
call startup_init
;call atod_init

bsf intcon,gie ;_gie ;enable global int
bcf led_delta
bsf led_star
bcf led_delta_f
bsf led_star_f

;*********************************************************************************
*************
main:
clrwdt
btfsc led_star_f
bsf led_star
btfsc led_delta_f
bsf led_delta

btfss led_star_f
bcf led_star
btfss led_delta_f
bcf led_delta

goto main

;*********************************************************************************
***********
include "ini.inc"
end


startup_init:
clrf status
clrf ms_cnt
clrf ms100_cnt
;********************************initialise
porta************************************************
bsf status,rp0 ;bank1
movlw 0x30; ;frc osc
movwf adcon1
movlw 0x30; ;an4 & an5
movwf ansel

bcf led_delta
bcf relay_star
bcf led_star
bcf status,rp0 ;bank0
;*********************************************************************************
**********
;initialise timer 0 so that it generate ovf int after every 1msec
bsf status,rp0 ;bank1
bsf intcon,t0ie ;_toie
bcf intcon,t0if ; _toif
movlw 0x01 ;select internal instruction cycle clock,l to h clock increment, prescaler
1:4
movwf option_reg
bcf status,rp0 ;bank0
;**********************************************************************
bcf led_delta
bcf led_star
bcf led_delta_f
bsf led_star_f
bsf led_star


movlw 0x86
movwf temp1
movlw 0x02
movwf temp0
rrf temp0,f
rrf temp1,f
rrf temp0,f
rrf temp1,w

; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
; movlw .255
; call delay
;
movlw adch3 ;0x8d
movwf adcon0
movlw .30
movwf temp1
decfsz temp1,f ; WAIT FOR 90 MCYC
goto $-1
bsf adcon0,1
BTFSC adcon0,1
GOTO $-1
bsf _rp0
MOVF adresl,w
bcf _rp0
movwf temp1
MOVF adresh,w
movwf temp0


; movlw 0x7f
movwf set_star_tmr
movlw .8
movwf star_default_tmr
clrf star_tmr
ret_0_chk:
movlw adch1;0x95
movwf adcon0
movlw .30
movwf temp1
decfsz temp1,f ; WAIT FOR 90 MCYC
goto $-1
bsf adcon0,1
BTFSC adcon0,1
GOTO $-1
bsf _rp0
MOVF adresl,w
bcf _rp0
movwf temp1
MOVF adresh,w
movwf temp0
rrf temp0,f
rrf temp1,f
rrf temp0,f
rrf temp1,w
; movlw 0x7f
movwf set_delta_tmr

clrf default_delta_tmr
clrf delta_tmr
return
;****************************************************************
chk_4_zero:
movlw d'8'
subwf star_tmr,w
btfsc _c
goto ret_0_chk
movlw d'8'
movwf star_tmr
goto ret_0_chk
;****************************************************************
delay:
movwf temp1
d1:
movlw d'250'
movwf temp0
d2:
nop
decfsz temp0,f
goto d2
decfsz temp1
goto d1
return
;****************************************************************
list p=16f877a
include "p16f877a.inc"

__CONFIG _CP & _BODEN
&_MCLRE_Off&_PWRTE_ON&_WDT_OFF&_INTRC_OSC_NOCLKOUT;

cblock 20h

adres_l ;19
adres_h ;20
delta_tmr
star_tmr
set_star_tmr
set_delta_tmr
default_delta_tmr
star_default_tmr
ms_cnt
ms100_cnt
reg1
reg2
delay_reg
temp0
temp1
temp2
fg1
ms_cnt_h

status_temp
pclath_temp
endc



APPLICATIONS

7 APPLICATIONS
This card can be used for ATM, Credit Card, and Driving License etc.
Automatic Doors.
Attendance Counting.
Security System.
Infra Red Data Exchanging.
Reservation systems with railways & airways.
For sending important data through Card.



ADVANTAGES

8 ADVANTAGES
Accurate data management, time saving and environment friendly.
Preface : Presently there are many types of cards available such as punch cards,
magnetic cards, optical cards but all are having the disadvantage of performance
degradation as we use them.
Other disadvantages are:
1. They can not store much information.
2. They lose their data if placed under magnetic field or even on scratching.
3. There is no security to protect card data whereas in our card this is achieved
with the provision of passwords.
4. There is no Re-Writable memory for temporary data storage such as railway
reservation ticket.
The above-mentioned shortcomings are technical but there are user related
problems also when one needs to handle a large number of cards at a time to
obtain diverse information (Atm, Credit card, License, Voter Id. etc.). The user
is highly inconvenienced as he is required to change over the cards frequently,
so we have designed a card which combines information contained in a variety
of cards.. Card can also store specific data in RAM for temporary use such as
railway reservation, air bookings etc. we can also use the cards in automatic
doors fitted with sensors which read the card and open the door only for
authorized card holders.



LIMITATIONS

9 LIMITATIONS
It requires a battery source.
A separate Infra Red Card reader required.



CONCLUSION


10 CONCLUSION

This project work titled ELECTRONICS IDENTIFICATION AND PERSONAL
IINFORMATION CARD USING MICROCONTROLLER .Many user friendly
controls are added to make it very user interactive application. The circuits and
reports have been subjected to testing and have been successful.
This project has been developed in an attractive user interface fashion. So the
user with common knowledge about the computer can handle it very easily.
And this project is also environment friendly because there is no need of paper
book keeping and no need of plastic lamination for ID and hall ticket etc






FUTURE
ENHANCEMENT

11 FUTURE ENHANCEMENTS
We can replace the devices with SMD, which will reduce the size of card.
We can use photocells to dispense with battery source.
We can store images for identification of card holders.

You might also like