Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views16 pages

Smart Lock System

The document presents a project report on a Smart Lock System developed using IoT technology, specifically utilizing the ESP32 microcontroller and Adafruit IO for remote access control. The system allows users to lock or unlock doors via a mobile device or web interface, enhancing security and convenience while providing real-time feedback through a buzzer. The project showcases a scalable and cost-effective solution suitable for smart home applications, with potential for future upgrades like biometric authentication.

Uploaded by

suvathi.p77
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)
8 views16 pages

Smart Lock System

The document presents a project report on a Smart Lock System developed using IoT technology, specifically utilizing the ESP32 microcontroller and Adafruit IO for remote access control. The system allows users to lock or unlock doors via a mobile device or web interface, enhancing security and convenience while providing real-time feedback through a buzzer. The project showcases a scalable and cost-effective solution suitable for smart home applications, with potential for future upgrades like biometric authentication.

Uploaded by

suvathi.p77
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/ 16

SMART LOCK SYSTEM

A MINI PROJECT REPORT

Submitted by
SUBRAMANIAN T H 412622106028
SWATHI P 412622106029
VEERARAGAVAN M 412622106030

in partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING

IN

ELECTRONICS AND COMMUNICATION ENGINEERING

SRI VENKATESWARAA COLLEGE OF


TECHNOLOGY
(AN AUTONOMOUS INSTITUTION)

MAY 2025

i
SRI VENKATESWARAA COLLEGE OF TECHNOLOGY
(AN AUTONOMOUS INSTITUTION)

BONAFIDE CERTIFICATE

Certified that this project report “SMART LOCK SYSTEM” is the


bonafide work of “SUBRAMANIAN T H (412622106028), SWATHY
P(412622106029), VEERARAGAVAN M (412622106030)” who
carried out the project work under my supervision.

SIGNATURE

Dr. N. Abdur Rahman (HEAD OF THE DEPARTMENT)


Department of Electronics and Communication Engineering,
Sri Venkateswaraa College of Technology, Vadakal,
Sriperumbudur.

This project work was submitted for viva voce held on ______________
at Sri Venkateswaraa College of Technology.
Subject Code: ET3491 (Embedded Systems and IoT Design Laboratory)

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ABSTRACT

This project focuses on the development of a Smart Lock System that


utilizes Internet of Things (IoT) technology to offer a secure and
convenient method of access control. The core of the system is built
around the ESP32 microcontroller, which provides integrated Wi-Fi
and Bluetooth capabilities for seamless wireless communication. By
replacing traditional locking mechanisms, the system allows users to
lock or unlock a door remotely using a mobile device or web
interface, enhancing both usability and security.

To establish remote interaction, the project integrates Adafruit IO—a


cloud-based IoT platform that uses MQTT protocol—to facilitate
real-time communication between the user and the hardware. A relay
module connected to the ESP32 controls a 12V solenoid lock,
allowing physical access only upon authorized digital commands.
Additionally, a buzzer is used to provide immediate audio feedback,
indicating successful operations or alerting users to potential
unauthorized access attempts.

The system is designed to be low-cost and easy to implement using


widely available electronic components, making it suitable for smart
home applications. It also offers potential for future upgrades such as
biometric authentication, mobile app notifications, Bluetooth-based
access, or environmental sensors. Overall, the project demonstrates a
scalable and practical IoT solution for enhancing everyday security
through modern wireless control.

3
TABLE OF CONTENTS

S.NO TITLE PAGE


NO
1 INTRODUCTION 4

2 OBJECTIVES 5

3 LITERATURE SURVEY 6

4 SYSTEM DESIGN AND


7
ARCHITECTURE

5 WORKING
9
METHODOLOGY

6 IMPLEMENTATION 10

7 CONCLUSION 15

4
INTRODUCTION

In the era of smart technologies, enhancing security through


intelligent systems is becoming increasingly essential. The Smart
Lock System presented in this project offers a modern, IoT-based
approach to access control, replacing conventional locks with a
remotely controllable, automated locking mechanism. This system is
designed using the ESP32 microcontroller, a Wi-Fi and Bluetooth-
enabled device that allows seamless communication between the user
and the locking mechanism.

To enable remote operation and real-time control, the system is


integrated with Adafruit IO, a cloud-based IoT platform. Through this
platform, users can securely send commands from a smartphone or
web interface to the ESP32. When access is granted, the ESP32
activates a relay module, which energizes a 12V solenoid lock to
unlock the door.

Additionally, a buzzer is included to provide auditory feedback, such


as indicating successful unlocking, system status, or unauthorized
access attempts.

This project highlights how IoT and cloud technologies can be


combined to create practical and cost-effective smart security
solutions. The use of ESP32 and Adafruit IO enhances flexibility,
allowing features such as remote monitoring, logging, and potential
integration with mobile notifications or automation routines.

