0% found this document useful (0 votes)
17 views51 pages

3, Contentsmain

The document discusses the Internet of Things (IoT) and its application in creating a smart door lock system that can be controlled remotely via mobile devices. It outlines the advantages of this technology, including enhanced security and ease of use, while also detailing the hardware and software requirements for implementation. The proposed system aims to replace traditional locking mechanisms with a more secure and accessible solution, utilizing NodeMCU and other components for effective operation.

Uploaded by

BALAJI D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views51 pages

3, Contentsmain

The document discusses the Internet of Things (IoT) and its application in creating a smart door lock system that can be controlled remotely via mobile devices. It outlines the advantages of this technology, including enhanced security and ease of use, while also detailing the hardware and software requirements for implementation. The proposed system aims to replace traditional locking mechanisms with a more secure and accessible solution, utilizing NodeMCU and other components for effective operation.

Uploaded by

BALAJI D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

CHAPTER 1

INTRODUCTION

The idea of connecting common physical objects to the internet is referred to as


the "internet of things" in computers. connected to the internet and able to
recognise and comprehend other devices' interactions items found online. The
Internet of Things (IOT) is a technology framework for communicating with
electrical items in the modern computer age. Due to its flexibility and ease of
use, wirelessly operated gadgets have been gaining market domination in a
number of sectors, including consumer electronics and home security.

This kind of technology is referred to as the "internet of things." With the use
of this technology, new automation systems for homes, businesses, and other
settings are being created. The major goal of smart home technology is to
improve living conditions by introducing networking tools and equipment
within the home. A smart house allows for complete automation, resulting in
comfortable living conditions and additional advantages for those with
disabilities.

Every door locking system now in use requires a traditional key or some other
type of NodeMCU to access the system.By creating an HTML webpage, users
can access the door lock and open or close it. By employing other wireless
connections, this strategy can be expanded to commercial areas such as ATMs,
vending machines, etc.

The house is one of the structures that has been utilised as a place to stay for a
very long time. Home owners spend the majority of their time outside the
house. In big cities, these kinds of things happen frequently. As a result, the
home frequently goes unoccupied for extended periods of time, especially
around special occasions like Christmas, New Year's Eve, and Eid.
1
Living in such conditions can motivate burglars to commit theft. Homes get
smarter as technology develops. Modern homes are quickly transitioning away
from traditional switches in favour of a centralised control system with remote
control switches.

The most significant advantage of our proposed system is to build smart door
lock which can be access remotely via mobile, to increase security of the house
and to design and implement a cheap and open source home automation.

This project will make human lives more versatile with enhanced security, ease,
and the ability to live an upper-class lifestyle, resulting in our lives becoming
much simpler, finer, accessible, and stable.
People are experiencing more security issues around the world today, and
security has become the most important concern everywhere in the world; as a
result, security has become increasingly important in recent years. Security
refers to the safeguarding of our lives and property. It is critical to ensure the
safety of people and their valuables in order to prevent illicit handling. As a
result, concentrating on door lock or gate security is critical to minimize more
difficulties in the monitored area.

The goal of this project was to create an internet-connected door lock that could
be simply put on a variety of doors, operated via the internet, and trusted for
security. Modern homes are gradually moving away from traditional switches
and toward a centralized control system with remote control switches.

2
CHAPTER 2
LITERATURE SURVEY

TITLE: IOT BASED SMART DOOR LOCK SYSTEM USING


NODE MCU ( ESP8266 )

People are experiencing more security issues around the world today, and
security has become the most important concern everywhere in the world; as a
result, security has become increasingly important in recent years. Security
refers to the safeguarding of our lives and property. It is critical to ensure the
safety of people and their valuables in order to prevent illicit handling. As a
result, concentrating on door lock or gate security is critical to minimize more
difficulties in the monitored area.

The goal of this project was to create an internet-connected door lock that could
be simply put on a variety of doors, operated via the internet, and trusted for
security. Modern homes are gradually moving away from traditional switches
and toward a centralized control system with remote control switches. A
smartphone-controlled home automation system gives a modern answer. The
most significant advantage of our proposed system is to build smart door lock
which can be access remotely via mobile, to increase security of the house and
to design and implement a cheap and open source home automation.

This project will make human lives more versatile with enhanced security, ease,
and the ability to live an upper-class lifestyle, resulting in our lives becoming
much simpler, finer, accessible, and stable.

3
This paper suggests a technology that will make human lives more versatile by
enhancing security, ease, and the ability to live an upper-class lifestyle, resulting
in our lives becoming much simpler, nicer, more accessible, and consistent. It
shows inventiveness in house control by replacing manual keys with digital
codes and knocks for a door lock at home, anticipating future security trends
and replacing hi-tech manual locks with Digital Smart Locks.

Furthermore, the implementation expenses of the developed system have been


maintained to a minimum, making it accessible to anyone looking for home
protection. The Digital Smart Home, in contrast to the rest of the technologies
described in the literature review,

It's simple to manage and implement. It supports IoT, cellular technology, and a
non-proprietary open-source Android operating platform. The proposed
viewpoint registers, as well as the essential architecture, to work with Wi-Fi
technology for integration, an Android-based App for client ingress, and client
testimonials for dependability and verification. The structure laid out might then
be developed to encompass other facets of house remodelling and dependability.
Additionally, these research projects are routinely supplemented to
accommodate non-Android operating systems.

From connected cars to connected wearables to home security, the Internet of


Things is rapidly marking its presence in every field. Now we have IoT enabled
home automation and security devices that can be controlled from anywhere in
the world using the Internet of Things. There are many kinds of Wi-Fi door lock
available in the market which makes your home more secure and saves time in
finding the keys. Here we are also building a similar Wi-Fi door lock which can
be controlled from the Smartphone.

