Our project's goal is to create an automated door lock which allows you to unlock it through face recognition. If the face recognition is successful the door lock will unlock otherwise it will remain locked. The project is all local based but it can be hosted to diferent machines if it's altered correctly.
- Breadboard
- Wires
- RC522 RFID Sensor and RFID cards
- Micro Servo
- LEDs
- Buzzer
- Laptop/PC or Raspberry Pi
- MongoDB
- Python with opencv, opencv-contrib-python, mediapipe, os, numpy, pymongo, serial, uvicorn
- Node.js with Reactjs, axios, material-table
- Android studio
- For the arduino code the device must have the Arduino IDE so the use can install the code to the arduino.
- For the face recognition part of the project, we will need python.
- The main libraries for the face recognition are OpenCV and Mediapipe.
- OpenCv will be used for the camera handling and the trainning of the algorithm.
- Mediapipe will be used for the better tracking of the face.
- It is necessary to have an arduino and
- The project has a backend part for handling the data.
- It uses a multithreading server where all the data are send. The server is made with python and is a TCP socket server.
- The server is saving the data to a MongoDB database.
- The project uses the fastapi python library for making the API part of the project.
- Also it uses uvicorn to create a WebClient.
- The frontend of the project uses NodeJS. Specifically React
- Also there is as simple android app the displays the data from the api WebClient
- To use the app the project needs Android Studio
For the arduino install the two libraries rfid master and Servo. Add the by going to Sketch > Include Library > Add .ZIP Library...
.
For the database install MongoDB and for extra help install MongoDB Compass.
For the face recognition and the api, install python on your device [Download]. After that, run the following command in to a terminal
python3 -m pip install -r requirements.txt
.
Then for the frontend part install NodeJS [Download] and un the following commands in to a terminal:
npm install
npm install axios bootstrap
more about axios here, more about bootstrap here
npm install material-table --save
npm install @material-ui/core --save
Lastly, download Android Studio [Download]
For the hardware part you will need the items in the list to create the following Tutorial on how to build it and how it works.
For the andruino you have to save the code using the Arduino IDE.
For the face recognition you will need to run the faces.py file and capture two faces. Then you have to run the Server.py and after the the face_recognition.py.
For the backend WebClient, run in the folder the file in in the following command:
uvicorn WebClient:app --reload
The WebClient must be running for the rest to work
For the frontend, run in the folder the file in in the following command:
npm start
For the app start the emulator in ardroid studio
The andruino code must have the id of the card the user is using:
content.toUpperCase();
if (content.substring(1) == "5A A1 A1 15") //change here the UID of the card/cards that you want to give access
{
If the id is not the same the moter will not "open" Check what port is the arduino using in 'Tools > Port' and change the `face_recognition.py` if it is not the same. Also check if your machine is allowing access to that port and if not give it access.