5
OBJECTIVES

The primary objective of this project is to develop a reliable and


efficient Smart Lock System that leverages Internet of Things (IoT)
technology for enhanced access control. The system aims to replace
traditional locking mechanisms with a remotely controllable solution,
offering both security and convenience. The project utilizes the
ESP32 microcontroller as the central control unit, taking advantage of
its built-in Wi-Fi and Bluetooth capabilities to handle user commands
wirelessly.

Another key goal is to integrate Adafruit IO, a cloud-based IoT


platform, to facilitate remote communication between the user and the
ESP32. Through this platform, users can unlock the door using a
smartphone or web interface. The system also seeks to demonstrate
how a relay module can effectively control a 12V solenoid lock based
on commands from the ESP32, enabling secure physical access only
when authorized.

To enhance user interaction and security feedback, the project


includes a buzzer to provide real-time audio indications for successful
operations or alerts in case of unauthorized access attempts.
Additionally, this project aims to showcase the feasibility of building
a cost-effective, scalable smart security solution using commonly
available electronic components. Finally, the system is designed with
future extensibility in mind, allowing for potential upgrades such as
biometric authentication, Bluetooth unlocking, sensor integration, or
mobile app-based notifications.

6
LITERATURE SURVEY

Smart locks have gained popularity as secure, IoT-enabled


alternatives to traditional locks. Numerous studies have implemented
microcontrollers like ESP8266 and ESP32 for wireless control of
locking systems. Bhatt et al. (2020) demonstrated a Wi-Fi-based
smart lock using NodeMCU and Blynk, though it lacked scalability
and real-time cloud integration. Our project addresses this by using
the ESP32 for enhanced performance and connectivity.

Adafruit IO is a cloud platform commonly used in IoT projects due to


its ease of use and reliable MQTT protocol. Patil et al. (2022) used it
for remote control of home appliances but limited its application to
basic switching. Our system integrates Adafruit IO for secure and
responsive smart lock control over the internet.

Relay modules are widely employed for switching high-power


devices like solenoid locks. Prior work shows effective switching but
often lacks timed control and safety considerations. We use a relay to
trigger a 12V solenoid lock with proper isolation for safe operation.

Buzzers have been used for alerting users of state changes or


unauthorized access. Sharma et al. (2019) incorporated buzzers in
home automation for basic feedback. Our project enhances this by
giving real-time audio alerts for lock status and system activity.

In summary, our system combines the strengths of previous designs


ESP32 for control, Adafruit IO for cloud access, a relay-driven
solenoid lock for actuation, and a buzzer for feedback—into a
compact, reliable, and secure IoT smart lock solution.

7
SYSTEM DESIGN AND ARCHITECTURE

BLOCK COMPONENTS
 Microcontroller Unit (NodeMCU ESP8266)
 Control Logic & Processing
 Relay Driver Circuit
 Locking Mechanism (Solenoid Lock)
 Alarm Unit (Buzzer)
 Alert Notification System (optional SMS/email)
 Power Supply

8
DESCRIPTION OF THE BLOCK DIAGRAM

The block diagram shows the working flow of a Wi-Fi Based Smart
Lock System. The system operates using a NodeMCU microcontroller
that interfaces with user authentication inputs.

Once a user authentication attempt is made, the NodeMCU processes


this input. If authentication fails, it triggers the buzzer for a brief
period to alert nearby individuals. If authentication succeeds, it
triggers a relay module, which powers the solenoid lock, unlocking
the door. Optionally, an alert notification can be sent over WiFi
confirming access or intrusion attempts. The system is powered via a
12V DC power supply with proper voltage regulation for the solenoid
and microcontroller.

DESCRIPTION OF THE SYSTEM ARCHITECTURE

The Smart Lock System Architecture provides secure and automated


access control using IoT technology. The Authentication Unit
receives user credentials via a mobile app, keypad, or RFID and sends
them to the NodeMCU (ESP8266) via WiFi or GPIO. Acting as the
central processor, the NodeMCU validates input and triggers a Relay
Driver Circuit to safely power the Solenoid Lock with a 12V DC
supply. The relay isolates the microcontroller from high voltages,
protecting the system. On failed authentication, a buzzer alerts nearby
users. An optional notification module can send real-time alerts to the
owner. The system is powered by a 12V supply for the lock and 5V
for the NodeMCU and relay.

9
WORKING METHODOLOGY

The Wi-Fi Based Smart Lock System integrates Adafruit IO with a


