Facial Recognition Door Lock

A facial recognition door lock that can greet people at the door. In addition, this lock can be controlled by your own cellular device.

Engineer

Aashrav S

Area of Interest

Hardware/Software Engineering

School

Cupertino High School

Grade

Incoming Senior

Final Presentation

UPLOAD DIDN'T WORK DUE TO LIGHTING

Next Steps

  • Improve User Interface of app

  • Individual Accounts on app

  • Fix lighting issue on upload feature

  • Create own face recognition algorithm

  • Use a more secure database

Even though my time at Blue Stamp Engineering has come to an end I plan to continue to work on this project at home. Above lists steps I plan to take in order to take my project to the next level. My demo presentation went great and I was proud that I was able to showcase what I worked on for 6 weeks. Unfortunately the upload feature of my app didn’t work during the presentation due to lighting issues. Every time I had tested that feature I had done it during day time, so it worked seamlessly. This presentation taught me to test the aspects of my project thoroughly by changing various variables. I plan to fix this issue soon as listed above. Overall Blue Stamp Engineering taught me so much about circuits, coding, hardware, and about the engineering process. However I plan to continue to learn as this project is only the beginning.

Android Application

For the next portion of my project I worked on an Android application. The first step was getting the android app to control the door lock. In order to do this I used Firebase which is a online database. Every time somebody is to click the switch on the app the value of the lock changes and the Raspberry Pi continuously checks to see if the value has changed. If it has then the condition of the lock changes accordingly.  The second step to the app was getting the log feature of the application fully functional. The log kept track of every person that came the door by recording the date the came at the door, the time they came at the door, the name of the person(if they are in the collection), and the picture that was taken when they clicked the push button. To create the log feature of the app I used Firebase again. Essentially every time somebody clicked the red push button I updated the database on Firebase so that it records the time they came and the name of the person. In order to upload the picture I first thought I would be able to take the picture from Amazon Web Services(AWS) because I needed to upload it there in order to perform Amazon Rekognition(Face Recognition). However when I tried to take the picture from AWS it didn’t work. Confused as what to do I decided to upload the picture to Firebase also and then take it from Firebase. As expected it worked perfectly and I was able to view the pictures from the app. The last part of my app was getting the upload feature to work. The purpose of the upload feature was so that one would be able to add new people to the collection. In other words if I were to take a picture of you and upload it with your name, every time you click the red push button my program would be able to recognize you. To create this portion of the app I also used Firebase. Every time you upload a person from the app the application takes the picture and adds it to Firebase. Then my Raspberry Pi continuously checks if a new pic has been uploaded to Firebase. If it has then it takes the picture and adds to the collection in AWS.

Android App Video

DoorGuard App Demo

Android App Pictures

Face Recognition

For my second milestone I was able to recognize individual people, tell the owner who is outside through the speaker, and send an email to the owner with the name of the person and a picture attached. How it works is that once a photo is uploaded to the S3 bucket it triggers a lambda function which adds the image to a collection with the name that is associated with the picture. After uploading the picture my program is able to recognize that individual once a picture is taken. How this works is that the program takes that picture and then searches the collection for any matches. If there is a match then it returns the name of the person. Once a match is found I used aws polly to convert text to speech in order to inform the owner who is at their door. After the mp3 file is created it plays the file through the speaker that is connected. In the end it sends an email to the owner with the name of the person and the picture that was taken. Challenges I faced when creating this was trying to create the collection and figuring out how to search through the collection for face matches because I needed to look at multiple API’s and then integrate them into my code in order for it to function properly. In addition I had a lot of troubles trying to create a lambda function because it kept giving me an error when I was trying to configure it, but after looking on multiple sites I was finally able to find the solution. In order to make my program more efficient and accurate it adds a picture to the database every time a match is found.

Controlling The Lock

For my first milestone,  I was able to control my deadbolt lock by a servo. In order to accomplish this I first needed to come up with a design for how I would turn the lock. I wasn’t sure if I should turn the triangular piece from the side of the door, or if I should turn it by attaching a servo in the place of the triangular piece. After thinking about the pros and cons, I decided to remove the triangular piece and attached a servo in the place of it. After removing the triangular piece from the deadbolt I needed to make my custom servo horn so that it could attach to the metal rod. In order to make a custom servo horn I used one of the servo horns that came with the servo and made a bigger hole so that it was the correct size. Then in order to position the servo horn in the center, I needed to attach it to another servo horn. However, I wasn’t sure how I should attach both of the servo horns together. To solve this problem I decided to screw one side together using a screw and hot glue the other side because there wasn’t an appropriate hole on the other side to screw them together. After doing this I needed to attach the servo on one side of a metal plate and the servo horn on the servo on the other side. When I tested it I realized that the servo would move instead of the rod, because the servo wasn’t mounted to the metal plate. In order to mount the servo, I first thought I would be able to drill a couple holes and then screw it onto the plate. When I tried to use the drill to make a hole in the metal plate I saw that it was barely making a scratch on the plate even after a minute of drilling. It was then that I realized that the plate was made of steel which is extremely hard to drill through. In order to attach the servo, I needed to hot glue it to the metal plate. After hot gluing it, I needed to attach the servo to my Arduino. When I attached the wires to the allocated pins I needed to write some code in order to get the servo to run. After trying multiple values I decided that 120 degrees were perfect in order to lock and unlock the door.

Starter Project

LED lights controlled by motion

For my starter project, I created the Rainbow Light Show. For this project, I needed to solder many components such as multiple resistors, the capacitors, and 3 IR sensors. How this device works is that the IR sensor transmits an IR signal and if your hand is above the IR sensor then the signal is reflected back to the IR receiver. If your hand is closer to the IR sensor then more of the light is reflected back to the receiver. The receiver determines how much is reflected and accordingly it makes the light brighter or dimmer. Once I finished my project I realized that the IR sensor in the middle didn’t work. I first tried to reattach all the wires in order make sure that they all were secure. However, that wasn’t the problem. After doing that I resoldered most of the components so that it was neater and none of the soldered components were touching each other. This also wasn’t the problem. I then realized that with one of the IR sensors the receiver fell out of the holder and I needed to reattach it. What happened was that when I reattached the receiver I switched the negative and positive terminal. In order to fix this problem, I needed to desolder the IR sensor and switch the orientation. In the process of taking it out and reattaching it, the transmitter in that IR sensor unfortunately broke. In order to fix this problem, I would need to get another IR transmitter, but I didn’t have one. After making sure that the transmitter was broken I decided to keep my starter project the way it was. The right and left sides worked so for my starter project I am only able to display red and green.

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering