Digital Code Lock System - WWW - Booknstuff
Digital Code Lock System - WWW - Booknstuff
Digital Code Lock System - WWW - Booknstuff
2 BLOCK DIAGRAM 3
3 AT89C2051 MICROCONTROLLER 4
4 16X2 LCD 5
6 CIRCUIT DIAGRAM 8
7 RESULT 14
8 BIBLIOGRAPHY 14
INTRODUCTION:
I simple project with efficient hacking prevention from Brute Force etc. The basic
user lock is of 5 Digits and Master Lock is of 10 digits so its not easy for an
intruder to break the lock unless you keep the code simple.
The input is taken from a 4x3 Keypad (please see the schematic for more
information) and Display the user input on a 2x16 LCD. A pin is assigned as
output for activating and deactivating the lock. For demonstration I have connected
an LED to that pin.
USER ENTER
MASTER PASSWORD 3 USER ENTERS PASSWORD
PASSWORD TIMES PASSWORD INCORRECT
INCORRECT
PASSWORD
USER ENTER CORRECT
PASSWORD
LOCK OPEN
AND LED ON
AT 89C2051 MICROCONTROLLER
PIN DESCRIPTION
16X2 LCD
The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or
other which are compatible with HD44580. In this tutorial, we will discuss about character based
LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit),
programming, special stuff and tricks you can do with these simple looking LCDs which can
give a new look to your application.
Pin Description
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs
which have only 1 controller and support at most of 80 characters, whereas LCDs supporting
more than 80 characters make use of 2 HD44780 controllers. Most LCDs with 1 controller has
14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED
connections). Pin description is shown in the table below.
Keypads are a part of HMI or Human Machine Interface and play really important
role in a small embedded system where human interaction or human input is
needed. Martix keypads are well known for their simple architecture and ease of
interfacing with any microcontroller. In this part of tutorial we will learn how to
interface a 4x4 matrix keypad with AVR and 8051 microcontroller. Also we will
see how to program then in Assembly and C.
So keeping this outline we can construct a keypad using simple SPST Switches as
shown below:
Now our keypad is ready, all we have to do is connect the rows and columns to a
port of microcontroller and program the controller to read the input.
There are many methods depending on how you connect your keypad with your
controller, but the basic logic is same. We make the coloums as i/p and we drive
the rows making them o/p, this whole procedure of reading the keyboard is called
scanning.
In order to detect which key is pressed from the matrix, we make row lines low one
by one and read the columns. Lets say we first make Row1 low, then read the
columns. If any of the key in row1 is pressed will make the corresponding column
as low i.e. if second key is pressed in Row1, then column2 will give low. So we
come to know that key 2 of Row1 is pressed. This is how scanning is done.
.
CIRCUIT DIAGRAM:
RESULT
When user enters correct password then lock system is deactivated and lock is
open. When user enters incorrect password then lock does not open and user has to
enter password again to open lock. If user enters incorrect password three times
then user has to enter master password which is 10 digit long and then password is
enter again to open the lock.
BIBLIOGRAPHY
Click the link below to download the code and other attachments