You are on page 1of 48

PASSWORD BASED DOOR LOCK

SYSTEM
A Minor Project Report

Submitted in partial fulfillment of the requirement for the award of Degree


of Bachelor of Engineering in “Electronics and Communication
Engineering”

Submitted To

RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA, BHOPAL


(M.P.)

MINOR PROJECT REPORT


Submitted By

Pavitra Chaudhary (0111EC151059) Pranjul Katiyar (0111EC151065)


Prateek Singh (0111EC151068)

Under the Supervision of


Prof. Saima Khan
Department of Electronics and Communication Engineering

TECHNOCRATS INSTITUTE OF TECHNOLOGY, BHOPAL

Session Nov-2018
1
TECHNOCRATS INSTITUTE OF TECHNOLOGY
Department of Electronics and Communication Engineering

DECLARATION

We (Pavitra Chaudhary, Pranjul Katiyar and Prateek Singh) students of Bachelor


of Engineering in Electronics and Communication Engineering Department,
TECHNOCRATS INSTITUTE OF TECHNOLOGY, BHOPAL, hereby declare that
the work presented in this Major Project is the outcome of our own work and is correct
to the best of our knowledge. This work has been carried out taking care of Engineering
Ethics.
The work presented does not infringe any patented work and has not been
submitted to any other University / Institute for the award of any Degree / Diploma of
any Professional Certificate.

Pavitra Chaudhary Pranjul Katiyar


(0111EC151059) (0111EC151065)

Prateek Singh
(0111EC151068)

Date:__/__/2018

2
TECHNOCRATS INSTITUTE OF TECHNOLOGY
Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the work embodies in this Minor Project entitled “PASSWORD
BASED DOOR LOCK SYSTEM” has been satisfactorily completed by Pavitra
Chaudhary(0111EC151059), Pranjul Katiyar(0111EC151065), Prateek
Singh(0111EC151068). The work has been carried out under my/our supervision and
guidance in the Department of Electronics and Communication Engineering,
TECHNOCRATS INSTITUTE OF TECHNOLOGY, Bhopal, for partial fulfillment
of the Bachelor of Engineering Degree during the academic year 2018-19.

Guided By
___________________
(Prof. Saima Khan)

Approved By Forwarded By

(Dr. Vikas Gupta) (Dr. Bhupendra Verma)


Headof Deptt. Director
Deptt.Of ECE TIT, Bhopal

3
ACKNOWLEDGEMENT

Indeed it is a matter of great felicity and priviledge for me to take an opportunity to work
under the guidance of Prof. Saima Khan in the department of Electronics and
Communication Engineering TIT, Bhopal who constantly guided, supported and
encouraged at every step of dissertation.

We would like to express my sincere thanks to Dr.BhupendraVerma, Director, TIT,


Bhopal for his kind co-operation and support.

We would like to acknowledge Dr. Vikas Gupta, HOD, Department of Electronics


and Communication Engineering for his guidance and great cooperation and support.

We would like to express my sincere thanks to , all Faculty members & Lab In-
charges of our Department for their kind cooperation & constant support.

We are thankful to our parents, friends etc, who helped me in one or other way during
the course of my study.

Pavitra Chaudhary (0111EC151059) Pranjul Katiyar (0111EC151065)

Prateek Singh (0111EC151068)

Place : TIT,Bhopal
Date :

4
ABSTRACT

Security is a prime concern in our day to day life. Everyone wants to be as much secure
as possible. An access control for door form a vital link in a security chain. The
microcontroller based Door is an access control system that allows only authorized
persons to access and restricted area. The system is fully controlled by 8 bit
microcontroller AT89C2051 which has to 2 kb of ROM for the program memory. The
password is stored in the memory. The system has a keypad by which the password can
be entered through it. When they enter password equal with the password stored in a
memory than the relay gets on and so that the door is opened. If we enter the wrong
password then the alarm is switched on. When we go inside and come back then the
microcontroller will automatically open the door for you.

5
TABLE OF CONTENTS
Abstract 5
List of Figures 7
List of Tables 8
CONTENT PAGE NO:
1. CODED DOOR LOCK 09-10
2. PRINCIPLE BEHIND THE CIRCUIT 10-12
3. COMPONENT DESCRIPTION (12-41)
 MICROCONTROLLER –AT89S52 12-15
 16X2 LCD 15-22
 L293D MOTOR DRIVER 23-24
 DC GEAR MOTOR 24-28
 5V/12V REGULATED DC POWERSUPPLY 28
 BRIDGE RECTIFIER 28-29
 SMOOTHING 29-30
 REGULATOR 31
 TRANFORMER 32-33
 DIODE 33-34
 LEDs 34-35
 LM7805 35-36
 CRYSTAL 12MHz 36
 RESET BUTTON 37
 IC BASE 38
 RESISTORS 38-41
4. IMPLEMENTATION {42-44}
 P.C.B. DESIGNING 42
 PREPARING CIRCUIT LAYOUT 42-44
5. APPLICATION/ LIMITATIONS 46
6. FUTURE ENHANCEMENT 47
7. CONCLUSION 48
8. REFERENCES 48

6
LIST OF FIGURES PAGE NO:

