Face Recognition Door Lock With Smartphone Notifications
by Next Builder DIY in Circuits > Gadgets
519 Views, 13 Favorites, 0 Comments
Face Recognition Door Lock With Smartphone Notifications

Have you ever wished your home security system felt as futuristic and intelligent as JARVIS from Iron Man? With my latest creation, that wish gets a step closer to reality. I’ve designed and built a Face Recognition Door Lock with Smartphone Notifications, combining sleek aesthetics with cutting-edge AI technology.
The modern design inspired by the Iron Man arc reactor, giving it that unmistakable high-tech, premium look. At the heart of the system is the DFRobot HuskyLens AI Machine Vision Sensor, an incredibly capable and beginner-friendly module that handles facial recognition with impressive speed and accuracy.
Security is at the core of this build — the door only unlocks when an authorized face comes within view of the HuskyLens camera. As soon as it detects and verifies a face from the stored authorized profiles, the door unlocks instantly and a Telegram bot sends a notification straight to your smartphone. Multiple authorized faces can be stored, and each time one of them is recognized, you’ll get an alert. If the face isn’t authorized, the lock stays firmly shut and silent, making sure only trusted individuals can get inside.
The process is seamless — the HuskyLens constantly scans for faces, verifies them against its database, and either grants access with a notification or denies entry without a sound. With the latest DFRobot Beetle ESP32-C6 microcontroller as the brain of the system, everything runs smoothly, from managing the HuskyLens to handling secure Telegram communication.
The result is a responsive, reliable, and stylish door access system that feels like it belongs in Tony Stark’s lab. This project is celebrating my love for the Marvel universe while merging fandom-inspired design with real-world security and functionality. I’ve always wanted my own J.A.R.V.I.S., and now, every time I walk up to my door, I feel like Tony Stark arriving at his workshop.
Supplies








Components
- DFRobot Huskeylens
- DC Female Socket
- 10k ohm Resistor
- DFRobot Beetle ESP32-C6
- MP1584 Buck Converter
- 12v Solenoid Door Lock
Tools
- Soldering Iron
- Soldering Wire
- T-7000 Glue
CAD & 3D Printing






To start this project, I Started designing the CAD using Fusion 360. It’s a simple and compact design that’s easy to print and assemble. If you’d like to view or edit the model, you can open it directly in your browser using the Fusion 360 web viewer. Feel free to customize it however you like.
For 3D Printing, You can directly download the required STL files below:
- Main Panel.stl
- Back.stl
For 3D printing, I used JLC3DP, a professional 3D printing service known for its high precision, affordable prices, and wide range of material options. They support advanced printing technologies like SLA, SLS, MJF, and FDM, delivering smooth, durable parts that are perfect for both prototypes and final builds.
One of the best things about JLC3DP is their fast turnaround time and reliable global shipping, making it super convenient for hobbyists, students, and professionals alike. Whether you're just starting out or working on a serious engineering project, JLC3DP is a great choice
👉 Use the link to get an exclusive $70 discount on your first order from JLC3DP!
Face Registration



Registering your face on the HuskyLens is very easy. Switch the HuskyLens to Face Recognition mode, then Point the + symbol at a face, short press the learning button to learn the face. If the same face is detected by HuskyLens, a blue frame with words Face: ID1 will be displayed on the screen, which indicates that HuskyLens has learned the face and can recognize it now. You can repeat the process to add multiple faces, each with its own unique ID.
Huskeylens Assembly





Start by placing the HuskyLens into its dedicated slot inside the enclosure. Make sure it is aligned correctly with the front opening for a clear view. Once positioned, secure it firmly using the two provided screws.
After securing the module, connect the included 4-pin JST connector to the HuskyLens. This connector makes the wiring neat and simple, ensuring a stable and reliable connection.
DC Jack Assembly



Insert the DC female jack into the dedicated slot in the enclosure. Ensure it is properly aligned so that connecting the male jack from outside for power input will be smooth and convenient. To secure it firmly in place, apply small amount of T-7000 glue (or any strong adhesive of your choice).
Microcontroller Assembly



Place the microcontroller inside the enclosure at the cutout for the Type-C port. Align it properly so the Type-C connector is accessible from outside for easy programming. Apply a small amount of T-7000 glue to fix it in place. Don’t use too much glue—just enough to hold it securely.
MP1584 Setup & Assembly

There isn’t a dedicated slot for the MP1584 buck converter, so you can place it in any free space inside the enclosure. Before fixing it with T7000 glue, first set it up for a stable 5V output. To do this, connect two wires to the input and provide 12V. Then, measure the output voltage and carefully rotate the potentiometer on the buck converter until it reads exactly 5V. Once it is set, secure the module inside the enclosure.
Warning: Be gentle while adjusting the potentiometer. Rotating it too much can cause sudden voltage spikes, which may damage your circuit.
Mosfet Assembly



Since the enclosure is designed with a thick wall for a more professional look, the MOSFET module could not be placed directly inside. To solve this, I removed the MOSFET from the module first.
There isn’t a dedicated slot for the MOSFET, so you can place it in any free space inside the enclosure. Once positioned, secure it firmly using T-7000 glue. Make sure the MOSFET is fixed properly and has enough space for air circulation, as it can heat up during use.
Solenoid Lock



Pass both wires of the solenoid lock through the two small holes provided in the enclosure. These holes are made specifically to allow the wires to pass through easily for proper connection. Ensure the wires are passed gently without pulling too hard to avoid damage.
Connection




