You are on page 1of 26

A MINI PROJECT REPORT

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)

UNDER THE GUIDANCE OF

MR.B.SIVA HARI PRASAD

Sr.Assistant Professor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING (AUTONOMOUS)


L.B. REDDY Nagar, Mylavaram-521230,

Approved by AICTE, New Delhi, Affiliated to JNTU, Kakinada,

Accredited by NAAC and NBA

Certified by ISO 9001-2015

(2021-2022)

.
LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING (AUTONOMOUS)
L.B. Reddy Nagar, Mylavaram-521230,

Approved by AICTE, New Delhi, Affiliated to JNTU, Kakinada,

Accredited by NAAC and NBA

Certified by ISO 9001-2015.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify the mini project entitled “TOUCH BASED

DOOR LOCK SYSTEM USING ARDUINO” is a bonafide work done by

M.VIKRAM (19761A0498) in partial fulfillment of requirement for the

award of Bachelor of Technology degree in Electronics and

Communication Engineering at LAKIREDDY BALIREDDY COLLEGE OF

ENGINEERING, MYLAVARAM during the year 2021-2022.

MINI PROJECT GUDIE HEAD OF THE DEPARTMENT

.
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 humbly express my thanks to guide, MR.B.SIVA HARI


PRASAD , for giving timely valuable suggestions and encouragement that
makes the completion of the project successfully.

I indebted to our Head of the Department Dr.Y.Amar Babu, who


modeled us both technically and morally for achieving greater success in life.

I humbly express my thanks to our management and Principal


Dr.K.AppaRao for extending his support for providing us with an
environment to complete our mini project successfully.

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.

I am thank full to my friends who helped me sharing knowledge


and by providing Material to complete the mini project in time.

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

CHAPTER 2: PROJECT OUTLINE 04

CHAPTER 3:SOFTWARE/HARDWARE TOOLS 05

CHAPTER 4: COMPONENTS DESCRIPTION 07

4.1 DESCRIPTION OF ARDUINO UNO

4.2 DESCRIPTION OF “TTP223” TOUCH SENSOR

4.3 DESCRIPTION OF SERVO MOTOR

4.4 DESCRIPTION OF LCD

4.5 DESCRIPTION OF LED

CHAPTER 5: WORKING & CIRCUIT 16

5.1 CIRCUIT AND CONNECTIONS

5.2 WORKING

5.3 ARDUINO PROGRAM

CHAPTER 6: OUTPUT AND CONCLUSION 19

6.1 ADVANTAGES AND APPLICATIONS

REFERENCES 20

Page | 1
LIST OF FIGURES

4.1 ARDUINO UNO 08

4.2 TOUCH SENSOR 11

4.3 TTP223 SENSOR WORKING 12

4.4 SERVO MOTOR 13

4.5 RESISTOR 14

4.6 LED 15

5.1 CIRCUIT DIAGRAM

Page | 2
CHAPTER 1

INTRODUCTION

A capacitive touch sensor module based on the dedicated TTP223 touch


sensor IC. The module provides a single integrated touch sensing area of 11 x
10.5mm with a sensor range of ~5mm. An on-board LED will give a visual
indication of when the sensor is triggered. When triggered the module’s output
will switch from its idle low state to high (default operation). Solder jumpers
allow for reconfiguring its mode of operation to be either active low or toggle
output.

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

Arduino is an open-source hardware and software company,


project and user community that designs and manufactures single-board
microcontrollers and microcontroller kits for building digital devices and
interactive objects that can sense and control both physically and digitally. Its
products are licensed under the GNU Lesser General Public License (LGPL) or
the GNU General Public License(GPL),permitting the manufacture of Arduino
boards and software distribution by anyone. Arduino boards are available
commercially in preassembled form or as do-it-yourself(DIY) kits.

About Software:

A program for Arduino hardware may be written in any


programming language with compilers that produce binary machine code for
the target processor. Atmel provides a development environment for their 8bit
AVR and 32-bit ARM Cortex-M based microcontrollers: AVR Studio (older) and
Atmel Studio (newer).

IDE: TheArduino integrated development environment (IDE)


is a cross-platform application(for Windows, macOS, Linux) that is written in
the programming language Java. It originated from the IDE for the languages
Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace
matching, and syntax highlighting, and provides simple oneclick mechanisms
to compile and upload programs to an Arduino board. It also contains a
message area, a text console, a toolbar with buttons for common functions and
a hierarchy of operation menus. The source code for the IDE is released under
the GNU General Public License, version 2.

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.

SKETCH: A sketch is a program written with the Arduino IDE.


Sketches are saved on the development computer as text files with the file
extension.ino. Arduino Software (IDE) pre-1.0 saved sketches with the
extension.pde.

A minimal Arduino C/C++ program consist of only two functions.

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.

Libraries: The open-source nature of the Arduino project has


facilitated the publication of many free software libraries that other developers
use to augment their projects.