1. PIN DAIGRAM 13
2. PORT DAIGRAM 14
3. 16/2 CHARACTER LCD DISPLAY 17
4. PIN DESCRIPTION OF LCD 17
5. CHARACTER TYPE HD44780 PIN DIAGRAM 18
6. SCHEMATIC 20
7. PIN DIAGRAM 23
8. DC GEARED MOTOR 25
9. WORKING OF MOTOR 26
10. REGULATED POWER SUPPLY 27
11. SIMPLE POWER SUPPLY CIRCUIT 28
12. BRIDGE RECTIFIER 29
13. SMOOTHING 30
14. REGULATOR 31
15. STEP-DOWN TRANSFORMER 32
16. DIODE 33-34
17. LEDs 35
18. LM805 35
19. RESET BUTTON 37
20. IC BASE 38
21. RESISTOR 39
22. ELECTRONIC COLOR DIODE 39
23. COLOR CODING OF RESISTOR 41
24. CIRCUIT DIAGRAM / LAYOUT 45

7
LIST OF TABLES PAGE NO:

1. CHARACTER LCD PINS WITH 1 CONTROLLER 18


2. CHARACTER LCD PIN WITH 2 CONTROLLER 19
3. 16X2 ALPHANUMERIC LCD SPECS. 21
4. LOGIC TABLE 24

8
CODED DOOR LOCK

Traditional lock systems using mechanical lock and key mechanism are being replaced
by new advanced techniques of locking system. These techniques are an integration of
mechanical and electronic devices and highly intelligent. One of the prominent features
of these innovative lock systems is their simplicity and high efficiency. Such an
automatic lock system consists of electronic control assembly which controls the output
load through a password. This output load can be a motor or a lamp or any other
mechanical/electrical load. Here we develop an electronic code lock system using a 8051
microcontroller, which provides control to the actuating the load. It is a simple
embedded system with input from the keyboard and the output being actuated
accordingly. This system demonstrates a password based door lock system wherein once
the correct code or password is entered, the door is opened and the concerned person is
allowed access to the secured area. After some time, the door would close. Again if
another person arrives and fails to enter the correct password, the door would remain
closed, denying access to the person.
we designed password based door locking system using microcontroller 8051.interfacing
of keypad and lcd screen is required for input and display. here we interface 4*4 keypad
with microcontroller. We also provide a facility to change password.
Now a day’s most of the systems are automated in order to face new challenges and
present day requirements to achieve good results. Automated systems have less manual
operations, so that the flexibility, reliabilities are high and accurate. Hence every field
prefers automated control systems, especially in the field of electronics.
The goal of the project is to develop a unique system through mobile technology which
can control various units of the houses, industries, and also provides a security system.
The various appliances can be utilized by managing them remotely by using GSM
technology, which enables the user to remotely control the operations of the appliances.
Just by pressing keypad of remote telephone the user can perform ON/OFF operations
on the appliances.
The project also exhibits low cost home security system which is widely employed in
our daily life. This system is designed to prevent the opening of the door by
unauthorized persons. The structure of home security system contains a matrix key pad,
the door latch opener and a GSM modem for the security dial up interfaced to the

9
microcontroller. The keypad interfaced to the controller is used as the password entry
system to open/close the door. As soon as the user enters the correct password, the door
lock opens. If the password entered is incorrect, then a security alarm is rung .

PRINCIPLE BEHIND THE CIRCUIT


This circuit operates on the principle of microcontroller interfacing. A keypad interfaced
to the microcontroller is used to enter the password and store it. A LCD is interfaced to
the microcontroller to display the status and a motor is interfaced to the microcontroller
via the motor driver. The motor is rotated forward or backward, depending on the
authenticity of the entered password.

Circuit Diagram of Password Based Door Lock System using 8051


Microcontroller:

Circuit Components: Circuit components and their corresponding values are given
below.

 R1 – 10k

 R2 – 5k

 C1 – 0uF, electrolyte

 C2, C3 – 15pF

 ICs – AT89C51, L293D

Reset Circuit Design: The reset pin of the microcontroller is kept active till the
power supply is in the specified range and a minimum oscillation level is maintained. In
other words to ensure the supply voltage doesn’t falls below the threshold level of 1.2V
and the reset pulse width is greater than 100ms (recommended for 89C51), we select the
values of resistor and capacitor such that RC >=100ms. Here we select a 10K resistor
and a 10uF electrolyte capacitor.

Oscillator Circuit Design: A crystal oscillator is used to provide external clock


signal of 24MHz to the microcontroller. To ensure smooth operation, we connect two
ceramic capacitors, each 30pF. This crystal oscillator is connected between pin 18 and
19 of the microcontroller.

10
Microcontroller Interfacing Design: A 4 by 3 keypad is interfaced to the
microcontroller port P0 and a motor driver L293D is interfaced to microcontroller port
pins P2.3, P2.4 and P2.5. An LCD is interfaced to microcontroller such that the register
select, read/write and enable pins are connected to port pins P2.0, P2.1 and P2.2
respectively, whereas the data pins are connected to port P1.

Compilation of Microcontroller Code: Once the circuit is designed and drawn


on a piece of paper, the next step is to write and compile the code. Here we select the
Kiel uVision software to write the program in C language.

