You are on page 1of 25

INTRODUCTION

Today is the world of automation. When we are


talking about automation, we must think about
microcontroller.
Microcontroller finds its application in each and
every automation control like Remote controllers, Handheld communication devices, automatic and semiautomatic washing machines, security system, telephone
printing machines, automobiles, indicating and measuring
instruments.
The project described here being also a
microcontroller based project, used for security purpose,
the use of microcontroller in this
project is to store the data, process data and change data
according to the user requirement.
This is possible because microcontroller has CPU,
memory, I/O ports, timers/counters, ADC/DAC, serial
ports, interrupt logic, oscillator circuitry, and many more
functional blocks on single chip. Hence it reduces the cost
of hardware. Also there is no need to connect external
RAM for memory storage. This is the most important
feature of microcontroller.

There are various types of microcontrollers available


in market. The examples are Intel MCS-51, PIC family by
microchip, ATMEL 89CXX, 89CXX51. The microcontroller
used for this project is ATMEL-89C2051.
The code lock system described here uses a very
simple hardware.
The Device activates an output when correct access
code has been entered on a keypad. This code consists of
four digits in the range 0 to 9.
The code can be changed by the user and is also
remembered when the power is off. The circuit is
eminently suitable as an electronic door-lock, the
switching section of a burglar alarm or as an ignitionblocking device.

BLOCK DIAGRAM

Block Diagram of 4 Digit


Code Lock
HARDWARE DESCRIPTION
MICROCONTROLLER (89C2051)
Figure shows the block diagram of microcontroller,
which is a true computer on a single chip.
The AT89C2051 is a low-voltage, high-performance
CMOS 8-bit microcomputer with 2K Bytes of Flash
programmable and erasable read only memory (PEROM).
The device is manufactured using Atmels high
density nonvolatile memory technology and is compatible
with the industry standard MCS-51 instruction set.
By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C2051 is a powerful
microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.
The AT89C2051 provides the following standard
features: 2K Bytes of Flash, 128 bytes of RAM, 15 I/O
lines, two 16-bit timer/counters, a five vector two-level
interrupt architecture, a full duplex serial port, a precision
analog comparator, on-chip oscillator and clock circuitry.
In addition, the AT89C2051 is designed with static logic
for operation down to zero frequency and supports two
software selectable power saving modes.

The Idle Mode stops the CPU while allowing the


RAM, timer/counters, serial port and interrupt system to
continue functioning. The Power Down Mode saves the
RAM contents but freezes the oscillator disabling all other
chip functions until the next hardware reset.

Pin Configuration of
89c2051

VCC
P1.7
P1.6
P1.5
P1.4
P1.3
P1.2
P1.1
P1.0
P3.7

89c2051 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

On-Chip Analog Comparator

Low Power Idle and Power Down Modes

RELAY

Dimensions:
16*12.5*14 mm
1 PDT / DC 14V 20A
Low weight, high rating capacity up to 20A
High sensitive type 0.6W available

EEPROM

Features
Low-voltage and Standard-voltage Operation

2.7 (Vcc = 2.7V to 5.5V)


1.8(Vcc = 1.8VtoS.5V)
Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K),
1024x8(8K)or2048x8(16K)
Two-wire Serial Interface

Schmitt Trigger, Filtered Inputs for Noise Suppression


Bidirectional Data Transfer Protocol
100 kHz (1.8V) and 400 kHz (2.7V, 5V) Compatibility
Write Protect Pin for Hardware Data Protection
8-byte Page (IK, 2K), 16-byte Page (4K, 8K, 16K) Write Modes
Partial Page Writes Allowed
Self-timed Write Cycle (5 ms max)
High-reliability
Endurance: 1 Million Write Cycles
Data Retention: 100 Years
Automotive Grade and Lead-free/Halogen-free Devices Available 8-lead
PDIP, 8-lead JEDEC SOIC, 8-lead MAP, 5-lead SOT23, 8-lead TSSOP and
8-ball dBOA2 Packages Die Sales: Wafer Form, Waffle Pack and Bumped
Wafers.

Description
The AT24C01A/02/04/08A/16A provides 1024/2048/4096/8192/16384
bits of serial electrically erasable and programmable read-only memory
(EEPROM) organized as 128/256/512/1024/2048 words of 8 bits each. The
device is optimized for use in many industrial and commercial applications
where

low-power

and

low-voltage

operation

are

essential.

The

AT24C01A/02/04/08A/16A is available in space-saving 8-lead PDIP, 8-lead


JEDEC SOIC, 8-lead MAP, 5-lead SOT23 (AT24C01A/AT24C02/AT24C04),

8-lead TSSOP, and 8-ball dBGA2 packages and is accessed via a Two-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 Configuration
Pin Name

Function

AO-A2

Address Inputs

SDA

Serial Data

SCL

Serial Clock Input

WP

Write Protect

NC

No Connect

GND

Ground

VCC

Power Supply

OCTAL D LATCH WITH TRI-STATE OUTPUT


FUNCTIONAL DIAGRAM

General Description
The 'LS573 is a high speed octal latch with buffered common Latch Enable
(LE) and bull wed common Output Enable (OE] inputs.
This itovice is functionally identical to ttia 'LS373. but has different pinouts.
For truth table. discussion of operations and AC and DC specifications,
please refer to the 'LS373 data sheet.
Features
Inputs and outputs on opposite sides of package allowing easy interface
with microprocessors