Page | 6
CHAPTER 4

COMPONENTS USED

1. TPP223 Touch Sensor Module

2.Arduino UNO (any version)

3.LED

4.servo motor

5.Breadboard

6.Connecting Wires

7.330 ohm resistor

8.LCD

4.1.DESCRIPTION OF ARDUINO UNO:

The Arduino UNO is an open-source microcontroller board


based on the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog input/output
(I/O) pins that may be interfaced to various expansion boards (shields) and
other circuits. The board has 14 Digital pins, 6 Analog pins, and programmable
with the Arduino IDE (Integrated Development Environment) via a type B USB
cable. It can be powered by a USB cable or by an external 9 volt battery, though
it accepts voltages between 7 and 20 volts. It is also similar to the Arduino
Nano and Leonardo. The hardware reference design is distributed under a
Page | 7
Creative Commons Attribution Share-Alike 2.5 license and is available on the
Arduino website. Layout and production files for some versions of the hardware
are also available. "Uno" means one in Italian and was chosen to mark the
release of Arduino Software (IDE) 1.0.The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to newer
releases. The Uno board is the first in a series of USB Arduino boards, and the
reference model for the Arduino platform. The ATmega328 on the Arduino Uno
comes preprogrammed with a bootloader that allows uploading new code to it
without the use of an external hardware programmer. It communicates using
the original STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USBtoserial driver chip. Instead, it uses the
Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.

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.

IOREF: This pin on the Arduino/Genuino board provides the voltage


reference with which the microcontroller operates. A properly configured shield
can read the IOREF pin voltage and select the appropriate power source or
enable voltage translators on the outputs to work with the 5V or 3.3V.

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.

External Interrupts: pins 2 and 3. These pins can be configured to trigger an


interrupt on a low value, a rising or falling edge, or a change in value.

PWM (Pulse Width Modulation): 3, 5, 6, 9, 10, and 11 Can provide 8-bit PWM
output with the analogWrite() function.

SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These


pins support SPI communication using the SPI library

Page | 9
TWI (Two Wire Interface) / I²C: A4 or SDA pin and A5 or SCL pin. Support TWI
communication using the Wire library.

AREF (Analog Reference): Reference voltage for the analog inputs.

4.2 DESCRIPTION FOR “TPP223” TOUCH SENSOR

Features

1. Input Voltage: 3.3V - 5.5V DC

2. Module size: 15mm x 11mm

3. Stable touching detection of human body for replacing traditional direct


switch

Page | 10
Pin Definition :

Trigger setting mode: (1 = Short ; 0 = No Short)

Jumpers AB

Momentary / High Output 00 (used in this tutorial)

Self Lock / High Output 01

Momentary / Low Output 10

Self Lock / Low Output 11

Page | 11
HARDWARE CONNECTIONS:

4.3 DESCRIPTION FOR SERVO MOTOR:

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.

Working of a Servo Motor

Servo Motor consists of a DC Motor, a Gear system, a position sensor, and a


control circuit. The DC motors get powered from a battery and run at high speed and
low torque. The Gear and shaft assembly connected to the DC motors lower
this speed into sufficient speed and higher torque. The position sensor senses
the position of the shaft from its definite position and feeds the information to
the control circuit. The control circuit accordingly decodes the signals from
the position sensor and compares the actual position of the motors with the
desired position and accordingly controls the direction of rotation of the DC
motor to get the required position. Servo Motor generally requires a DC supply
of 4V TO 6V

4.4 DESCRIPTION FOR LCD :

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

5.1 CIRCUIT DIAGRAM AND CONNECTIONS

Connect the signal pin of TTP223 Touch Sensor to Arduino Digital Pin7.

Connect servo motor signal pin to Arduino Digital Pin 3.

Connect the LED to Arduino Digital Pin 5 via a 330-ohm resistor.

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

OUTPUT AND CONCLUSION

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

6.1 ADVANTAGES AND APPLICATIONS:

• EASY TO USE
• SIMPLE TO USE
• NO MORE KEYS
• PERFECT FOR ELDERED OR DISABLED
• EASY TO UTILIZE

Page | 19
REFERENCES:

• [1]. Mahendran.N , Geo Joe Matthau , Veenesh.M.U," Different sensor


bolstering upheld, building computerization framework utilizing arduino
stage”, With Exposure of 802.15.4 Functionalities, International Journal
of Engineering Trends and Technology, Vol. 4, Issue 2, 2013.
• [2].Sheikh Izzal Azid, Bahia Sharma, " Wise Home: SMS Based Home
Security System”, With Immediate Feedback, World Academy of Science,
Engineering and Technology, Vol. 72, 2012
• https://www.electronicshub.org/arduino-pir-sensor-tutorial/
• https://circuitdigest.com/microcontroller-projects/arduino-motion-
detector-using-pir-sensor

Page | 20

You might also like