IntelliDoor

IOT Workshop

Spring 2017


Alon Fine, Eran Toldano, Mor Cohen, Tom Lapid

What is IntelliDoor?

IntelliDoor is a smart doorbell that lets the residents control the entrance to their building from anywhere in the world using their smartphones. The system uses face recognition technology to identify the visitor, sends the resident a text message with the visitor's information or image, and allows him to open the door from afar with a simple click on a link in the text message. To further increase the security of the residents, the system lets an administrator keep track of all the visitors who entered or tried to enter the building.

General Flow

  • Using the user interface, the administrator adds the residents' details and pictures to the system's database, in order to automatically open the door for them.
  • Using the user interface, each resident can add details and pictures of their guests to the system's database, in order to receive a more informative alert when these guests arrive.
  • When a person wants to enter the building he first enters the number of the apartment he resides in or wishes to visit on the keypad. The system then takes his picture using its camera and checks if it recognizes his face.
    • If it's a resident, the system will recognize him and open the door.
    • If it's a registered guest, the system will recognize him and send the relevant resident a text message with the guest's name, letting the resident know that this guest is at the door.
    • If it's an unregistered visitor, the system will not recognize him and will send the apartment's default resident a text message with the visitor's picture, alerting that an unknown visitor is at the door.
    • In both of the last cases the resident can choose to open the door by clicking on a link in the text message, or to keep the door locked by simply ignoring the message.
    • All attempts of non-residents to enter the building (whether the door was opened or not) are logged in the database and only the administrator can view them.

General Architecture

The system is comprised of three main components:

  • A program that runs on a Raspberry Pi computer that is attached to the door and controls its locking mechanism (in this project the door will be represented by a LED light bulb).
  • Microsoft's Azure cloud services for implementation of the system's server-side.
  • A website that serves as the user interface for updating the system's data and settings.

The following sections will elaborate on each component.

Raspberry Pi and Hardware

The Raspberry Pi is in charge of the communication with the other physical devices: the keypad, the LED light bulb and the webcam. The LED is connected to the RP through its GPIO pins, the keypad is connected through the I2C pins, and the webcam is connected with USB.

In addition to these devices, the RP communicates with the cloud through the IOT Hub service or with HTTP requests.

The C# program on the RP does the following:

It samples the keypad every 100ms and stores the pressed keys. When the "ring" key is pressed, the apartment number is processed, the webcam takes a picture of the visitor, and the picture is uploaded to Imgur website. After receiving the picture's Imgur URL, the program sends the cloud an HTTP request with the building's ID, the apartment number that was entered, and the image's URL. This HTTP request triggers the activation of a Logic App in the cloud, as described later on.

After sending the request, the program waits 45 seconds to receive a message from the IOT Hub, and upon receiving this message opens the door (turns on the LED). If a message is not received, the door remains closed (the LED stays off) and the program reverts to listening to the keypad.

The Raspberry Pi connected to the keypad, LED, and webcam

Server Side (Azure Cloud)

The cloud services that the system uses are:

  • Logic Apps and Functions - for executing the flow.
  • Face API - for face recognition.
  • Twilio API - for sending text messages
  • IOT Hub - for communicating with the Raspberry Pi.
  • Web Service - for hosting the user interface.
  • SQL Database and Server.

When the Raspberry Pi sends the the HTTP request with a building ID, apartment number and the visitor's image URL, a Logic App that does the following is triggered:

  • Calls Face API to identify the visitor.
  • Calls the SQL Server to check if the identified person is a guest or a resident. If it's a guest, the phone number of the resident attached to this guest is retrieved.
  • If the visitor is a guest or was not identified, sends a text message to the resident using Twilio's service (with the name of the guest or his image if he was not identified). In addition, adds a row to the "entry attempts" log in the database.
  • If it's a resident, sends a message to the Raspberry Pi through the IOT Hub, signaling the RP to open the door.
  • If the visitor was identified (resident or registered guest), adds his picture to Face API's database and trains it on the new picture, in order to improve the identification reliability.

When a resident clicks the link in the text message he received, another Logic App is triggered and it does the following:

  • Checks that the clicked URL was generated in the last 45 seconds and that it was not already clicked before. This is for security reasons and is achieved by generating the URL with a unique key that is saved in the database.
  • If the key is valid, sends a message to the Raspberry Pi through the IOT Hub, signaling the RP to open the door.

A third Logic App is in charge of the website's server side.

User Interface (Website)

The user interface is built with Node.js and express and runs an Azure's web service. The client side uses libraries such as bootstrap and jQuery and the server side is implemented with an SQL Server and a Logic App as mentioned above.

The system lets two types of users use the interface - Admin and Resident:

  • Admin: every building has an administrator who has permissions to add or remove apartments in the system's database, and for each apartment to add or remove residents. In addition, the admin has permissions to look at the entrance logs. The admin also defines the "default resident" for each apartment - the resident that will receive the text message when an unknown visitor arrives.
  • Resident: every resident has permissions to add or remove guests that will be registered under his name, meaning he will receive the text message when they arrive.

Whenever a person is added to the system (whether resident or guest), a few pictures of him must be provided in order to allow his identification when he arrives. The interface lets the users add pictures even after they were added to the system, in case they want to improve the identification.

Diagram

The following diagram displays in more detail the architecture of the system and how the different components interact with each other.