Two factor access control uses two authentication factors - fingerprint (something that the user has) and a pin (something that the user knows from a mobile application) to control access to a secure facility or building. It is essentially a dual layer locking mechanism.
The first stage of the project is fingerprint detection and verification. We used an Adafruit fingerprint sensor connected to an Arduino. The fingerprint sensor was capable of storing multiple fingerprints. A user puts his/her finger on the fingerprint sensor. The sensor checks whether the fingerprint is in its database. If a match is found, the Arduino connects to WiFi and generates a 4 digit code which it pushes to Firebase (an online database) as well as the door. In our case we used a virtual door by setting up a website that is locked with a passcode.
The user then uses his/her Android phone and opens the application. Once the user logs in, the application queries Firebase and receives the four digit pin which it displays for 30 seconds. The user sees this pin and enters it into the door to successfully open it. If the user enters the wrong pin the door does not open. Similarly, using a fingerprint not enrolled beforehand does not push a value to firebase and hence the user cannot open the door.