4
So in this project, we are going to make an IOT based Smrt Door Lock
System using NodeMCU ( ESP 8266), Solenoid Lock, and Adafruit IO. Here
NodeMCU will act as the main controller and connect the user to the door lock
system using the Internet. This allows the user to lock/unlock his Home’s door
lock by using a smartphone from anywhere in the world.

Authors: ujita B. Dabekar, Sandhyarani A. Lahade, Manasi S. Lunge,


Prof.Deepali Yewale

Published year: 2023

5
CHAPTER 3
SYSTEM ANALYSIS

3.1 EXISTING SYSTEM

 In our project, we implemented a door locking and unlocking system that


can be controlled remotely via a mobile application.
 A solenoid lock, a single-channel 12v relay, a NodeMCU ESP8266, and
a 12v dc converter were utilized.
 A solenoid lock can be activated automatically by applying voltage to it.
When an interrupt is activated in a solenoid lock, a low-voltage solenoid
pulls the latch back into the door.
 The latch will remain in place until the interrupt is activated. The
operating voltage of the solenoid lock is 12V.
 In an IoT smart door lock, the NodeMCU ESP8266 is used to connect a
solenoid lock and a relay module.
 It supports IoT, cellular technology, and a non-proprietary open-source
Android operating platform.
 The proposed viewpoint registers, as well as the essential architecture, to
work with Wi-Fi technology for integration, an Android-based App for
client ingress, and client testimonials for dependability and verification.
 The structure laid out might then be developed to encompass other facets
of house remodelling and dependability. Additionally, these research
projects are routinely supplemented to accommodate non-Android
operating systems.

6
3.1.1 Disadvantages of Existing system

 Limited specification.

 Home based monitoring.

 Used individual mobile for unlocking door.

3.2 PROPOSED METHOD

In the Proposed system, The Node MCU platform is an open source IoT
platform that is free to use. It includes software for the ESP8266 Wi-Fi SoC
from Espress if Systems, as well as hardware for the ESP-12 module. The term
"Node MCU" usually refers to the firmware rather than the development kits.
The firmware uses the Lua scripting language. It is built on the eLua project and
uses the Espressif Non-OS SDK for ESP8266. Lua-cjson and SPIFFS are two
open source programmes that are used.

3.2.1 Advantages of proposed system

 Authorized person usage.


 Unique identity for every member at home.
 Document and implement the process .
 Faster access to database and mobile communication.

7
3.3 BLOCK DIAGRAM OF PROPOSED SYSTEM

The following block diagram as the proposed system for project Shown in
below Fig 3.1

Fig.3.1 Block diagram for proposed system

8
3.4 CIRCUIT DIGRAM OF PROPOSED SYSTEM

Fig : 3.2 Circuit diagram for proposed system

Connections for this IoT Smart Door Lock are very simple as we are only
connecting a solenoid lock, relay module, and a buzzer with NodeMCU
ESP8266. The input pin of the relay is connected to the D5 pin of NodeMCU
while VCC and Ground pins are connected to Vin and GND pin of NodeMCU.
The positive pin of the buzzer is connected to the D6 pin of NodeMCU, and the
GND pin is connected to the GND of NodeMCU.

9
CHAPTER 4
SYSTEM REQUIREMENT

4.1 HARDWARE REQUIREMENTS

S. NO CATEGORY COMPONENT FUNCTION

To Open/Close
the Door
Solenoid door lock

As Data
01. HARDWARES NodeMCU (ESP8266) processor

To control high
1 channel 5V relay Module voltage

To indication
Buzzer

For processor
power suppy
B-type USB data cable

Control to
Open/Close the
Android mobile
door
For circuit
connection
Jumper wires

12 v DC supply Power supply to


12 v solenoid
(RPS / Adaptor )
lock
Table :4.1 Hardware Requirements

10
4.2 SOFTWARE REQUIREMENT

S. NO CATEGORY COMPONENT FUNCTION

To Write and upload


Arduino IDE code/sketch

02. SOFTWARES
For webpage
Adafruit IO
Table :4.2 Software Requirements

4.3 POWER SUPPLY:

Power supply is a reference to a source of DC power. A device or


system that supplies Electrical or other types of energy to an output load or
group of loads is called a power supply unit or PSU.

The term is most commonly applied to electrical energy supplies, less


often to mechanical ones, and rarely to other. A 12 v, 50Hz Single phase DC
power supply is given to a Solenoid lock to get 12v supply.

This voltage is converted to DC voltage using a Bridge Rectifier. The


converted pulsating DC voltage is filtered by a 2200uf capacitor and then given
to 7805 voltage regulator to obtain constant 5v supply. This 5v supply is given
to all the components in the circuit. A RC time constant circuit is added to
discharge all the capacitors quickly.

11
4.4 NODE MCU (ESP 8266)

The Node MCU platform is an open source IoT platform that is free to use. It
includes software for the ESP8266 Wi-Fi SoC from Espressif Systems, as well
as hardware for the ESP-12 module. The term "Node MCU" usually refers to
the firmware rather than the development kits. The firmware uses the Lua
scripting language. It is built on the eLua project and uses the Espressif Non-OS
SDK for ESP8266. Lua-cjson and SPIFFS are two open source programmes that
are used.
Based on the ESP8266 Wi-Fi transceiver module and the CH340 USB converter
chip, this compact (Open Source) development and prototyping board is ideal
for IoT applications.The Wi-Fi module is compatible with the 802.11 b/g/n
standard at 2.4 GHz, has an integrated TCP/IP stack, 19.5 dBm output power,
data interface (UART / HSPI / I2C / I2S / Ir Remote Control GPIO / PWM) and
antenna.
It also has a micro USB connector and reset button. Programmable with
Arduino IDE, it includes interpreters for processing commands for languages
such as LUA.