Prior to writing the code, general steps needs to be followed like creating a new project
and selecting the target device or the required microcontroller. Once the code is written,
we saved it with .c extension and then added it to the source file group under the target
folder. The code is then compiled by pressing F7 key.

Once the code is compiled, a hex file is created. In the next step, we use Proteus
software to draw the circuit. The code is dumped into the microcontroller by right
clicking on the IC and then adding the hex file. The microcontroller oscillating
frequency is selected here to be 24MHz.

Password Based Door Lock System Circuit Operation:

Once the circuit is powered, microcontroller sends commands to the LCD such that it is
ready to accept the data. This data is entered using the keypad. Once the data is entered,
it is displayed on the LCD. This data denotes the password. According to the program,
the microcontroller again sends commands to clear the LCD and then sends the data to
be displayed on the LCD. The password is entered using the keypad and it is checked
with the set password. If the passwords match, the microcontroller sends signals to the
motor driver such that pin P2.3 is at high level and pin P2.4 is at low level (while the
enable pin of L293D is at high level) and the motor rotates in forward direction. After a
certain time delay, the enable pin is grounded by sending a low logic signal from the
microcontroller and the motor stops. Again after some certain time delay, the
microcontroller sends signals to the motor driver such that P2.3 is at logic low level,
P2.4 is at logic high level and the enable pin is at logic high level. The motor now

11
rotates in backward direction. Now if the passwords do not match, the microcontroller
sends a logic low signal to the enable pin of the microcontroller, thus disabling the
motor driver and the motor does not runs at all..

COMPONENTS DESCRIPTION
MICROCONTROLLER- AT89S52

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K


bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density non-volatile memory technology and is compatible with the
Industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional non-volatile
memory pro- grammar. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many
embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a
six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator,
and clock circuitry. In addition, the AT89S52 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 con-
tents but freezes the oscillator, disabling all other chip functions until the next interrupt
or hardware reset.

12
FEATURES:-
 8 KB Reprogrammable flash.

 32 Programmable I/O lines.

 16 bit Timer/Counter—3.

 8 Interrupt sources.

 Power range: 4V – 5.5V

 Endurance : 1000 Writes / Erase cycles

 Fully static operation: 0 Hz to 33 MHz

 Three level program memory lock

 Power off flag

 Full duplex UART serial channel

13
 Low power idle and power down modes

 Interrupt recovery from power down modes

 256 KB internal RAM

 Dual data pointer

PORT 0 (Pin 32-39):- Port 0 is also designated as ADO – AD7, allowing it to be


used for both address and data. When connecting an 8051/31 to an external memory.
Port 0 provides both address and data. The 8051 multiplexes address and data through
port 0 to save pins. ALE indicates if PO has address or data. When ALE = 0. It provides
data DO – D7, but when ALE = 1 it has address AO –A7.
The pins of P0 must be connected externally to a 10K-ohm pull-up resistor. This is due
to the fact that P0 is an open drain, unlike P1, P2 and P3. Open drain is a term used for
MOS chips in the same way that open collector is used for TTL chips. With external
pull-up resistors connected to P0, it can be used as a simple I/O port, just like P1 and P2.
In contrast to port 0, ports P1, P2, and P3 do not need any pull-up resistors since they
already have pull-up resistors internally.

PORT 1 (Pins 1-8):- Each of these pins can be configured as an input or an output
with internal pull-ups.

PORT 2 (Pin 21-28):- If there is no intention to use external memory then these port
pins are configured as general inputs/outputs. In case external memory is used, the
higher address byte, i.e. addresses A8-A15 will appear on this port. Even though
memory with capacity of 64Kb is not used, which means that not all eight port bits are
used for its addressing, the rest of them are not available as inputs/outputs.

14
PORT 3 (Pins10-17):- Port 3 Similar to port 1, each of these pins can serve as
general input or output. Besides, all of them have alternative functions:

Pin 10: RXD Serial asynchronous communication input or Serial synchronous

Communication output.

Pin 11: TXD Serial asynchronous communication output or Serial synchronous


communication clock output.

Pin 12: INT0 Interrupt 0 inputs.


Pin 13: INT1 Interrupt 1 input.
Pin 14: T0 Counter 0 clock input.
Pin 15: T1 Counter 1 clock input.
Pin 16: WR Write to external (additional) RAM.
Pin 17: RD Read from external RAM.

16X2 LCD (Liquid Crystal Display)

INTRODUCTION
Advances in the features, miniaturization, and cost of LCD (Liquid Crystal Display)
controller chips have made LCDs usable not only in commercial products but also in
hobbyist projects. By themselves, Liquid Crystal Displays can be difficult to drive
because they require multiplexing, AC drive waveforms, and special voltages. LCD
modules make this driving simpler by attaching hardware to the raw glass LCD to assist
in some or all of these rudimentary driving tasks. LCD modules can be split into two

