Professional Documents
Culture Documents
ON
TOUCH BASED DOOR LOCK SYSTEM USING ARDUINO
Submitted in partial fulfillment of the requirements for the
award of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING BY
M.VIKRAM
(19761A0498)
Sr.Assistant Professor
(2021-2022)
.
LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING (AUTONOMOUS)
L.B. Reddy Nagar, Mylavaram-521230,
CERTIFICATE
.
ACKNOWLEDGEMENT
The Satisfaction that accompanies that the successful
completion of any task would be incomplete without the mention of the
people whose case less co- operation made it possible, whose constant
guidance and encouragement crown all efforts with success.
I would like to thank all the teaching and non- teaching staff
members of Electronics and Communication Engineering, who have extended
their full co-operation during the course of this work.
M. VIKRAM
(19761A0498)
.
ABSTRACT
In this project we will learnt about how to design Touch-Based door lock system
using Arduino & Touch sensor using “TTP223”. Door lock system using
Arduino & TTP223 capacitive touch sensor switch is a simple project for
switching circuit, i.e. switching the servo motor on/off with the help of the
simple touch. The door can be locked or unlocked just by simply touching. We
are using a touch sensor TTP223 as a switch and LCD to display the status of
door lock and LED to indicate on/off status as well.
The application area of this project is home and office where a simple touch
can close and open the door. Interfacing the Touch sensor “TTP223” with
Arduino acts as a switch for locking and unlocking the door .
CONTENTS
CHAPTER 1: INTRODUCTION 03
5.2 WORKING
REFERENCES 20
Page | 1
LIST OF FIGURES
4.5 RESISTOR 14
4.6 LED 15
Page | 2
CHAPTER 1
INTRODUCTION
Internal Structure:
TTP223 is 1 Key Touch pad detector IC, and it is suitable to detect capacitive
element variations. It consumes very low power and the operating voltage is
only between 2.0V~5.5V. The response time max about 60mS at fast mode,
220mS at low power mode @VDD=3V. Sensitivity can adjust by the
capacitance(0~50pF) outside
Page | 3
CHAPTER 2
PROJECT OUTLINE
The application area of this project is home and office where a simple touch
can open and close the door. Interfacing touch sensor TTP223 with Arduino
acts as a switch for unlocking the door.The door can be locked or unlocked
just by simply touching. We are using a touch sensor TTP223 as a switch and
LCD to display the status of door lock and LED to indicate on/off status as
well.
Page | 4
CHAPTER 3
SOFTWARE USED
About Software:
The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring
Page | 5
project, which provides many common input and output procedures.
Userwritten code only requires two basic functions, for starting the sketch and
the main program loop, that are compiled and linked with a program stub
main() into an executable cyclic executive program with the GNU toolchain,
also included with the IDE distribution. The Arduino IDE employs the program
avrdude to convert the executable code into a text file in hexadecimal encoding
that is loaded into the Arduino board by a loader program in the board's
firmware.
setup(): This function is called once when a sketch starts after power-up or
reset. It is used to initialize variables, input and output pin modes, and other
libraries needed in the sketch.
loop(): After setup() function exits (ends), the loop() function is executed
repeatedly in the main program. It controls the board until the board is
powered off or is reset.
Page | 6
CHAPTER 4
COMPONENTS USED
3.LED
4.servo motor
5.Breadboard
6.Connecting Wires
8.LCD
Fig.4.1.Arduino UNO
Page | 8
PINS DESCRIPTION:
• LED: There is a built-in LED driven by digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
VIN: The input voltage to the Arduino/Genuino board when it's using an
external power source (as opposed to 5 volts from the USB connection or other
regulated power source). You can supply voltage through this pin, or, if
supplying voltage via the power jack, access it through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 20V), the USB
connector (5V), or the VIN pin of the board (7-20V). Supplying voltage via the
5V or 3.3V pins bypasses the regulator, and can damage the board.
Reset: Typically used to add a reset button to shields which block the one on
the board.[7]
Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX)
TTL serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.
PWM (Pulse Width Modulation): 3, 5, 6, 9, 10, and 11 Can provide 8-bit PWM
output with the analogWrite() function.
Page | 9
TWI (Two Wire Interface) / I²C: A4 or SDA pin and A5 or SCL pin. Support TWI
communication using the Wire library.
Features
Page | 10
Pin Definition :
Jumpers AB
Page | 11
HARDWARE CONNECTIONS:
Servo implies an error sensing feedback control which is utilized to correct the
performance of a system. It also requires a generally sophisticated controller,
often a dedicated module designed particularly for use with servomotors. Servo
motors are DC motors that allow for precise control of the angular position.
They are DC motors whose speed is slowly lowered by the gears. The servo
motors usually have a revolution cut off from 90° to 180°. A few servo motors
also have a revolution cutoff of 360° or more. But servo motors do not rotate
constantly. Their rotation is limited between the fixed angles.
Page | 12
The servo motor is an assembly of four things: a normal DC motor, a gear
reduction unit, a position-sensing device, and a control circuit. The DC motor
is connected with a gear mechanism that provides feedback to a position
sensor which is mostly a potentiometer. From the gearbox, the output of the
motor is delivered via servo spline to the servo arm. For standard servo motors,
the gear is normally made up of plastic whereas, for high power servos, the
gear is made up of metal.
A servo motor consists of three wires- a black wire connected to the ground, a
white/yellow wire connected to the control unit, and a red wire connected to
the power supply.
The function of the servo motor is to receive a control signal that represents a
desired output position of the servo shaft and apply power to its DC motor
until its shaft turns to that position.
It uses the position-sensing device to figure out the rotational position of the
shaft, so it knows which way the motor must turn to move the shaft to the
instructed position. The shaft commonly does not rotate freely around similar
to a DC motor, however rather can just turn 200 degrees.
Servo Motor
From the position of the rotor, a rotating magnetic field is created to efficiently
generate toque. Current flows in the winding to create a rotating magnetic
field. The shaft transmits the motor output power. The load is driven through
Page | 13
the transfer mechanism. High-function rare earth or other permanent magnet
is positioned externally to the shaft. The optical encoder always watches the
number of rotations and the position of the shaft.
Page | 14
A liquid-crystal display (LCD) is a flat-panel display or other electronically
modulated optical device that uses the light-modulating properties of liquid
crystals combined with polarizers. Liquid crystals do not emit light directly,
instead using a backlight or reflector to produce images in color or
monochrome.
4.5.DESCRIPTION OF LED:
The LED is a PN-junction diode which emits light when an electric current
passes through it in the forward direction. In the LED, the recombination of
charge carrier takes place. The electron from the N-side and the hole from the
P-side are combined and gives the energy in the form of heat and light. The
LED is made of semiconductor material which is colourless, and the light is
radiated through the junction of the diode.
Page | 15
CHAPTER 5
Connect the signal pin of TTP223 Touch Sensor to Arduino Digital Pin7.
Connect the LCD to analog pin A0, A1, A2, A3, A4, A5 of Arduino as
shown in the figure.
5.2 WORKING:
Capacitive screens do not use the pressure of your finger to create a change
in the flow of electricity. Instead, they work with anything that holds an
electrical charge – including human skin. When a finger hits the screen a tiny
electrical charge is transferred to the finger to complete the circuit, creating a
voltage drop on that point of the screen. The software processes the location
of this voltage drop and orders the ensuing action.
Page | 16
5.3 PROGRAMMING OF ARDUINO:
Here is a code for Touch-Based Door Lock System Using Arduino & Touch
Sensor TTP223. Copy the code, the compile, and upload it to Arduino UNO
Board.
#include<LiquidCrystal.h>
LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
const int servoPin = 3; // Servo pinonst int touchPin = 7; // Pushtouch pin
int ledPin = 5;
int touchState = 0;
int directionState = 0;
Servo myservo;
int pos = 0;
void setup()
{
cd.begin(16,2);
lcd.print(" Touch Based");
lcd.setCursor(0, 1);
lcd.print("Door Lock System");
yservo.attach(3);
pinMode(touchPin, INPUT);
PinMode(ledPin, OUTPUT);
}
void loop()
{
touchState = digitalRead(touchPin);
if (directionState == 0)
{
if (touchState == HIGH)
{
directionState = 1;
for(pos = 0; pos < 180; pos += 1)
Page | 17
digitalWrite(ledPin,1);
lcd.clear();
lcd.print("Status: Unlocked");
lcd.setCursor(0, 1);
lcd.print("Touch to Lock");
{
myservo.write(pos);
delay(15); // waits 15ms to reach the position
}
else if (directionState == 1)
{
if (touchState == HIGH)
{
directionState = 0;
or (pos = 180; pos>=1; pos -=1)
digitalWrite(ledPin,0);
lcd.clear();
lcd.print("Status: Locked");
lcd.setCursor(0, 1);
lcd.print("Touch to Unlock");
myservo.write(pos);15);
}
}
}
Page | 18
CHAPTER 6
The Door lock system using Arduino & TTP223 capacitive touch sensor switch
is a simple project for switching circuit, i.e. switching the servo motor on/off
with the help of the simple touch. The door can be locked or unlocked just by
simply touching. We are using a touch sensor TTP223 as a switch and LCD to
display the status of door lock and LED to indicate on/off status as well.
CONCLUSION/FUTURE REFERENCES:
The project is about interacting with component and devices with the help of
HC-05 (Bluetooth module). The project is limited to performing the task of
opening and closing of 3 doors precisely main entrance doors of a building. It
is not designed for the purpose of surveillance in a home or any building nor
is it a burglar alarm that alarms you in any case of perimeter bridging it’s only
limited to performing the task of opening and closing
• EASY TO USE
• SIMPLE TO USE
• NO MORE KEYS
• PERFECT FOR ELDERED OR DISABLED
• EASY TO UTILIZE
Page | 19
REFERENCES:
Page | 20