About the project in general:
This solution detects the visitor’s face and sees if he/she is the house owner using Microsoft Project Oxford face recognition. If he/she is the owner it opens the door for him/her directly; otherwise the system sends a push notification to the owner’s mobile device and asks whether to allow the visitor in or not.
Used/Integrated services:
- Azure storage
- Microsoft Project Oxford: Face API
- ASP.Net SignalR send owner’s action to the Raspberry Pi
- WNS to send notification to the mobile device
Components:
· 1x Raspberry Pi 2 Model B
· 1x PIR sensor
· 1x Microsoft LifeCam 3000 HD
· 1x Servo motor FS5103R
· 1x Battery pack
· 1x Resistor 1kΩ
Schematics and circuit diagram:
Pin Assignments:
Motion detection, capture image and identify the visitor:
When the application is first run, an instance of PIRProximitySensor class is created with the property IsActive set to true by default.
This instance is responsible of the connection of the PIR sensor with the application. If IsActive is set to true, when a motion is detected by the sensor a MotionDetected event is fired indicating the GPIO pin number connected to the sensor who fired the event. When motion detected a capture picture command is sent to the camera to capture the visitors’ faces and send them to Project Oxford service to identify the visitors. If the visitor is the facility’s owner the system sends to the servo motor to open the door; otherwise a notification is sent to the owner’s mobile device with the picture taken of the visitors’ faces. If the owner chooses to open the door, the command is sent over SignalR in the backend service that pushes to the Raspberry Pi to open the door.
During the process of identifying the visitors and taking the required action the sensor is disabled using the property IsActive set to false; then after closing the door it’s set back to true to activate the identification system.
Open the door:
We are using servo motor to control the door when we send 2 milliseconds pulse to the motor, the motor will rotate 180 degree and the door will open and when we send 1 milliseconds to the motor, the motor will rotate back to 0 degree and the door will close again.
The position of the servo motor is set by the length of a pulse. The servo expects to receive a pulse at least every 20 milliseconds. If that pulse is high for 1 millisecond, the servo angle will be zero; if it is 1.5 milliseconds, it will be at its center position; and if it is 2 milliseconds, it will be at 180 degrees.
Project Oxford: Face API
Face API is a cloud-based API that provides the most advanced algorithms for face detection and recognition. The main functionality of Face API can be divided into two categories: face detection with attributes extraction and face recognition.
To learn more about Project Oxford visit: https://www.projectoxford.ai
How to deploy and work:
After connecting the circuit as shown in the figures above select ARM from solution platform for the HomeVisitsManager.VisitsController project. Select Remote Machine from the emulators list and enter your Raspberry Pi 2’s IP and credentials. Now run the solution; multiple projects will run simultaneously (the owner windows phone application, the backend and the IoT).
References:
Servo motor:
· http://razzpisampler.oreilly.com/ch05.html
Face detection and recognition:
· https://www.projectoxford.ai/doc/face/How-To/identifyperson
Comments