Inspiration

The inspiration for this project was to address the need to unlock a door without a key. Implementing a secure method for doing this requires the collection of biometric data like the face of approved users, and controlling the lock based on that data.

What it does

The locking system has 2 primary functionalities

  1. Unlock the door after viewing the face of an approved member and re-lock after 20 seconds
  2. Unlock the door after receiving an "unlock" text and re-lock after 20 seconds A camera is constantly scanning with DeepFace AI for users while the door is locked. Once a user is seen and recognized, a text is sent to the owner of the system and the door is unlocked for 20 seconds. Then, the door locks again automatically. Similarly, when the owner texts "unlock" with any capitalization to Twilio, the door is unlocked for 20 seconds and Twilio sends a confirmation text that the door was unlocked.

How we built it

FaceGuard was built by splitting into two teams, software and hardware.

  • Software was written by Jackson and Josh while continuously testing with the Arduino Grove kit and servo. The overall functionality of the software is to run DeepFace AI and search for approved users in the camera video feed continuously. When an approved user is detected (or if "unlock" is sent to Twilio), the python section of the code communicates via serial with the Arduino to rotate the servomotor and unlock the door. When a user unlocks the door, Twilio texts the owner of the system a picture of the person who unlocked the door and notifies that the door has been unlocked.
  • Hardware was developed by Joel and Casey by modeling the lock in Autodesk Fusion360 and designing the mechanism of action to lock and unlock. The original lock was first taken apart so that we could understand what we needed to do to make it unlock. We then cad modeled the original piece of the lock that we replaced with our 3d print. We modified this part by enlarging it and so the servo could fit underneath the main housing. The turning mechanism was also redesigned to allow a linkage between the servo and the turning mechanism of the lock so that it could be unlocked internally.

Challenges we ran into

  • Challenges for the software team were communication between the servo and python code written for interpreting the data from the AI. In addition, implementing both methods of unlocking the door at the same time without bugs proved to be extremely time consuming. Unfortunately, the DeepFace AI is not always accurate in recognizing correct faces, especially in overly bright or dark lighting, which caused another hurdle for choosing the level of confidence required to unlock the door.
  • Challenges for the hardware team were that the space constraints of the rotating mechanism of the servo within the housing required creativity for the linkages. Additionally, the time required to 3D print meant that only one design could be physically tested in time. This meant we really had only one shot to get it right. When things get this small when 3d printing the the parts become extremely fragile so assembling the parts becomes challenging. Also, making sure the parts can handle the load of the servo and someone turning the lock manually was a large concern given.

Accomplishments that we're proud of

We are proud that we were able to create a usable locking system at the end of 24 hours. Successfully using DeepFace AI to scan video feed and turn a servomotor required a lot of bug fixing and learning in the process. Communicating between python and Arduino code was a valuable learning experience.

What we learned

The pySerial library was used to communicate through serial with the Arduino code and the imgur-uploader library was used to upload the image of a user unlocking the door and send it to the owner of the system. These libraries were unknown to us at the start of the hackathon. We learned how to use DeepFace AI (after discovering it) and interface python and Arduino code. Additionally, we learned how to use Twilio to send and receive messages and media.

What's next for FaceGuard

FaceGuard needs some bug fixing and optimization before actual implementation as a security system. Upgrading to a better facial recognition AI would definitely improve confidence in this mechanism as a security system.

Share this project:

Updates