Fig.4.1 NODE MCU (ESP8266)

12
The NodeMCU (Node MicroController Unit) is an open-source software and
hardware development environment built around an inexpensive System-on-a-
Chip (SoC) called the ESP8266. The ESP8266, designed and manufactured by
Espressif Systems, contains the crucial elements of a computer: CPU, RAM,
networking (WiFi), and even a modern operating system and SDK. That makes
it an excellent choice for Internet of Things (IoT) projects of all kinds.

However, as a chip, the ESP8266 is also hard to access and use. You must
solder wires, with the appropriate analog voltage, to its pins for the simplest
tasks such as powering it on or sending a keystroke to the “computer” on the
chip. You also have to program it in low-level machine instructions that can be
interpreted by the chip hardware. This level of integration is not a problem using
the ESP8266 as an embedded controller chip in mass-produced electronics. It is
a huge burden for hobbyists, hackers, or students who want to experiment with
it in their own IoT projects.

But, what about Arduino? The Arduino project created an open-source hardware
design and software SDK for their versatile IoT controller. Similar to
NodeMCU, the Arduino hardware is a microcontroller board with a USB
connector, LED lights, and standard data pins. It also defines standard interfaces
to interact with sensors or other boards. But unlike NodeMCU, the Arduino
board can have different types of CPU chips (typically an ARM or Intel x86
chip) with memory chips, and a variety of programming environments. There is
an Arduino reference design for the ESP8266 chip as well. However, the
flexibility of Arduino also means significant variations across different vendors.
For example, most Arduino boards do not have WiFi capabilities, and some
even have a serial data port instead of a USB port.

13
4.4.1 Features of NODE MCU (ESP 8266)

 Model: ESP8266-12E
 Wireless Standard: 802.11 b/g/n
 Frequency range: 2.4 GHz - 2.5 GHz (2400M-2483.5M)
 Wi-Fi mode: Station / SoftAP / SoftAP+station
 Stack: Integrated TCP/IP
 Output power: 19.5dBm in 802.11b mode
 Data interface: UART / HSPI / I2C / I2S / Ir
 Remote Control GPIO / PWM
 Supports protection mode: WPA / WPA2
 Encryption: WEP / TKIP / AES
 Power supply: from 4.5 VDC to 9 VDC (VIN) or via micro USB
connector
 Consumption: with continuous Wi-Fi transmission about 70 mA (200 mA
MAX) - in standby < 200µA
 Operating temperature: from -40°C to +125°C
 Dimensions (mm): 58×31.20×13
 Weight: 10 grams

Fig.4.2 Specification of Node MCU (ESP 8266)

14
4.4.2 Pin Diagram of NODE MCU (ESP 8266)

Fig.4.3 Pin Diagram of NODE MCU (ESP8266)

 Power pins There are four power pins.


 VIN pin and three 3.3V pins.VIN can be used to directly supply the
NodeMCU/ESP8266 and its peripherals. Power delivered on VIN is
regulated through the onboard regulator on the NodeMCU module – you can
also supply 5V regulated to the VIN pin3.3V pins are the output of the
onboard voltage regulator and can be used to supply power to external
components.
 GND are the ground pins of NodeMCU/ESP8266
 I2C Pins are used to connect I2C sensors and peripherals. Both I2C Master
and I2C Slave are supported. I2C interface functionality can be realized
programmatically, and the clock frequency is 100 kHz at a maximum. It
should be noted that I2C clock frequency should be higher than the slowest
clock frequency of the slave device.

15
 GPIO pins NodeMCU/ESP8266 has 17 GPIO pins which can be assigned to
functions such as I2C, I2S, UART, PWM, IR Remote Control, LED Light
and Button programmatically.
 Each digital enabled GPIO can be configured to internal pull-up or pull-
down, or set to high impedance. When configured as an input, it can also be
set to edge-trigger or level-trigger to generate CPU interrupts.
 UART Pins NodeMCU/ESP8266 has 2 UART interfaces (UART0 and
UART1) which provide asynchronous communication (RS232 and RS485),
and can communicate at up to 4.5 Mbps. UART0 (TXD0, RXD0, RST0 &
CTS0 pins) can be used for communication. However, UART1 (TXD1 pin)
features only data transmit signal so, it is usually used for printing log.
 SPI pins NodeMCU/ESP8266 features two SPIs (SPI and HSPI) in slave
and master modes .
 SDIO Pins NodeMCU/ESP8266 features Secure Digital Input/Output
Interface (SDIO) which is used to directly interface SD cards. 4-bit 25 MHz
SDIO v1.1 and 4-bit 50 MHz SDIO v2.0 are supported.
 PWM Pins The board has 4 channels of Pulse Width Modulation (PWM).
The PWM output can be implemented programmatically and used for driving
digital motors and LEDs. PWM frequency range is adjustable from 1000 μs
to 10000 μs (100 Hz and 1 kHz)
 Control pins are used to control the NodeMCU/ESP8266. These pins
include Chip Enable pin (EN), Reset pin (RST) and WAKE pin.
 EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.RST: RST pin is used to
reset the ESP8266 chip.
 WAKE: Wake pin is used to wake the chip from deep-sleep.Control Pins are
used to control the NodeMCU/ESP8266. These pins include Chip Enable pin
(EN), Reset pin (RST) and WAKE pin.

16
 EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.
 RST: RST pin is used to reset the ESP8266 chip.

4.5 SOLENOID LOCK

In conventional door lock, there is key to pull or push the latch, and we have to
operate it manually, but in solenoid lock, the latch can be operated
automatically by applying a voltage. Solenoid lock has a low-voltage solenoid
that pulls the latch back into the door when an interrupt (Pushbutton, Relay,
etc.) is activated. The latch will retain its position until the interrupt is enabled.
The operating voltage for the solenoid lock is 12V. You can also use 9V, but it
results in slower operation. Solenoid door locks are mainly used in remote
areas to automate operations without involving any human effort.

