0% found this document useful (0 votes)
4 views

ET3451 MINI PROJECT

The document outlines the development of a Smart Lock System using Python and IoT technology, aimed at enhancing security for homes and offices. It details the necessary software, hardware components, and a step-by-step procedure for implementation, including an algorithm for user authentication. The project culminates in a successful simulation of the smart lock system using provided code.

Uploaded by

Shanmugam K
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)
4 views

ET3451 MINI PROJECT

The document outlines the development of a Smart Lock System using Python and IoT technology, aimed at enhancing security for homes and offices. It details the necessary software, hardware components, and a step-by-step procedure for implementation, including an algorithm for user authentication. The project culminates in a successful simulation of the smart lock system using provided code.

Uploaded by

Shanmugam K
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/ 11

SMART LOCK SYSTEM

AIM:
To implement the smart lock system using python

SOFTWARE REQUIRED:
1.Python (or) Google Colab.

INTRODUCTION:

In today's world, ensuring the safety and security of homes and offices is more crucial
than ever. Traditional lock-and-key systems are increasingly being replaced by smart locks,
which offer better control, convenience, and integration with modern technology.

This project focuses on developing a Smart Lock System using Python and Internet of
Things (IoT). The system is designed to allow or deny access to a secured space based on user
authentication, which can be managed remotely using IoT technology.

The smart lock integrates:

 A microcontroller (such as Raspberry Pi or Arduino),


 Electronic lock mechanisms (like a solenoid lock or servo motor),
 Sensors and camera modules (for facial recognition or keypad input),
 And Python scripts to process user input, control hardware, and connect to cloud
services or mobile applications.

PROCEDURE:
Step 1: Open Google Colab

Step 2: Set Up Environment

Step 3: Import Required Libraries

Step 4: Write Your Smart Lock Logic

Step 5: Integrate with Firebase or IoT Platform


ALGORITHM:
 Start the program.

Load necessary libraries (cv2,numpy, GPIO or serial for hardware, Firebase, etc.).

 Initialize camera or input method (e.g., keypad, RFID, face recognition).

 Connect to any cloud service (optional).

 For PIN: Compare entered PIN with stored PIN in database.

 For Face: Use Open CV or a ML model to detect and recognize face.

 For RFID: Match scanned ID with authorized IDs.

If input matches stored credentials:

Grant access → Proceed to Step 5.

Else:

 Deny access → Display message or send alert.


 Optionally log the failed attempt.

Send command to unlock door using GPIO (e.g., activate a relay or servo).

 Keep the door unlocked for a fixed time (e.g., 5 seconds).


 Relock the door after time elapses.

Save access log (timestamp, user ID, success/failure) to cloud/database.

Send notification(e.g., via Firebase or email).

 Loop back to Step 2 for next user.


 Optionally include an exit condition to stop the system.
INPUT IMAGES UPLOADED:
PROGRAM CODE:
#include <Keypad.h>

#include <LiquidCrystal.h>

#include <Servo.h>

#define Password_Length 5

Servo myservo;

LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);

int pos = 0;

char Data[Password_Length];

char Master[Password_Length] = "1234";

byte data_count = 0, master_count = 0;

bool Pass_is_good;

bool door = false;

char customKey;

/*---preparing keypad---*/

const byte ROWS = 4;

const byte COLS = 4;

char keys[ROWS][COLS] = {

{'1', '2', '3', 'A'},

{'4', '5', '6', 'B'},

{'7', '8', '9', 'C'},

{'*', '0', '#', 'D'}};


byte rowPins[ROWS] = {0, 1, 2, 3};

byte colPins[COLS] = {4, 5, 6, 7};

Keypad customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);

/*--- Main Action ---*/

void setup()

myservo.attach(9, 2000, 2400);

ServoClose();

lcd.begin(16, 2);

lcd.print("Protected Door");

loading("Loading");

lcd.clear();

void loop()

if (door == true)

customKey = customKeypad.getKey();

if (customKey == '#')

lcd.clear();

ServoClose();

lcd.print("Door is closed"); delay(3000);


door = false;

else

Open();

void loading (char msg[]) {

lcd.setCursor(0, 1);

lcd.print(msg);

for (int i = 0; i < 9; i++) {

delay(1000);

lcd.print(".");

void clearData()

while (data_count != 0)

Data[data_count--] = 0;

return;

void ServoClose(){
for (pos = 90; pos >= 0; pos -= 10) {

myservo.write(pos);

void ServoOpen()

for (pos = 0; pos <= 90; pos += 10) {

myservo.write(pos);

void Open()

lcd.setCursor(0, 0);

lcd.print("Enter Password");

customKey = customKeypad.getKey();

if (customKey)

Data[data_count] = customKey;

lcd.setCursor(data_count, 1);

lcd.print(Data[data_count]);

data_count++;

if (data_count == Password_Length - 1) {
if (!strcmp(Data, Master))

lcd.clear();

ServoOpen();

lcd.print(" Door is Open ");

door = true;

delay(5000);

loading("Waiting");

lcd.clear();

lcd.print(" Time is up! ");

delay(1000);

ServoClose();

door = false;

else

lcd.clear();

lcd.print(" Wrong Password ");

door = false;

delay(1000);

lcd.clear();

clearData();}}
OUTPUT:
RESULT:
Thus the implementation of Smart Lock System was simulated successfully using python
code.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy