Skip to content

Roh1tHooda/Smart-Door-Locking-System

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Smart-Door-Locking-System

This is an Arduino program that implements an OTP (One Time Password) based door locking system using an IR sensor, a keypad, and a SIM800L GSM module.

When the IR sensor detects motion in front of the door, the program generates a random 4-digit OTP and sends it as an SMS to a predefined phone number using the SIM800L module. The program then displays a message on an OLED display to indicate that the OTP has been sent. The user must enter the correct OTP using a 4x4 keypad to unlock the door. If the entered OTP matches the OTP generated by the program, the door is unlocked by activating a relay for a short time. If the entered OTP does not match, the program displays a message on the OLED display to indicate that access has been denied.

The program uses the SoftwareSerial library to communicate with the SIM800L module, the Wire library to communicate with the OLED display, and the Keypad library to read input from the keypad. The program also uses the Adafruit_GFX and Adafruit_SSD1306 libraries to display text on the OLED display.

The pins used in the program are defined at the beginning of the code. Pin 4 is used for the relay, pin 5 is used for the buzzer, pins 9 to 13 are used for the keypad, pin A0 is used for the IR sensor, and pins 2 and 3 are used for communication with the SIM800L module.

The program starts by initializing the serial communication with the SIM800L module and sending an "AT" command to check if the module is responding. It then waits for the IR sensor to detect motion and generates a random OTP. After sending the OTP as an SMS to the predefined phone number, the program waits for the user to enter the OTP using the keypad. If the entered OTP matches the generated OTP, the program activates the relay to unlock the door for a short time. If the entered OTP does not match, the program displays a message to indicate that access has been denied.

The OLED display is used to display messages throughout the program to indicate the current status of the system. The display is cleared at the beginning of each loop iteration and new text is printed to the display as needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%