A solenoid is a coil made up of long, tightly wrapped cables with a diameter that
is greater than its length. The Solenoid Key, on the other hand, is a hybrid of a
key and a Solenoid that is commonly used to electrify devices like automatic
locks and other similar devices. The Solenoid Principle was discovered by
Andre Marie Ampere, a French scientist. In the field of engineering, this term
refers to a device that converts energy into linear motion. An electromagnetic
force is formed when an electric current is used to ignite a coil, pulling the iron
at the coil's core in a linear path.

Fig.4.4 Solenoid Lock

17
4.6 5V RELAY MODULE

Relays and contactors use a low level control signal to switch a much higher
voltage or current supply using a number of different contact arrangements.
Thus far we have seen a selection of Input devices that can be used to detect or
sense a variety of physical variables and signals and are therefore called
Sensors .

An electromagnet activates a relay when a little quantity of current is provided


to the signal pin. The 1-Channel 5V Relay Module is 5V 1-Channel relay
interface board with screw terminals that may be controlled Arduino,AVR, PIC
and ARM microcontrollers.A high-quality relay is included on the board,which
can be handle up to 15 amps at 125 volts and 10 amps at 250 volts.

Fig.4.5 Relay Module

 Normally Open (NO): This pin is normally open unless we provide a


signal to the relay modules signal pin. So, the common contact pin
smashes its link through the NC pin to make a connection through the
NO pin
 Common Contact: This pin is used to connect through the load that we
desire to switch by using the module.

18
 Normally Closed (NC): This NC pin is connected through the COM pin
to form a closed circuit. However, this NC connection will break once
the relay is switched through providing an active high/low signal toward
the signal pin from a microcontroller.
 Signal Pin: The signal pin is mainly used for controlling the relay. This
pin works in two cases like active low otherwise active high. So, in
active low case, the relay activates once we provide an active low signal
toward the signal pin, whereas, in an active high case, the relay will
trigger once we provide a high signal toward the signal pin
 .5V VCC: This pin needs 5V DC to work. So 5V DC power supply is
provided to this pin.
 Ground: This pin connects the GND terminal of the power supply.

4.6.1 5V Relay Module Specifications

The specifications of a 1- channel relay module include the following.

 Voltage supply ranges from 3.75V – 6V


 Quiescent current is 2mA
 Once the relay is active then the current is ~70mA
 The highest contact voltage of a relay is 250VAC/30VDC
 The maximum current is 10A

4.6.2 5V Relay Module Working

The relay uses the current supply for opening or closing switch contacts.
Usually, this can be done through a coil to magnetize the switch contacts &
drags them jointly once activated. A spring drives them separately once the coil
is not strengthened.

19
By using this system, there are mainly two benefits, the first one is, the required
current for activating the relay is less as compared to the current used by relay
contacts for switching. The other benefit is, both the contacts & the coil are
isolated galvanically, which means there is no electrical connection among
them.

4.6.3 Relay Module Circuit Diagram

The circuit diagram of the single-channel relay module circuit is shown below.
In this circuit, we can observe that how the relay module is activated and
deactivated through a digital signal. This signal is applied to a control pin of the
relay module. The following circuit diagram is the internal 5V single channel
relay module diagram.

Fig.4.6 Single Channel Relay Module Circuit Digram

In the above circuit diagram, the single-channel relay module includes resistors
2, transistors, LEDs-2 & a 5V relay. Relay modules are available in two types
based on the control signal type used for activation of the relay.

One relay module comes with an NPN transistor whereas another module comes
with a PNP transistor. If the relay module uses an NPN Transistor, then it will
activate the relay by applying an active high signal to the control pin.
Alternatively, if a PNP is used then the relay will be activated through an active
low signal on the control pin.

20
It’s working in proteus simulation software is, when we provide an active high
signal toward the control pin in a relay module, then the coil in the relay
activates to make the relay active through the connection of the NO pin through
the COM pin. Likewise, once we provide an active low no signal toward the
relay’s control pin, then the coil deactivates using a freewheeling diode so that
the relay will be deactivated.

In the same way, for PNP based relay module, the relay is activated through an
active low signal, whereas an active high signal will deactivate the relay.The
controlling of a 5v single channel relay module can be done by interfacing any
kind of microcontroller. For that, we use a GPIO pin like a digital o/p pin which
gives an active high & low signal toward the control pin. Once the relay
activates, we can listen to an audible sound that comes from the module.

4.6.4 Advantages

The advantages of the relay module include the following.

 A remote device can be controlled easily


 It is triggered with less current but it can also trigger high power
machines
 At a time, several contacts can be controlled using a single signal
 Activating part can be isolated
 It can switch AC or DC
 At high temperatures, it works very well

21
4.6.5 Disadvantages.

 When contacts of relay modules are used overtime then they may damage
 Noise can be generated through the opening & closing of the contacts.
 Time taken for switching is High

4.6.6 Applications

Relay modules are used in different applications which include the following.

 Used in over voltage/under voltage protection system


 Mains Switching
 Speed control of motors through start-delta converters
 Automatic electrical appliances
 Electrical isolation in between high & low power sources
 Lights
 AC voltage load switching using less voltage DC
 Delivery of Isolated power
 Home automation projects
 Switching with High Current

4.7 BUZZER

A buzzer or beeper is audio signalling device which may be mechanical,


electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers and
beepers include alarm devices, timers, train and confirmation of user input such
as a mouse click or keystroke.

An audio signaling device like a beeper or buzzer may be electromechanical


or piezoelectric or mechanical type.