Useful as Input or output port for microprocessors


Functionally identical to 'LS373
Input clamp diodes limit high speed termination effects
Fully TTL and CMOS compatible

Function Table

OUTPUT

Latch

Output

Enable

Enable

do

REGULATOR ( LM7805)

General Description

The LM78XX of three terminal regulators is available with several


fixed output voltages making them useful n a wide range of application. One
of these local on card regulation, eliminating the distribution problems
associated with single point regulation. The voltages available allow
these regulators to be used in logic systems, instrumentation HFi, and other
side slate electctronic equipment.

FEATURES
Suitable for C-MOS, TTL, the Other Digital IC's Power Supply.
Internal Thermal Overload Protection.
Internal Short Circuit Current Limiting.
Output Current in Excess of 1A.
Satisfies ffiC-66 Specification. (International Eectronical Commission).

MAXIMUM RATINGS (Ta=25t)

CHARACTERISTIC

SYMBOL RATING

KIA7805AP/API
KIA7815AP/API
Input Voltage

UMT

35
Vin

KIA7818AP/AHKIA7824AP/API

Vin
40

Power Dissipation (Tc=25l2)

PD

20.8

Power Dissipation
(Without Heatsink)

PD

2S

Operating Junction Temperature

T,

-30-150

T;

Storage Temperature

Tint

-55-150

KIA7805APIKIA7824API

KIA7805AP EQUIVALENT CIRCUIT

54LS245/DM54LS245/DM74LS245 TRI-STATE Octal Bus Transceive

These octal bus transceivers are designed for asynchro-TIGUS two-way communication between data buses. The control function implementation minimizes
external timing requirements.
The device allows data transmission from the A bus to the 8 bus or from the B bus to the A bus depending upon the logic level at the direction control (DIR) input.
The enable input (G) can be used to disable the device so that the buses are effectively isolated, j

Features
Bi-Directional bus transceiver in a high-density 20-pin package
TRI-STATE outputs drive bus lines directly
PNP inputs reduce DC loading on bus lines Hysteresis at bus inputs improve noise margins Typical propagation delay times, port-to-port 8 ns Typical
enable/disable times 17 ns IOL (sink current)
54LS
12 mA
74LS
24 mA IOH (source current)
54LS
-12 mA
74LS
-15mA
Alternate Military/Aerospace device (54LS245) is available. Contact a National Semiconductor Sales Office/ Distributor for specifications.

Function Table
Enable G

Direction
Control

Operation

DIR
L

B data to A bus

L
H

H
X

A data to B bus
Isolation

CIRCUIT DESCRIPTION

The code lock system described here uses a very simple hardware as shown
in the circuit diagram. IC1 and IC2 are bus driver and latch ICs, which are used
for transmitting and receiving data from microcontroller i.e. it is the interface
between microcontroller and keypad logic. At pin2 and 3 of microcontroller, relay
drivers using transistors are connected. IC5 is a regulator IC, which gives 5V
regulated power supply. Software is used to store code, process code according to
user requirement and gives output at corresponding port.
The device activates an output when correct access code has been entered
on a keypad. This code consists of four digits in the range 0 to 9. The code can be
changed by the user and is also remembered when the power is off. The circuit is
eminently suitable as an electronic door-lock, the switching section of a burglar
alarm or as an ignition-blocking device.
The output is inactive when the circuit is powered up or has been reset.
When the * key is pressed, followed by the 4-digit code, the output will go to the
5V level and the relay connected to pin3 of microcontroller will be energized. If
the code is incorrect, the wrong alarm LED connected to pin2 of microcontroller

will glow. Also relay will be energized which is connected to any noise-generated
device.
When the code lock is used for the first time, the access code is 1234. This
can be changed to, for example 4567 by first pressing 0 followed by #, then the
original code, then the new code. If something has gone wrong, the original code
remains valid and error signal will sound. The procedure for operation of the code
lock is given below.

How to open lock

1. Put on Power.
2. Press * key LOG-IN LED D3 will glow.
3. Now enter the old password.
4. If Code is correct SYS-ON LED D2 will glow & lock is open
5. If code is incorrect wrong alarm LED D1 will glow for 1 second.
6. Repeat above steps to try again.

How to change password

1. Press 0 key followed by # key to change the code.


2. LOG-IN LED starts flashing.
3. Now enter old code.
4. If it is correct, flashing stops and LED glows continuously.
5. Now enter new password.
6. Flashing LED will go off and code is accepted.
7. If code is incorrect, flashing stops and wrong alarm LED D1 glows for 1
Second.
8. To enter change mode again, repeat above steps.
9. After entering any mode, if no key pressed for 1 minute, program goes to
Normal mode automatically.

Advantages & Disadvantages


Advantages

1. Ease of handling.
2. Requires single +5V supply.
3. Almost all the devices/equipment can be secured.
4. Provides optimum level security.

Disadvantages
1. No visual digital feedback.
2. It is of no use, once the saved password has been forgotten

APPLICATION
1. Almost all the electrical instruments can be secured.

2. Can be used to secure automobiles also.


3. Can be implemented for industrial level.

You might also like