Learn, Implement and Share

OVERVIEW of Face Recognition based Door Lock using Raspberry Pi B+ OpenCV

Face recognition is an amazing field of computer vision with many possible applications to hardware and devices. Using embedded SOC platforms like the Raspberry Pi and open source computer vision libraries like OpenCV, you can now add face recognition to your own maker projects! In this project, I’ll show you how to build a face recognition based door lock which unlocks itself using face recognition running on a Raspberry Pi.

PCBWay Promotion

For this face recognition based door lock project, you need basic skills related to Linux, Raspberry Pi and electronics. If you are not confident with Raspberry Pi you can take any free tutorial from YouTube.

If you are looking for other IOT projects please check this link >>>>



Click on Each Product Below and You will be Taken to the Product Page that I trust and have used in my Project. I Highly Recommend You Buy Directly from the Link Below or Add to Cart.


My Door Lock is based on this below adafruit Tutorial by Toiy DiCola

Please follow his tutorial to learn how this is made. Below is a video of my project’s demonstration.


This implementation of facial recognition involves Principal component analysis (PCA) and Eigenfaces. The Principal Component Analysis (PCA) was independently proposed by Karl Pearson (1901) and Harold Hotelling (1933) to turn a set of possibly correlated variables into a smaller set of uncorrelated variables. The idea is, that a high-dimensional dataset is often described by correlated variables and therefore only a few meaningful dimensions account for most of the information. The PCA method finds the directions with the greatest variance in the data, called principal components.

Here is the documentation for Eigenface and its implementation >>>



Git  >> https://github.com/arnabdasbwn 

Follow me on Instagram >> https://www.instagram.com/arnabdasbwn/

Follow me on Twitter >> https://twitter.com/ArnabDasBwn

Subscribe to my YouTube Channel >> https://www.youtube.com/c/ArnabDasBwn

Credits: Adafruit, Tony DiCola

Crazy Engineer



Rajitha Akwaththa · September 4, 2018 at 5:02 pm

Can I get a full tutorial on this, please? All the codes and connections?

    Crazy Engineer · September 4, 2018 at 8:10 pm

    Hi, The Link for the full detailed tutorial is there on this page. Please follow that tutorial. Make sure to check for dependencies while doing this project.

      asad khan · March 9, 2020 at 10:06 pm

      sir where is the tutorial please help me i couldn’t find it please help me

Sannan Riaz · January 22, 2019 at 6:08 pm

when i execute
this line…it shows errors.(errors: Scanning dependencies of target pch_Generate_opencv_core
[ 13%] Generating precomp.hpp
[ 13%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
from /usr/include/c++/6/algorithm:62,
from /home/pi/opencv-2.4.9/modules/core/include/opencv2/core/core.hpp:56,
from /home/pi/opencv-2.4.9/modules/core/precomp.hpp:48:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
compilation terminated.
modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:62: recipe for target ‘modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch’ failed
make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch] Error 1
CMakeFiles/Makefile2:960: recipe for target ‘modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all’ failed
make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2
kindly help me out.

Zein Sahial · February 2, 2019 at 2:06 pm

Hello sir, can i add some more servo in the project sir?

    Crazy Engineer · February 10, 2019 at 2:30 pm

    To do any more task you have to edit the Python Code

Talat shah · February 9, 2019 at 8:56 am

Hi! need your help i did face recognition successfully using rpi i just want when my face recognized the system call me by my name how is it possible??

Rutwik Ajmera · March 6, 2019 at 1:03 am

Can u please upload video of step by step executing of wach programs and modules.??because all codes are running but we beginners cant find what to do next step.

Rushikesh Chandra Pippoji · March 11, 2019 at 10:49 am

I need a source code of this project sir.

    Crazy Engineer · March 13, 2019 at 12:02 am

    Hi, Tutorial Coming Soon. Subscribe to Email for Free Access.

Elton Rodrigues · March 14, 2019 at 6:22 pm

Is there a way to run the program directly via a push button rather than starting it from a terminal?

    Crazy Engineer · March 14, 2019 at 9:25 pm

    Yes, You can also do that. For this, You have to write a program that runs in the background waiting for Interrupt from GPIO. Once Interrupt is triggered it can be used to do any task. In your Case to start Face Recognition Application.

      Elton Rodrigues · March 20, 2019 at 7:58 pm

      Yes, so once the button/interrupt is triggered, what is the actual step for running the .py file?

Meher · April 8, 2019 at 10:48 am

Nice project sir!
Could you share the source code.
thanks in advance

    Crazy Engineer · April 16, 2019 at 8:03 pm

    Hi, The Code is Present in the Adafruit Link Attached Above.

Amartya · April 12, 2019 at 6:51 pm

sir, where is the code of this project means I am not getting the code from the link of the GitHub which u have mentioned above

    Crazy Engineer · April 16, 2019 at 7:55 pm

    Hi, The Code is Present in the Adafruit Link Attached Above.

Sabjan · April 26, 2019 at 11:35 am

I tried link in the description but the library files are outdated and it’s not working with raspberry Pi 3 b+.
It will be of great help if you can provide your code

Leave a Reply

Avatar placeholder

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.