22
The main function of this is to convert the signal from audio to sound.
Generally, it is powered through DC voltage and used in timers, alarm devices,
printers, alarms, computers, etc. Based on the various designs, it can generate
different sounds like alarm, music, bell & siren.

A buzzer is an efficient component to include the features of sound in our


system or project. It is an extremely small & solid two-pin device thus it can be
simply utilized on breadboard or PCB. So in most applications, this component
is widely used.

There are two kinds of buzzers commonly available like simple and readymade.
Once a simple type is power-driven then it will generate a beep sound
continuously. A readymade type looks heavier & generates a Beep. Beep. Beep.
This sound is because of the internal oscillating circuit within it.

This buzzer uses a DC power supply that ranges from 4V – 9V. To operate this,
a 9V battery is used but it is suggested to utilize a regulated +5V/+6V DC
supply. Generally, it is connected through a switching circuit to switch ON/OFF
the buzzer at the necessary time interval.

Fig.4.7 Buzzer

23
4.7.1 Working Principle

The working principle of a buzzer depends on the theory that, once the voltage
is given across a piezoelectric material, then a pressure difference is produced.
A piezo type includes piezo crystals among two conductors.

Once a potential disparity is given across these crystals, then they thrust
one conductor & drag the additional conductor through their internal property.
So this continuous action will produce a sharp sound signal.

4.7.2 Specifications

The specifications of the buzzer include the following.

 Color is black
 The frequency range is 3,300Hz
 Operating Temperature ranges from – 20° C to +60°C
 Operating voltage ranges from 3V to 24V DC
 The sound pressure level is 85dBA or 10cm
 The supply current is below 15mA

4.7.3 Advantages

The advantages of a buzzer include the following.


 Simply Compatible
 Frequency Response is Good
 Size is small
 Energy Consumption is less
 The Range of Voltage usage is Large
 Sound Pressure is high

24
4.7.4 Disadvantages

The disadvantages of the buzzer include the following.


 Controlling is a little hard
 Generates Annoying Sound
 Training is necessary to know how to repair the condition without just
turning off.

4.7.5 Applications

The applications of the buzzer include the following.


 Communication Devices
 Electronics used in Automobiles
 Alarm Circuits
 Portable Devices
 Security Systems
 Timers
 Household Appliances
 Electronic Metronomes
 Sporting Events
 Annunciator Panels
 Game Shows

25
4.8 B-TYPE USB DATA CABLE

A USB (Universal Serial Bus) is a standard connection interface that enables


communication between devices and a host controller such as a personal
computer. It is most commonly used to connect peripherals such as mice,
keyboards, printers, scanners, cameras, and flash drives to a computer.

Popularly known as Micro USB, this is a very common USB connector you will
find in many smartphones these days. They were designed for use with smaller
devices, such as smartphones, digital cameras, and other portable devices. The
micro USB connector is made to be more durable and stand up to the kind of
abuse portable electronics can undergo.

However, with the advent of USB Type B, Micro USBs are slowly getting
phased out in newer models of high-end smartphones. But Micro USB is still
widely used in budget smartphones and other electronic devices worldwide.

Fig.4.8 B-type USB Data Cable

4.9 JUMPER WIRES

Jumper wires are simply wires that have connector pins at each end, allowing
them to be used to connect two points to each other without soldering. Jumper
wires are typically used with breadboards and other prototyping tools in order to

26
make it easy to change a circuit as needed. Fairly simple. In fact, it doesn’t get
much more basic than jumper wires.

Though jumper wires come in a variety of colors, the colors don’t actually mean
anything. This means that a red jumper wire is technically the same as a black
one. But the colors can be used to your advantage in order to differentiate
between types of connections, such as ground or power.

Fig.4.9 Jumper Wires

4.9.1 Types of Jumper Wires

Jumper wires typically come in three versions:

 male-to-male,

 male-to-female,and

 female-to-female.

The difference between each is in the end point of the wire. Male ends have a
pin protruding and can plug into things, while female ends do not and are used
to plug things into. Male-to-male jumper wires are the most common and what
you likely will use most often. When connecting two ports on a breadboard, a
male-to-male wire is what you’ll need.

27
CHAPTER 5
SOFTWARE ANALYSIS

5.1 ARDUINO IDE


The Arduino Integrated Development Environment - or Arduino Software
(IDE) - contains a text editor for writing code, a message area, a text console,
a toolbar with buttons for common functions and a series of menus. It connects
to the Arduino hardware to upload programs and communicate with them.

Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension
.ino. The editor has features for cutting/pasting and for searching/replacing
text. The message area gives feedback while saving and exporting and also
displays errors. The console displays text output by the Arduino Software
(IDE), including complete error messages and other information. The bottom
righthand corner of the window displays the configured board and serial port.
The toolbar buttons allow you to verify and upload programs, create, open,
and save sketches, and open the serial monitor.

NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with
the extension .pde. It is possible to open these files with version 1.0, you will
be prompted to save the sketch with the .ino extension on save.

5.1.1 Arduino IDE File


 New Creates a new instance of the editor, with the bare minimum structure
of a sketch already in place.

 Open Allows to load a sketch file browsing through the computer drives
and folders.

28
 Open Recent Provides a short list of the most recent sketches, ready to be
opened.

 Sketchbook Shows the current sketches within the sketchbook folder


structure; clicking on any name opens the corresponding sketch in a new
editor instance.

 Examples Any example provided by the Arduino Software (IDE) or library


shows up in this menu item. All the examples are structured in a tree that
allows easy access by topic or library.

 Close Closes the instance of the Arduino Software from which it is clicked.

 Save Saves the sketch with the current name. If the file hasn't been named
