AuraLock automatic door opener

By David Crookes. Posted

Many of us use our face to unlock mobile phones and tablets, but imagine ditching your keys and doing the same to enter your home. It’s that idea which underpins a project by Dillon McCardell and Erin Stanfill: a door locking system using facial recognition that uses off-the-shelf components.

Called AuraLock, it’s primarily based around a Raspberry Pi 4 computer, a camera, door sensor, and Android mobile device. “Currently there are consumer facial recognition door locks, but they run on batteries and require push-button feedback to enable the facial recognition component,” Dillon says. “This defeated the purpose of a hands-free unlocking feature.”

Although enterprise-level facial recognition security systems can connect to automatic sliding doors, they are very expensive, so Dillon and Erin looked to create a go-between. “We wanted something to theoretically cost the same as current consumer facial recognition door locking devices,” Dillon says. “It would be connected to your home’s power and contain a motorised deadbolt, allowing the system to be powered 24/7 and completely hands-free.” This, however, was not without its challenges.

Slide away

As well as needing to constantly search for a known face, the hardware module had to be mounted within the frame of the door. The deadbolt needed to be motorised so it could retract into the frame to unlock, and there needed to be a way of quickly and easily exiting a home without electronics getting in the way.

“I implemented a simple sliding mechanism to replace the knob on a standard door – it was able to remove the deadbolt with a single motion,” Dillon says. “Other hardware features included the ability to unlock the door with facial recognition and an LED indicator on the exterior of the home to receive feedback. But other features, regarding usability and convenience, were primarily achieved in the Android mobile app.”

These included remote unlock and the ability to add recognised faces. “We felt these two features would give the user a true smart home feel,” Erin explains. “People would be allowed to enter the home even if the owner wasn’t there, and adding faces gives the user the ability to adapt the door as needed. Yet, having never built an app before, the whole plan was a little intimidating.”

Professional feel

The pair also faced problems when implementing OpenCV to recognise faces. “The library is vast and difficult to install easily,” Dillon says. “Once OpenCV was installed, I realised it was not designed to accept new face encodings dynamically – all registered images were generally hard-coded on bootup.”

To overcome this, Dillon implemented a dynamically updating dictionary, and he refreshed the OpenCV code to reflect the changes. The pair also used a Google Firebase database that allowed for communication between Raspberry Pi and the Android app. “Having to communicate with other devices through Firebase added a level of difficulty that wasn’t anticipated at first,” Erin says.

This was achieved by updating and reading database variables – they’d be updated when a new user unlocked the door, for example, and the mobile app would notice the change and show an image of the user who had activated the lock. “By implementing this method, we were able to transfer both variable values and images from Raspberry Pi to the mobile app and back again through Firebase,” Dillon explains.

With Erin’s custom GUI containing an array of buttons and functions, AuraLock certainly ended up looking and feeling professional. “We feel that all features included in the app are key to a positive user experience,” she says. And it definitely put a smile on our faces.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.