Coder Social home page Coder Social logo

smart-security-door's Introduction

Smart-security-door

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.

Requirements:

Hardware

  • Breadboard
  • Wires
  • RC522 RFID Sensor and RFID cards
  • Micro Servo
  • LEDs
  • Buzzer
  • Laptop/PC or Raspberry Pi

Software

  • MongoDB
  • Python with opencv, opencv-contrib-python, mediapipe, os, numpy, pymongo, serial, uvicorn
  • Node.js with Reactjs, axios, material-table
  • Android studio

What the project is using

  • 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

Installation:

The Software part

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]

The Hardware part

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.

How to start:

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

Important Note

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.