before, a name will be provided in a "Save as.." window.

 Save as... Allows to save the current sketch with a different name.

 Page Setup It shows the Page Setup window for printing.

 Print Sends the current sketch to the printer according to the settings
defined in Page Setup.

 Preferences Opens the Preferences window where some settings of the IDE
may be customized, as the language of the IDE interface.

 Quit Closes all IDE windows. The same sketches open when Quit was
chosen will be automatically reopened the next time you start the IDE.

5.1.2 Arduino IDE Edit

 Undo/Redo Goes back of one or more steps you did while editing; when
you go back, you may go forward with Redo.

29
 Cut Removes the selected text from the editor and places it into the
clipboard.

 Copy Duplicates the selected text in the editor and places it into the
clipboard.

 Copy for Forum Copies the code of your sketch to the clipboard in a form
suitable for posting to the forum, complete with syntax coloring.

 Copy as HTML Copies the code of your sketch to the clipboard as HTML,
suitable for embedding in web pages.

 Paste Puts the contents of the clipboard at the cursor position, in the editor.

 Select All Selects and highlights the whole content of the editor.

 Comment/Uncomment Puts or removes the // comment marker at the


beginning of each selected line.

 Increase/Decrease Indent Adds or subtracts a space at the beginning of each


selected line, moving the text one space on the right or eliminating a space
at the beginning.

 Find Opens the Find and Replace window where you can specify text to
search inside the current sketch according to several options.

 Find Next Highlights the next occurrence - if any - of the string specified as
the search item in the Find window, relative to the cursor position.

 Find Previous Highlights the previous occurrence - if any - of the string


specified as the search item in the Find window relative to the cursor
position.

5.1.3 Arduino IDE Sketch

 Verify/Compile Checks your sketch for errors compiling it; it will report
memory usage for code and variables in the console area.

30
 Upload Compiles and loads the binary file onto the configured board
through the configured Port.

 Upload Using Programmer This will overwrite the bootloader on the board;
you will need to use Tools > Burn Bootloader to restore it and be able to
Upload to USB serial port again. However, it allows you to use the full
capacity of the Flash memory for your sketch. Please note that this
command will NOT burn the fuses. To do so a Tools -> Burn
Bootloader command must be executed.

 Export Compiled Binary Saves a .hex file that may be kept as archive or
sent to the board using other tools.

 Show Sketch Folder Opens the current sketch folder.

 Include Library Adds a library to your sketch by inserting #include


statements at the start of your code. For more details, see libraries below.
Additionally, from this menu item you can access the Library Manager and
import new libraries from .zip files.

 Add File... Adds a supplemental file to the sketch (it will be copied from its
current location). The file is saved to the data

5.1.4 Arduino IDE Tools


 Auto Format This formats your code nicely: i.e. indents it so that opening
and closing curly braces line up, and that the statements inside curly braces
are indented more.

 Archive Sketch Archives a copy of the current sketch in .zip format. The
archive is placed in the same directory as the sketch.

 Fix Encoding & Reload Fixes possible discrepancies between the editor
char map encoding and other operating systems char maps.

31
 Serial Monitor Opens the serial monitor window and initiates the exchange
of data with any connected board on the currently selected Port. This
usually resets the board, if the board supports Reset over serial port
opening.

 Board Select the board that you're using. See below for descriptions of the
various boards.

 Port This menu contains all the serial devices (real or virtual) on your
machine. It should automatically refresh every time you open the top-level
tools menu.

5.1.5 Arduino IDE Sketchbook

The Arduino Software (IDE) uses the concept of a sketchbook: a standard


place to store your programs (or sketches). The sketches in your sketchbook
can be opened from the File > Sketchbook menu or from the Open button on
the toolbar. The first time you run the Arduino software, it will automatically
create a directory for your sketchbook. You can view or change the location of
the sketchbook location from with the Preferences dialog.

Beginning with version 1.0, files are saved with a .ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version
1.0 and later, the software will automatically rename the extension to .ino.

32
5.1.6 Arduino IDE Uploading

Before uploading your sketch, you need to select the correct items from
the Tools > Board and Tools > Port menus. The boards are described below.
On the Mac, the serial port is probably something
like /dev/tty.usbmodem241 (for an UNO or Mega2560 or Leonardo)
or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board),
or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a Keyspan
USB-to-Serial adapter). On Windows, it's probably COM1 or COM2 (for a
serial board) or COM4, COM5, COM7, or higher (for a USB board) - to find
out, you look for USB serial device in the ports section of the Windows
Device Manager.

On most boards, you'll see the RX and TX LEDs blink as the sketch is
uploaded. The Arduino Software (IDE) will display a message when the
upload is complete, or show an error.When you upload a sketch, you're using
the Arduino bootloader, a small program that has been loaded on to the
microcontroller on your board.

It allows you to upload code without using any additional hardware. The
bootloader is active for a few seconds when the board resets; then it starts
whichever sketch was most recently uploaded to the microcontroller. The
bootloader will blink the on-board (pin 13) LED when it starts (i.e. when the
board resets).

5.1.7 Arduino IDE Libraries

Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from
the Sketch > Import Library menu.

33
This will insert one or more #include statements at the top of the sketch and
compile the library with your sketch. Because libraries are uploaded to the
board with your sketch, they increase the amount of space it takes up. If a
sketch no longer needs a library, simply delete its #include statements from the
top of your code.

There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or
through the Library Manager. Starting with version 1.0.5 of the IDE, you do
can import a library from a zip file and use it in an open sketch. See
these instructions for installing a third-party library.

5.1.7 Arduino IDE Boards

The board selection has two effects: it sets the parameters (e.g. CPU speed and
baud rate) used when compiling and uploading sketches; and sets and the file
and fuse settings used by the burn bootloader command. Some of the board
definitions differ only in the latter, so even if you've been uploading
successfully with a particular selection you'll want to check it before burning
the bootloader. You can find different boards here.