15
groups: those that have built-in controller and driver chips, and those that have only
driver chips. LCD displays that do not have controllers are typically used with powerful
hardware, such as a laptop computer, where a video controller is available to generate
the complex drive signals necessary to run the display.
Most color and large (greater than 320x240) monochrome displays are of this type.
Other common sizes are 16x1, 20x1, 20x2, 20x4, 40x1, and 40x2 (characters x lines).
Fortunately, all HD44780-based displays (of any size) use the same standard 14-wire
interface.
Therefore, code and hardware made for one size/type display can be painlessly adapted
to work for any HD44780 compatible. Information about these displays can be easily
obtained on the web by including “HD44780” in our search keywords. Because of their
widespread use, these displays can be purchased surplus with typical prices of $3 for
small displays to $20 for large ones.

Interfacing our LCD module


The microcontroller/microprocessor interface to HD44780 LCD modules (hereafter
generically Referred to as character LCD modules) is almost always 14 pins. We May
find that some displays have additional pins for backlighting or other purposes, but the
first 14 pins still serve as the interface.
The first three pins provide power to the LCD module. Pin 1 is GND and should be
grounded to the power supply. Pin 2 is VCC and should be connected to +5V power. Pin
3 is the LCD Display Bias. By adjusting the voltage or duty cycle of pin 3, the contrast
of the display can be adjusted. Most character LCDs can achieve good display contrast
with a voltage between 5V and 0V on pin 3. Note that greater contrast comes with lower
voltage and we should never apply a VLCD higher than VCC. Some displays, which are
specially made to work over a large temperature range, may require a negative voltage to
achieve readable contrast.

BASIC 16x 2 CHARACTERS LCD – BLACK ON GREEN 5V


This is a basic 16 character by 2-line display. Black text on Green background. Utilizes
the extremely common HD44780 parallel interface chipset. Interface code is freely
available. We will need ~11 general I/O pins to interface to this LCD screen.

16
Fig 1: A 16/2 character LCD display

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.

Fig 2: 2 Pin Description of LCD

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.

17
Fig 3: Character LCD type HD44780 Pin diagram

Pin description of character LCD:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
Pin no. 4 RS 0 = Instruction input
1 = Data input
Pin no. 5 R/W 0 = Write to LCD module
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 7.2.1: Character LCD pins with 1 Controller

18
Pin No. Name Description
Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2

Pin no. 7 D1 Data bus line 1

Pin no. 8 D0 Data bus line 0 (LSB)

Pin no. 9 EN1 Enable signal for row 0 and 1


(1stcontroller)
Pin no. 10 R/W 0 = Write to LCD module
1 = Read from LCD module

Pin no. 11 RS 0 = Instruction input


1 = Data input

Pin no. 12 VEE Contrast adjust

Pin no. 13 VSS Power supply (GND)

Pin no. 14 VCC Power supply (+5V)

Pin no. 15 EN2 Enable signal for row 2 and 3


(2ndcontroller)
Pin no. 16 NC Not Connected

Table 7.2.2: Character LCD pins with 2 Controller

LCD BACKGROUND
Frequently, an 8051 program must interact with the outside world using input and output
devices that communicate directly with a human being. One of the most common
devices attached to an 8051 is an LCD display. Some of the most common LCDs
connected to the 8051 are 16x2 and 20x2 displays. This means 16 characters per line by
2 lines and 20 characters per line by 2 lines, respectively.

Interfacing Example - 16 Characters x 2 Lines LCD

19
This is the first interfacing example for the Parallel Port. We will start with something
simple. This example doesn't use the Bi-directional feature found on newer ports, thus it
should work with most, if no all Parallel Ports. It however doesn't show the use of the
Status Port as an input. A 16 Character x 2 Line LCD Modules to the Parallel Port.
These LCD Modules are very common these days, and are quite simple to work with, as
all the logic required running them is on board.
Schematic

Fig 3.1: Schematic Diagram of 2 line 16 character LCD display

Circuit Description
Above is the quite simple schematic. The LCD panel's Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain output.
While most Parallel Ports have internal pull-up resistors, there is a few which don't.
Therefore by incorporating the two 10K external pull up resistors, the circuit is more
portable for a wider range of computers, some of which may have no internal pull up
resistors. We make no effort to place the Data bus into reverse direction. Therefore we
hard wire the R/W line of the LCD panel, into write mode.
This will cause no bus conflicts on the data lines. As a result we cannot read back the
LCD's internal Busy Flag which tells us if the LCD has accepted and finished processing
the last instruction. This problem is overcome by inserting known delays into our
program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As
with all the examples, I've left the power supply out.

20
We can use a bench power supply set to 5v or use an onboard +5 regulator. Remember a
few de-coupling capacitors, especially if we have trouble with the circuit working
properly.

16 x 2 Alphanumeric LCD Module Features


 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM
providing simple interfacing 61 x 15.8 mm viewing area.
 5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line.
 Can display 224 different symbols.
 Low power consumption (1 mA typical).
 Powerful command set and user-produced characters.
 TTL and CMOS compatible.
 Connector for standard 0.1-pitch pin headers.

16 x 2 Alphanumeric LCD Module Specifications


Pin Symbol Level Function
1 VSS - Power, GND
2 VDD - Power, 5V
3 Vo - Power, for LCD Drive
4 RS H/L Register Select Signal
H: Data Input
L: Instruction Input
5 R/W H/L H: Data Read (LCD->MPU)
L: Data Write (MPU->LCD)
6 E H,H- Enable
>L
7- DB0- H/L Data Bus; Software selectable 4- or 8-bit
14 DB7 mode
15 NC - Not connected
16 NC - Not connected

