Magnetic Door System
A IoT door lock mechanism
Author: PicΔ Sebastian
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-SebiP21
Descriptionβ
The Smart Magnetic Door Lock System is a security device that lets you open a door using a keypad and checks if the door was opened. If the correct password is entered on the keypad, a servo motor unlocks the door. A magnetic sensor on the door checks if it has actually been opened. When the door opens, an LED turns on and the system sends a message over Wi-Fi. The Raspberry Pi Pico W handles everything and stores the passwords on an SD card.
Motivationβ
The reason why I chose this project is because it combines several interesting and useful features: a password-protected door lock, door status detection, and Wi-Fi notifications. I believe that this project is a great way to learn how to use components like a keypad, servo motor, SD card, and magnetic sensor with a Raspberry Pi Pico W.
Architectureβ
This is the description of the system components and their interactions:
-
Keypad
- The keypad is the user input interface.
- Users input a numeric password which is read by the microcontroller.
-
Raspberry Pi Pico W
- Acts as the brain of the system.
- Reads the keypad input and compares it against a list of valid passwords stored on an SD card.
- If the password is correct, it sends a signal to open the servo motor.
- Monitors the magnetic sensor for door state changes.
- Sends a Wi-Fi message if the door is opened.
-
SD Card Module
- Stores one or more valid passwords in a text file.
- Connected to the Pico via SPI.
-
Servo Motor
- Mechanically unlocks the door when the correct password is entered.
-
Magnetic Sensor (Hall Effect)
- Detects whether the door is physically opened.
- Triggers the LED and Wi-Fi alert if the door is open.
-
LED
- Lights up when the door has been opened.
-
Wi-Fi Messaging
- The Pico W sends a message over Wi-Fi when the door is opened.
Logβ
Week 28 - 4 Mayβ
I have started the project following the steps to set-up the gitlab page and I have sketched the documentations
Week 5 - 11 Mayβ
I bought all the parts for the project and began to assemble it. I have also written the first lines of code for the sofware
Week 12 - 18 Mayβ
I finished assembeling the project with only minor things left to sort out
Week 19 - 25 Mayβ
Hardwareβ
The project uses the following components:
- Raspberry Pi Pico W β Central controller.
- 4x4 Keypad β User input interface for password entry.
- Servo Motor β Controls the door lock mechanism.
- Magnetic Sensor β Detects whether the door is open.
- LED (5 mm) β Visual indicator for door-open event.
- SD Card Module β Stores passwords in a file.
- USB β Powers the Pico and servo.
Schematicsβ
This is the Kicad Schematic:
Instead of a keypad schematic I have used connection pins to represent the rows and columns of the keypad in the KiCad representation of the project
Bill of Materialsβ
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | Main microcontroller | 35 RON |
4x4 Keypad | User password input | 6.99 RON |
MG996 Micro Servo | Controls door lock | 29.99 RON |
LED 5 mm | Lights up when door opens | 0.39 RON |
SD Card Module | Stores passwords | 4.39 RON |
MicroSD Card (8GB) | Stores password file | 15.99 RON |
Breadboard & Wires | For prototyping | 11.90 RON |
Softwareβ
Library | Description | Usage |
---|---|---|
embedded-sdmmc | SD card file system interface | Reads password data |
embedded-hal-servo | Servo control | Opens door on valid password |
embassy | Async embedded framework | Powers the systemβs concurrency |
panic-halt | Handles panic safely | Halts system on unrecoverable errors |
Linksβ
// Add a few links that inspired you and that you think you will use for your project