5.1.8 ESP8266: uploading code from Arduino IDE

The easiest way to configure the whole setup is to follow the guide
provided here, which uses the boards manager of the Arduino IDE. As
explained, we first need to install version 1.6.5 of the Arduino IDE (or greater),
which can be found in Arduino’s repository of software.

34
After the installation, we need to open the Arduino IDE and access the
preferences menu,

In the preferences menu, we need to add the following link to the Additional
BoardsManager

URLs : http://arduino.esp8266.com/stable/package_esp8266com_index.json.

After that configuration, we need to do the installation of the ESP platform. To


do so, we access the Boards Manager menu,On the Boards Menu manager, we
search for the keyword “ESP” and the corresponding package will appear.

Then we just click install, as shown in figure .

35
Installation of the ESP8266 platform from the Boards Manager.
Once the installation completes, we need to select the correct board options for
the ESP-01 board. In the board type, in the tools tab, we choose “Generic
ESP8266 Board”, as shown in figure

Configuration of the board for the ESP-01.


In the programmer entry of the same tab, we choose “esptool”, as shown in
figure.

36
Configuration of the programmer for the ESP-01.
Finally, we can start writing code. After finishing, we just press the upload
button (same as we would do for a regular Arduino board) and it starts
uploading. Figure 10 shows the result of a successful upload in the command
window.

Command window after a successful code upload for the ESP-01 board.

It’s important to note that after the code is uploaded, the device will start to run
it. So, if we want to upload a new program, wee need to reset the power of the
device, in order to guarantee that it enters flashing mode again.

37
5.2 ADAFRUIT IO

Adafruit IO is an open data platform that allows you to aggregate, visualize,


and analyze live data on the cloud. Using Adafruit IO, you can upload,
display, and monitor your data over the internet, and make your project IoT
enabled. You can control motors, read sensor data, and make cool IoT
applications over the internet using Adafruit IO. For test and try, with some
limitation, Adafruit IO is free to use. We have also used Adafruit IO
with Raspberry Pi, Arduino and ESP3266.

5.2.1 Adafruit IO Setup for IoT Door Lock

Adafruit IO is an open data platform that allows you to aggregate, visualize,


and analyze live data on the cloud. Using Adafruit IO, you can upload,
display, and monitor your data over the internet, and make your project IoT
enabled. You can control motors, read sensor data, and make cool IoT
applications over the internet using Adafruit IO. For test and try, with some
limitation, Adafruit IO is free to use. We have also used Adafruit IO
with Raspberry Pi, Arduino and ESP3266

1. To use Adafruit IO, first, you have to create an account on Adafruit IO.
To do this, go to the Adafruit IO website and click on ‘Get started for
Free’ on the top right of the screen.

38
2,After finishing the account creation process, log in to your account and
click on ‘AIO Key’ on the top right corner to get your account username
and AIO key.

When you click on ‘AIO Key,’ a window will pop up with your Adafruit IO
AIO Key and username. Copy this key and username, it will be needed later in
the code.

When you click on ‘AIO Key,’ a window will pop up with your Adafruit IO
AIO Key and username. Copy this key and username, it will be needed later in
the code.

39
3. Now, after this, you need to create a feed. To create a feed, click on ‘Feed.’
Then click on ‘Actions,’ and then click on ‘Create a New Feed’ as shown in
the image below.

4. After this, a new window will open to enter the Name and Description of the
feed. The writing description is optional.

5. Click on ‘Create,’ after this; you will be redirected to your newly created
feed.

After creating the feed, now create an Adafruit IO dashboard to add a toggle
button to open and close the door lock. For that, first, create a dashboard and
then add your feed in this dashboard.

To create a dashboard, click on the Dashboard option and then click on the
‘Action,’ and after this, click on ‘Create a New Dashboard.’

40
In the next window, enter the name for your dashboard and click on ‘Create.’

6. As the dashboard is created, now, we will add our feeds to the dashboard. To
add a feed, click on the ‘+’ in the top right corner.

Here we will add a toggle button blocks to turn open and close the Wi-Fi door
lock. To add a button on the dashboard, click on the Toggle block.

41
In the next window, it will ask you to choose the feed, so click on your feed.

After adding the toggle button, my dashboard looks like below. You can edit
the dashboard by clicking on the settings buttons.

42
CHAPTER 6

PROTOTYPE MODEL

Fig.6.1 Prototype Model

Fig.6.2 Working of Prototype Model

43
CHAPTER 7
CONCLUSION

This project will make human lives more versatile with enhanced security, ease,
and the ability to live an upper-class lifestyle, resulting in our lives becoming
much simpler, finer, accessible, and stable. The cost of implementing the
designed system has been kept low, making it affordable to.Everyone is looking
for home security. In contrast to the majority of the technologies described in
the literature review, the Iot-based door lock system is simple to implement and
manage. It supports IoT, cellular technology, and an open-source Android
system platform that is not proprietary. The proposed system intends to address
the shortcomings of the current system and to improve it by implementing
certain innovative ideas suggested by some related publications.

44
CHAPTER 8

FUTURE ENHANCEMENT

From connected cars to connected wearables to home security, the Internet


of Things is rapidly marking its presence in every field. Now we have IoT
enabled home automation and security devices that can be controlled from
anywhere in the world using the Internet of Things. There are many kinds of
Wi-Fi door lock available in the market which makes your home more secure
and saves time in finding the keys. Here we are also building a similar Wi-Fi
door lock which can be controlled from the Smartphone.

So in this project, we are going to make an IOT based Door Lock System
using NodeMCU, Solenoid Lock, and Adafruit IO. Here NodeMCU will act as
the main controller and connect the user to the door lock system using the
Internet. This allows the user to lock/unlock his Home’s door lock by using a
smartphone from anywhere in the world.