Table 7.3.1: A 16 x 2 Alphanumeric LCD Module Specifications

21
ADVANTAGES AND APPLICATIONS OF LCDs
Advantages

 Download high quality fonts of any size, style or language easily and quickly.
 Create graphics using primitives such as bitmaps, pixels, lines, rectangles and bar
graphs.
 Backlight & Contrast is adjustable in most models.
 4 different brightness settings.
 General Purpose Output (20mA drive).
 Line wrap and Auto screen scroll.
 Bar Graphs and Large Digits.
 Speed settings.

Applications

 Medical equipment
 Electronic test equipment
 Industrial machinery Interface
 Serial terminal
 Advertising system
 EPOS
 Restaurant ordering systems
 Gaming box
 Security systems
 R&D Test units
 Climatizing units
 PLC Interface
 Simulators
 Environmental monitoring
 Lab development, student projects

22
L293D MOTOR DRIVER

The L293D is designed to provide bidirectional drive currents of up to 600-mA at


voltages from 4.5 V to 36 V. This device is designed to drive inductive loads such as
relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-
voltage loads in positive-supply applications.
When an enable input is high, the associated drivers are enabled and their outputs are
active and in phase with their inputs. When the enable input is low, those drivers are
disabled and their outputs are off and in the high-impedance state. With the proper data
inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for
solenoid or motor applications.

Pin Diagram:

fig 4.(a)

The L293D is a quadruple push-pull 4 channel driver capable of delivering 600 mA (1.2
A peak surge) per channel. The L293D is ideal for controlling the forward/reverse/brake
motions of small DC motors controlled by a microcontroller such as a PIC or BASIC
Stamp.
The L293D is a high voltage, high current four channel driver designed to accept
standard TTL logic levels and drive inductive loads (such as relays solenoids, DC and
23
stepping motors) and switching power transistors. The L293D is suitable for use in
switching applications at frequencies up to 5 KHz.

Features:

 600 mA Output Current Capability Per Driver


 Pulsed Current 1.2 A / Driver
 Wide Supply Voltage Range: 4.5 V to 36 V
 Separate Input-Logic Supply
 NE Package Designed for Heat Sinking
 Thermal Shutdown & Internal ESD Protection
 High-Noise-Immunity Inputs

DC GEAR MOTOR
Geared DC motors can be defined as an extension of DC motor which already had its
Insight details demystified here. A geared DC Motor has a gear assembly attached to the
motor. The speed of motor is counted in terms of rotations of the shaft per minute and is
termed as RPM .The gear assembly helps in increasing the torque and reducing the
speed. Using the correct combination of gears in a gear motor, its speed can be reduced
to any desirable figure. This concept where gears reduce the speed of the vehicle but
increase its torque is known as gear reduction. This Insight will explore all the minor
and major details that make the gear head and hence the working of geared DC motor.

24
External Structure
At the first sight, the external structure of a DC geared motor looks as a straight
expansion over the simple DC ones.

The lateral view of the motor shows the outer protrudes of the gear head. A nut is placed
near the shaft which helps in mounting the motor to the other parts of the assembly.

Also, an internally threaded hole is there on the shaft to allow attachments or extensions
such as wheel to be attached to the motor.
Working of the DC Geared Motor
The DC motor works over a fair range of voltage. The higher the input voltage more is
the RPM (rotations per minute) of the motor. For example, if the motor works in the
range of 6-12V, it will have the least RPM at 6V and maximum at 12 V.
In terms of voltage, we can put the equation as:
RPM= K1 * V, where,
K1= induced voltage constant
V=voltage applied

25
The working of the gears is very interesting to know. It can be explained by the principle
of conservation of angular momentum. The gear having smaller radius will cover more
RPM than the one with larger radius. However, the larger gear will give more torque to
the smaller gear than vice versa. The comparison of angular velocity between input gear
(the one that transfers energy) to output gear gives the gear ratio. When multiple gears
are connected together, conservation of energy is also followed. The direction in which
the other gear rotates is always the opposite of the gear adjacent to it.
In any DC motor, RPM and torque are inversely proportional. Hence the gear having
more torque will provide a lesser RPM and converse. In a geared DC motor, the concept
of pulse width modulation is applied. The equations detailing the working and torque
transfer of gears are shown below:

In a geared DC motor, the gear connecting the motor and the gear head is quite small,
hence it transfers more speed to the larger teeth part of the gear head and makes it rotate.
The larger part of the gear further turns the smaller duplex part. The small duplex part
receives the torque but not the speed from its predecessor which it transfers to larger part
of other gear and so on. The third gear’s duplex part has more teeth than others and
hence it transfers more torque to the gear that is connected to the shaft.

26
Regulated Power Supply:

Here I have used 230V to 9V transformer. It has a 300ma rated current. In