You can follow the circuit diagram above to make all the connections. However, for clarity, I’ve also explained each connection step by step below.
HuskyLens AI Camera
- VCC → 5V pin of ESP32
- GND → GND of ESP32
- TX → RX of ESP32
- RX → TX of ESP32
DFRobot Beetle ESP32-C6
- VIN → 5V output from MP1584 buck converter
- GND → Common GND (shared with HuskyLens, MOSFET, and power supply)
- TX/RX → Connected to HuskyLens
- GPIO pin → Gate of MOSFET (through resistor)
MOSFET (for Solenoid Control)
- Gate → ESP32 GPIO pin
- Source → GND
- Drain → Negative wire of Solenoid Lock
Resistor connected with Gate & Drain Pin
Solenoid Lock
- Positive wire → 12V supply
- Negative wire → MOSFET Drain
Power Supply (12V input via DC Jack)
- Positive → Solenoid Lock positive wire + input of MP1584 buck converter
- Negative → Common GND to MP1584 Buck Converter.
MP1584 Buck Converter
- Input + → 12V supply positive
- Input – → 12V supply negative (GND)
- Output + → ESP32 VIN (5V)
- Output – → ESP32 GND
Final Assembly



Once all the components are in place, align the cover with the bottom enclosure and ensure the camera opening is clear. Match the orientation properly, then secure the cover using two screws. Do not overtighten the screws, as this may damage the enclosure or misalign the cover.
Telegram Chat Bot




Creating a chatbot on Telegram is quick and easy. Open Telegram and search for @BotFather, then start a chat. Type /newbot and follow the prompts.
- Bot name: Enter any name you like for your project.
- Username: Choose a unique username for your bot. It must end in bot Like this, (for example: TetrisBot or tetris_bot)
Once completed, BotFather will send you a congratulations message along with your Bot Token ID. Make sure to keep your token secure and store it safely, it can be used by anyone to control your bot, as well as it will be required later to connect your hardware with the bot.
Chat ID



After creating your chatbot, open your internet browser and go to;)
Replace <YOUR_BOT_TOKEN> with the token you got from BotFather. At first, you might see some basic data with true or false values. Now, go back to your chatbot in Telegram and send it any message, such as hi. Then return to your browser and refresh the page. If everything is correct, you will see some data along with your Chat ID, which will be used later in the code.
Arduino IDE Setup



Install Arduino IDE
If you do not already have it, download and install Arduino IDE 2.0 latest Version from official website of Arduino.
Add the ESP32-C6 Board Support URL
- Open Arduino IDE.
- Go to File > Preferences.
- In the Additional Board Manager URLs field, paste the following URL:
- Click OK to save your changes.
Install the latest version of ESP32 Board.
- Go to Tools > Board > Boards Manager.
- In the search bar, type ESP32.
- Click & Install the latest version of ESP32
Verify Board Installation
- Once installed, DFRobot Bettle ESP32-C6 should now appear under Tools > Board.
- Select DFRobot Bettle ESP32-C6 from the list to start programming the device.
Code Uploading
Library Installation
Before uploading the code to the microcontroller, it’s important to ensure that all the required libraries are installed in the Arduino IDE. To install, open the Arduino IDE, go to the Library Manager (Sketch → Include Library → Manage Libraries) then search for the following libraries and click Install:
- Huskeylens
If you do not find the HuskeyLens library in the Library Manager, you can manually install it from GitHub. Open the HuskeyLens Library GitHub page, then click on the green Code button and select Download ZIP. Once the ZIP file is downloaded, extract it on your computer. After extracting, go back to the Arduino IDE and click on Sketch > Include Library > Add .ZIP Library. Navigate to the folder where you extracted the library and select it. The HuskeyLens library will then be successfully added to your Arduino IDE.
Set-up In Code
Before uploading the code, make sure to update it with your own Wi-Fi credentials in these lines:
Replace "YOUR_WIFI_SSID" with the name of your Wi-Fi network, and "YOUR_WIFI_PASSWORD" with your actual Wi-Fi password. Be sure to keep the quotation marks around your credentials.
Next, enter your Telegram bot credentials in these lines:
Replace "YOUR_BOT_TOKEN" with your own bot token which one you got during creating a bot, and "YOUR_CHAT_ID" with your own chat ID which one you got from internet browser.
Uploading Code
Once everything done, you’re ready to upload the code. Connect the Beetle ESP32-C6 to your computer using a USB-C cable, select the correct board and port from the Tools menu, and hit the Upload button.
Testing
Now it’s time to bring the project to life. Provide a 12V supply to the DC jack — you can simply use a 12V adapter for this. Once the power is supplied, wait for about 5 to 10 seconds, as the microcontroller needs a short time to connect with WiFi.
After it connected successfully, I pointed the camera toward my face — and you won’t believe how well it worked! The HuskyLens instantly recognized me, and the door unlocked almost immediately. The responsiveness was even faster than I expected — it felt like a real professional smart lock system.
On top of that, I also received a notification on my Telegram via the bot I created, confirming the unlock event. This made the whole experience more exciting and reliable, as I could monitor the activity in real-time.
Conclusion
Building this project was more than just a technical challenge—it was a way of bringing my curiosity and fascination with Marvel Studios’ Iron Man into real life. I’ve always admired the idea of J.A.R.V.I.S. controlling Tony Stark’s smart home, and through this build, I got to experience a small piece of that world. What started as a fandom-inspired experiment turned into something surprisingly practical. The face recognition door lock is not only fun and futuristic, but also highly responsive, reliable, and secure—making it a genuinely useful device for daily life. This blend of creativity, inspiration, and utility is exactly why I love making, and I’m excited to keep exploring projects that connect imagination with real-world applications.
Happy Making 🤞🏻