45
REFERENCES

[1] Professor Nikesh Aote1, Tejas Belsare2, Shridhar Giri3, Shivam Giradkar4,
Shubham Mohekar, Smart Digital Door Lock System, International Journal of
Recent Engineering Research and Development (IJRERD) ISSN: 2455-8761
www.ijrerd.com || April 2018 || PP. 41-45 || Volume 03 – Issue 04

[2] Harshith Gadupu, Osa Mokharji, Raunak Kankaria, Shrey Kumar, and
Kayalvizhi Jayavel, ACCESS - IoT enabled smart lock, International Journal of
Reconfigurable and Embedded Systems (IJRES), Vol. 10, No. 3, November
2021, pp. 176-185 ISSN: 2089-4864, DOI: 10.11591/ijres.v10.i3.pp

[3] Firza Fadlullah Asman1, Endi Permata2, Mohammad Fatkhurrokhman,


Prototype of Smart Lock Based on Internet Of Things (IOT) With
ESP8266,Jurnal Ilmiah Teknik Elektro Komputer dan Informatika,Vol. 5, No.
2, December 2019, pp. 101–111 ISSN: 2338-3070, DOI: 10.26555/jiteki.v5

[4] Sanjib Kumar Dhara1, Nilankar Bhanja2, Thandassery Vidyalall Vikash3


(Sanjib Kumar Dhara1, Nilankar Bhanja2, Thandassery Vidyalall Vikash3)
(SanjibKumar D IOT BASED DIGITAL DOOR, Supriyo De

[5] ArpitaMishra, Siddharth Sharma, SachinDubey, S.K.Dubey, “PASSWORD


BASED SECURITY LOCK SYSTEM” International Journal of Advanced
Technology in Engineering and Science www.ijates.com Volume No.02, Issue
No. 05, May 2014 ISSN (online): 2348 – 7550.

[6] International Journal of Research in Advent Technology, Vol.4, No.8,


August 2016 E-ISSN: 2321-9637 Available online at www.ijrat.org 122
Arduino Based Door Access Control JanakiVenukumar, Naveen.S.

[7] Oke Alice O., Adigun Adebisi A., Falohun Adeleye S., and Alamu F. O. ,
“DEVELOPMENT OF A PROGRAMMABLE ELECTRONIC
DIGITALCODE LOCK SYSTEM” , International Journal of Computer and
Information Technology (ISSN: 2279 – 0764) Volume 02– Issue 01, January
2013 .

[8] Lia Kamelia, Alfin Noorhassan S.R, Mada Sanjaya and W.S., Edi Mulyana ,
“DOOR-AUTOMATION SYSTEM USING BLUETOOTH-BASED
ANDROID FOR MOBILE PHONE” , ARPN Journal of Engineering and

46
Applied Sciences , VOL. 9, NO. 10, OCTOBER 2014.

[9] K.Srinivasa Ravi, G.H.Varun, T.Vamsi, P.Pratyusha, “RFID BASED


SECURITY SYSTEM” International Journal of Innovative Technology and
Exploring Engineering (IJITEE), Volume-2, Issue-5, April 2013.

[10] https://www.hackster.io/adarsh-bhola/iot-based-door-lock-system-4a40f0

[11] https://iotdesignpro.com/projects/iot-based-smart-door-lock-system-using-
nodemcu

47
APPENDIX

PROGRAM CODING UPLOADED IN NODEMCU ESP8266

#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
const char *ssid = "Wi-Fi Name"; // Enter your WiFi Name
const char *pass = "Password"; // Enter your WiFi Password
WiFiClient client;
#define MQTT_SERV "io.adafruit.com"
#define MQTT_PORT 1883
#define MQTT_NAME "Adafruit IO Username"
#define MQTT_PASS "Your API Key" // Enter the API key that you copied
from your adafrui IO account
#define relay D5
#define buzzer D6
Adafruit_MQTT_Client mqtt(&client, MQTT_SERV, MQTT_PORT,
MQTT_NAME, MQTT_PASS);
//Set up the feed you're subscribing to
Adafruit_MQTT_Subscribe Lock = Adafruit_MQTT_Subscribe(&mqtt,
MQTT_NAME "/f/Lock");
void setup()
{
Serial.begin(115200);
delay(10);
mqtt.subscribe(&Lock);
pinMode(relay, OUTPUT);

48
pinMode(buzzer, OUTPUT);
digitalWrite(relay, LOW); // keep motor off initally
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print("."); // print ... till not connected
}
Serial.println("");
Serial.println("WiFi connected");
}
void loop()
{
MQTT_connect();
Adafruit_MQTT_Subscribe * subscription;
while ((subscription = mqtt.readSubscription(5000)))
{
if (subscription == &Lock)
{
//Print the new value to the serial monitor
Serial.println((char*) Lock.lastread);
if (!strcmp((char*) Lock.lastread, "Close"))
{
digitalWrite(relay, LOW);
Serial.print("Door Unlocked");
49
digitalWrite(buzzer, HIGH);
delay(2000);
digitalWrite(buzzer, LOW);
}
if (!strcmp((char*) Lock.lastread, "Open"))
{
digitalWrite(relay, HIGH);
Serial.print("Door Closed");
digitalWrite(buzzer, HIGH);
delay(2000);
digitalWrite(buzzer, LOW);
}
}
}
}
void MQTT_connect()
{
int8_t ret;
// Stop if already connected.
if (mqtt.connected())
{
return;
}
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) // connect will return 0 for connected
{
mqtt.disconnect();
50
delay(5000); // wait 5 seconds
retries--;
if (retries == 0)
{
// basically die and wait for WDT to reset me
while (1);
}
}
}

51

You might also like