microcontroller based projects we do not need 300ma. But these are the commonly
available transformers in the market. Follow my post to get more detail about selecting a
suitable transformer.
Then common full rectifier circuit with four 1N4002 diodes. I think that i do not need to
explain how does this bridge work. 470uF capacitor has been connected between the
output terminals of the bridge. This capacitor is very important. Without this, there is a
significant change in power output. It increases the supply voltage to the rectifier and
make smooth the waveform. If you connect a LED to a microcontroller pin and supply
power without this cap most possibly you will see flickers. Other caps also do the same
work.
Finally about the regulator. Regulators are designed to supply required voltage
without fluctuations. That means we do not need to use regulators with DC power
supply. But most of us use these regulators. Why? We use them to reduce the voltage to
a desired value. Here we have used AC supply and the regulator does both of those
things. It supplies a constant voltage and reduces 9V to 5V.
This is a good time to explain how select a regulator from the market for this type of
project. Normally last digits of the regulator indicates the output voltage. Eg: 7805 : 5V,
7806 : 6V, 7809 : 9V. Regulators with wide range of voltages available in the market.

27
Normally input voltage should be 2V greater than the output voltage. If you need to
regulate negative voltage you can use 79XX series.

5V/12V Regulated DC Power Supply


A Direct Current (DC) supply is needed by most circuits as a constant reference
voltage. Also, some components would be damaged by the negative half-cycles of an
AC supply. A DC supply, stays at a fixed, regular, voltage all of the time, like the
voltage from a battery. Following is a block diagram of a power supply system which
converts a 230V AC mains supply (230V is the UK mains voltage) into a regulated 5V
DC supply.

A simple power supply circuit that includes each of these blocks is given in the
following diagram.

Bridge Rectifier

A diode bridge or bridge rectifier is an arrangement of four diodes in a bridge


configuration that provides the same polarity of output voltage for either polarity of
input voltage. When used in its most common application, for conversion of alternating

28
current (AC) input into direct current (DC) output, it is known as a bridge rectifier. In
the diagrams below, when the input connected to the left corner of the diamond is
positive (Fig. A), and the input connected to the right corner is negative, current flows
from the upper supply terminal to the right along the red (positive) path to the output,
and returns to the lower supply terminal via the blue (negative) path.

When the input connected to the left corner is negative (Fig. B), and the input connected
to the right corner is positive, current flows from the lower supply terminal to the right
along the red path to the output, and returns to the upper supply terminal via the blue
path.
In each case, the upper right output remains positive and lower right output negative.
Since this is true whether the input is AC or DC, this circuit not only produces a DC
output from an AC input, it can also provide what is sometimes called "reverse polarity
protection". That is, it permits normal functioning of DC-powered equipment when
batteries have been installed backwards, or when the leads (wires) from a DC power
source have been reversed, and protects the equipment from potential damage caused by
reverse polarity.

Smoothing
Most circuits will require 'smoothing' of the DC output of a rectifier, and this is a simple
matter since it involves only one capacitor, as shown in figure 1.

29
The output waveform in figure 2 shows how smoothing works. During the first half of
the voltage peaks from the rectifier, when the voltage increases, the capacitor charges
up. Then, while the voltage decreases to zero in the second half of the peaks, the
capacitor releases its stored energy to keep the output voltage as constant as possible.
Such a capacitor is called a 'smoothing' or 'reservoir' capacitor when it is used in this
application.

30
Regulator

Voltage regulator ICs are available with fixed (typically 5, 6, 8, 9, 10, 12, 15, 18 and
24V) or variable output voltages. They are also rated by the maximum current they can
pass. Negative voltage regulators are available, mainly for use in dual supplies. Most
regulators include some automatic protection from excessive current ('overload
protection') and overheating ('thermal protection').

Many of the fixed voltage regulator ICs have 3 leads and look like power transistors,
such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching
a heat sink if necessary.

Circuit Diagram:

31
TRANSFORMER

Definition: -
The transformer is a static electro-magnetic device that transforms one alternating
voltage (current) into another voltage (current). However, power remains the same
during the transformation. Transformers play a major role in the transmission and
distribution of ac power .

Principle: -
Transformer works on the principle of mutual induction. A transformer consists of
laminated magnetic core forming the magnetic frame. Primary and secondary coils are
wound upon the two cores of the magnetic frame, linked by the common magnetic flux.
When an alternating voltage is applied across the primary coil, a current flows in the
primary coil producing magnetic flux in the transformer core. This flux induces voltage
in secondary coil.

Figure Step-Up Transformer

Figure Step--Down Transformer

32
Transformers are classified as: -

(a) Based on position of the windings with respect to core i.e.

1) Core type transformer


2) Shell type transformer

(b) Transformation ratio:

1) Step up transformer
2) Step down transformer

a) Core & shell types: Transformer is simplest electrical machine, which consists of
windings on the laminated magnetic core. There are two possibilities of putting
up the windings on the core.

1) Winding encircle the core in the case of core type transformer


2) Cores encircle the windings on shell type transformer.

b) Step up and Step down: in these voltages transformation takes place according to
whether the primary is high voltage coil or a low voltage coil.

1) Lower to higher-> Step up


2) Higher to lower-> Step down

DIODE:-

33
Figure Diode