NodeMCU (ESP8266) to enable remote and secure control of a
solenoid lock over the internet. The process begins with the user
logging into an Adafruit IO dashboard via a mobile device or web
browser. The user then sends a command (such as “Unlock” or
“Lock”) through a button widget or toggle switch configured in
Adafruit IO.
The NodeMCU, connected to Wi-Fi, continuously listens for data
from the Adafruit IO feed using the MQTT protocol or REST API.
When it receives a command from the dashboard, the NodeMCU
processes it and makes a decision based on the input. If the received
command is to unlock, it activates a relay module, which in turn
powers the solenoid lock using a 12V DC supply, allowing the door to
unlock. If the command is to lock, the NodeMCU deactivates the
relay, cutting off power to the solenoid and locking the door.
If an unauthorized or incorrect access attempt is detected (optional
feature via additional input verification or failed attempts counter),
the system can trigger a buzzer to alert nearby individuals. The
system can also send feedback to the Adafruit IO dashboard (e.g.,
lock status updates), providing real-time monitoring for the user.
Power is managed using a 12V power supply for the solenoid lock
and a regulated 5V supply for the NodeMCU and relay module. This
methodology ensures that the lock system is cloud-connected, secure,
and remotely controllable, making it suitable for smart homes and
IoT-based security systems.

10
IMPLEMENTATION

This project implements a Smart Lock System using a NodeMCU


(ESP8266) and Adafruit IO for remote control via the internet. A
solenoid lock is operated through a single-channel relay controlled by
the NodeMCU, which responds to commands from an Adafruit IO
dashboard. The user can lock or unlock the system remotely using a
mobile or web interface. A buzzer provides local audio feedback
during operation, and power is supplied via a barrel jack. The system
enables secure, wireless access control and demonstrates a practical
IoT-based home automation solution using minimal components with
real-time cloud connectivity.
The circuit connects the NodeMCU to a relay, solenoid lock, and
buzzer, all responding to the Adafruit IO dashboard via MQTT. The
NodeMCU monitors button inputs in real-time, enabling quick
lock/unlock actions. This simple and cost-effective setup
demonstrates how basic IoT components can be used to build secure,
remote-controlled systems, and it can be further expanded with
features like authentication or notifications.

11
PROGRAM

#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
const char *ssid = "Manavalan"; // Enter your WiFi Name
const char *pass = "12345678"; // Enter your WiFi Password
WiFiClient client;
#define MQTT_SERV "io.adafruit.com"
#define MQTT_PORT 1883
#define MQTT_NAME "Veeruuu"
#define MQTT_PASS "aio_vaAt86onzC3Fequ6DzbBFrb6he69" //
Enter the API key that you copied from your adafrui IO account
#define relay 14 //D5
#define buzzer 12 //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 "/feeds/Lock");
void setup()
{
Serial.begin(115200);
delay(10);

mqtt.subscribe(&Lock);
12
Serial.println("Subscribed to Lock feed");
pinMode(relay, OUTPUT);
pinMode(buzzer, OUTPUT);
// Serial.println("Testing relay and buzzer...");
// digitalWrite(relay, LOW); // Turn ON relay
// digitalWrite(buzzer, HIGH); // Turn ON buzzer
// delay(2000);
// digitalWrite(relay, LOW); // Turn OFF relay
// digitalWrite(buzzer, LOW); // Turn OFF buzzer
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;

13
// Serial.println("Waiting for MQTT message...");
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, HIGH);
Serial.println("Door Unlocked");
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
}
if (!strcmp((char*) Lock.lastread, "Open"))
{
digitalWrite(relay, LOW);
Serial.println("Door Closed");
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
}
}
}

14
}
void MQTT_connect()
{
int8_t ret;
// Stop if already connected.
if (mqtt.connected())
{
Serial.println("MQTT Connected");
return;
}
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) // connect will return 0 for
connected
{
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0)
{
// basically die and wait for WDT to reset me
while (1);
}
}
}

15
CONCLUSION

The implementation of the Wi-Fi Based Smart Lock System using


NodeMCU ESP8266 and Adafruit IO successfully demonstrates a
practical and secure solution for modern access control. By leveraging
IoT technology and cloud integration, the system allows users to
remotely lock or unlock their doors from anywhere using a mobile
device or web dashboard. This enhances both convenience and
security, especially in residential and small commercial environments.

The project integrates key components including the NodeMCU


microcontroller, relay module, solenoid lock, and Adafruit IO
platform to create a seamless user experience. The NodeMCU serves
as the processing unit, interpreting commands from the internet and
actuating the lock mechanism accordingly. The use of Adafruit IO
ensures real-time communication and monitoring capabilities,
allowing the owner to manage and track access events remotely.

This system also includes additional features such as buzzer alerts for
unauthorized attempts and potential expansion for access logging or
OTP-based security. Its modular design allows for future upgrades
like fingerprint authentication, facial recognition, or integration with
home automation systems.

In conclusion, the smart lock system not only addresses common


security concerns but also aligns with the growing trend of IoT-based
automation. It is an efficient, scalable, and cost-effective solution that
demonstrates the potential of embedded systems in enhancing
everyday life through smart technology.

16

You might also like