2FA physical locking system using RaspberryPi3 with RP Camera V2.1 and microphone.
Photos and voice recordings are taken from the device, stored, and verified using the Microsoft Cognitive Services APIs to do identity detection.
There are two main parts to this project:
- main.py
- Face Recognition
- Voice Recognition
- Hardware Setup
- RaspBerryPi 3 (RP2 will also work, keep in mind there is no built inwifi)
- Resistors = 220(Ohm)
- Pushbutton
- (2) Red LEDs, (2) Green LEDs
- RaspberryPi2 Camera V2.1
- Digital microphone (USB 7.1 channel audio + Microphone)
- Great blog here: Recording on Pi
- Useful commands:
alsamixer
- open up visual mixersudo alsactl store 1
- store settings into a variablearecord -l
- view all available recording devicesarecord
- for more help and optionsarecord –f S16 –r 16000 –D plughw:1 –d 5 ./voice_record.wav
- record with specific settingsaplay ./voice_record.wav
- play back audio on pi
- Enable the camera device
- sudo raspi-config
- Select ‘5 Enable Camera’
- Select ‘Yes’
- Select ‘Finish’ on main menu
- To take a picture.. (RaspberryPi Camera V2.1)
raspistill –o output.jpg –q 40
Python: As shown in diagram below
Node: Button is connected to GPIO pin 4 instead of GPIO pin 23 (what is shown in diagram)