A diode is a two-terminal device. Diodes have two active electrodes between which the
signal of interest may flow, and most are used for their unidirectional electric current
property.The unidirectionality most diodes exhibit is sometimes generically called the
rectifying property. The most common function of a diode is to allow an electric current
in one direction (called the forward biased condition) and to block the current in the
opposite direction (the reverse biased condition). Thus, the diode can be thought of as an
electronic version of a check valve.
Real diodes do not display such a perfect on-off directionality but have a more complex
non-linear electrical characteristic, which depends on the particular type of diode
technology. Diodes also have many other functions in which they are not designed to
operate in this on-off manner.

LEDs (Light Emitting Diode)


A light-emitting diode is a semiconductor light source. LEDs are used as indicator
lamps in many devices and are increasingly used for other lighting. They are
manufactured in different shapes, colours and sizes. For their low price, low power
consumption and simple use, they have almost completely pushed aside other light
sources, bulbs at first place. They perform similar to common diodes with the difference
that they emit light when current flows through them.

34
Condition 1:
Anode is connected through a resistor to Vcc & the Cathode is connected to the
Microcontroller pin. So when the Port Pin is HIGH the LED is OFF & when the Port
Pin is LOW the LED is turned ON.

Condition 2:
Anode is connected to the ground & the Cathode is connected through the resistor to the
Microcontroller pin. So when the Port Pin is LOW the LED is OFF & when the Port
Pin is HIGH the LED is turned ON.

LM7805 (Voltage Regulator)

Fig. Voltage Regulator

35
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.
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

CRYSTAL- 12MHz
The 8051 has an on-chip oscillator but requires an external clock to run it. Most often a
quartz crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin 18).
The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs two capacitors
of 30 pF value. One side of each capacitor is connected to the ground.
It must be noted that there are various speeds of the 8051 family. Speed refers to the
maximum oscillator frequency connected to XTAL. For example, a 12-MHz chip must
be connected to a crystal with 12 MHz frequency or less.

If you decide to use a frequency source other than a crystal oscillator, such as a TTL
oscillator, it will be connected to XTAL1; XTAL2 is left unconnected.

36
RESET BUTTON
It is an input and is active high (normally low). Upon applying a high pulse to this pin,
the microcontroller will reset and terminate all activities.

The positive voltage on this pin resets the microcontroller. By applying logic zero to this
pin, the program starts execution from the beginning.
Reset Button
Reset button is a button that can reset the microcontroller. The reset button clears the
memory and reboots the microcontroller forcibly. Reset buttons are found on circuit
breakers to reset the circuits.

Reset Button
The button can cause data corruption so this button often doesn’t exist on machines,
usually on computers and other electronic devices. It is present as a small button
possibly recessed into the case or only accessible by a pin or similarly thin object to
prevent on it, being pressed accidentally.

37
IC Base
An IC socket can be defined as an electromechanical device, which provides removable
interface between the IC package and the system circuit board with minimal effect on
signal integrity. A removable interface is the major reason for using a socket, and it is
required for a variety of reasons, including ease of assembly, reworking, upgrading and
cost savings.

IC Base
The cost advantage is saving the IC by not attaching it permanently to the PCB (printed
circuit board). The socket is permanently (soldered) or semi-permanently (solder less)
attached to the PCB, while the IC device can be inserted into or removed from the socket
without disturbing the connections to the PCB. This allows the IC to function as it is
soldered into the PCB, but it can be replaced by another IC or multiple ICs. The socket
helps to test, evaluate and inspect the complete system. The socket also allows in the
field for maintenance, testing, replacement or upgrades. This becomes a critical factor
because of technology evolution.

RESISTORS:-
A Resistor is a heat-dissipating element and in the electronic circuits it is mostly used for
either controlling the current in the circuit or developing a voltage drop across it, which

38
could be utilized for many applications. There are various types of resistors, which can
be classified according to a number of factors depending upon:

(I) Material used for fabrication


(II) Wattage and physical size
(III) Intended application
(IV) Ambient temperature rating
(V) Cost

Resistors

Resistors may be classified as

(1) Fixed
(2) Semi variable
(3) Variable resistor.

In our project carbon resistors are being used.

The electronic color code is used to indicate the values or ratings of electronic
components, very commonly for resistors. Resistor values are always coded in ohms,
capacitors in pico farads (pF), inductors in micro henries (µH), and transformers in volts.

 band A is first significant figure of component value

39
 band B is the second significant figure
 band C is the decimal multiplier
 band D if present, indicates tolerance of value in percent (no color means 20%)

For example, a resistor with bands of yellow, violet, red, and gold will have first digit 4
(yellow in table below), second digit 7 (violet), followed by 2 (red) zeros: 4,700 ohms.
Gold signifies that the tolerance is ±5%, so the real resistance could lie anywhere
between 4,465 and 4,935 ohms.
A useful mnemonic for remembering the first ten color codes matches the first letter of
the color code, by order of increasing magnitude is as follows:-

B. B. Roy of Great Britain has Very Good Wife.

Example:-

From top to bottom:

 Green-Blue-Brown-Black-Brown
o 561 Ω ± 1%
 Red-Red-Orange-Gold
o 22,000 Ω ± 5%
 Yellow-Violet-Brown-Gold
o 470 Ω ± 5%
 Blue-Gray-Black-Silver
o 68 Ω ± 10% (this wide of a tolerance is now seldom seen)
 Brown-Black-Brown
o 10 Ω ± 20% (this wide of a tolerance is now seldom seen)
 Black
o zero Ω

Color Coding of resistor is given in the following table:-

40
41
IMPLEMENTATION
Steps for making hardware

P.C.B. DESIGNING & WORKING

P.C.B. DESIGNING
P.C.B. LAYOUT
The entire circuit can be easily assembled on a general purpose P.C.B. board
respectively. Layout of desired diagram and preparation is first and most important
operation in any printed circuit board manufacturing process. First of all layout of
component side is to be made in accordance with available components dimensions. The
following points are to be observed while forming the layout of P.C.B.
1. Between two components, sufficient space should be maintained.
2. High voltage/max dissipated components should be mounted at sufficient distance
from semiconductor and electrolytic capacitors.
3. The most important points are that the components layout is making proper
compromise with copper side circuit layout.
Printed circuit board (P.C.B.s) is used to avoid most of all the disadvantages of
conventional breadboard. These also avoid the use of thin wires for connecting the
components; they are small in size and efficient in performance.

PREPARING CIRCUIT LAYOUT


First of all the actual size circuit layout is to be drawn on the copper side of the copper
clad board. Then enamel paint is applied on the tracks of connection with the help of a
shade brush. We have to apply the paints surrounding the point at which the connection
is to be made. It avoids the disconnection between the leg of the component and circuit
track. After completion of painting work, it is allowed to dry.

DRILLING
After completion of painting work, holes 1/23inch(1mm) diameter are drilled at desired
points where we have to fix the components.

ETCHING

42
The removal of excess of copper on the plate apart from the printed circuit is known as
etching. From this process the copper clad board with printed circuit is placed in the
solution of FeCl with 3-4 drops of HCL in it and is kept so for about 10 to 15 minutes
and is taken out when all the excess copper is removed from the P.C.B. After etching,
the P.C.B. is kept in clean water for about half an hour in order to get P.C.B. away from
acidic, field, which may cause poor performance of the circuit. After the P.C.B. has been
thoroughly washed, paint is removed by soft piece of cloth dipped I thinner or turbine.
Then P.C.B. is checked as per the layout, now the P.C.B. is ready for use.
SOLDERING
Soldering is the process of joining two metallic conductor the joint where two metal
conductors are to be join or fused is heated with a device called soldering iron and then
as allow of tin and lead called solder is applied which melts and converse the joint. The
solder cools and solidifies quickly to ensure is good and durable connection between the
jointed metal converting the joint solder also present oxidation.

SOLDERING AND DESOLDERING TECHIQUES:

These are basically two soldering techniques.

• Manual soldering with iron.

• Mass soldering.

SOLDERING WITH IRON

The surface to be soldered must be cleaned & fluxed. The soldering iron switched on
and bellowed to attain soldering temperature. The solder in form of wire is allied hear
the component to be soldered and heated with iron. The surface to be soldered is filled,
iron is removed and joint is cold without disturbing.

SOLDER JOINT ARE SUPPOSED TO

1. Provide permanent low resistance path.


2. Make a robust mechanical link between P.C.B. and leads of components.
3. Allow heat flow between component, joining elements and P.C.B.
4. Retain adequate strength with temperature variation.

43
The following precaution should be taken while soldering:
1. Use always an iron plated copper core tip for soldering iron.

2. Slightly for the tip with a cut file when it is cold.

3. Use a wet sponge to wipe out dirt from the tip before soldering instead of asking the
iron.

4. Tighten the tip screw if necessary before iron is connected to power supply.

5. Clean component lead and copper pad before soldering.

6. Apply solder between component leads, P.C.B. pattern and tip of soldering iron.

7. Iron should be kept in contact with the joint for 2-3 seconds only instead of keeping
for very long or very small time.

8. Use optimum quantity of solder.

44
Circuit Diagram

Layout

45
Applications
1. This simple circuit can be used at residential places to ensure better safety.
2. It can be used at organizations to ensure authorized access to highly secured places.
3. With a slight modification by replacing the motor driver with a relay driver, this
circuit can be used to control the switching of loads through code.
4. This circuit can be also modified by using EEPROM chip interfaced to the
microcontroller and store the entered password in the chip.

Limitations
1. The microcontroller used is a CMOS device and is highly static and hence cannot
be touched by bare hands.
2. It is a low range circuit, i.e. it is not possible to operate the circuit remotely.
3. It is a battery operated circuit and can easily run out of power once the battery life
time ends.

46
Future Enhancements

1. Electrical devices such as lights computer etc. can be controlled by using


separate passwords.
2. The system can be easily connected to the personal computer for further control.
3. Other than the speaker sounds all the lights are made to turned on if password
entered is wrong for three times and also a hidden camera is used to record the
face who has trespassed.
4. we can use this system as a attendance register for the students to interact class
room with their respective password.

47
Conclusion
This project is meant for security system whose axis is only for respected authority using
a microcontroller the password entered is checked with the stored password and then
does the corresponding operation here we use a 5 digit password for better security

Reference
 Google.com
 Form embed vision(tranning institute)
 Youtube
 And Teacher of (MY)EcE depatment

48

You might also like