How Smart locks work

Faisal Mateen
5 min readFeb 23, 2020

A Smart lock enables the user to access their home with mobile phone. Most smart lock models are battery powered and have wireless connectivity.

Smart lock

The main benefit of a smart lock is convenience. A home owner does not need to worry about misplaced/lost keys. Another use-case is remote access. If you have forgotten to lock the door on your way out, you can do it remotely with your smart phone. Other benefits include granting guest access to house cleaners, dog-walkers during specific hours of the day.

According to IDC, smart locks were a significant proportion of the 800 million smart home devices shipped in 2019. Smart locks will continue to replace traditional door locks and shipments are expected to grow in coming years.

Smart locks are not without downsides. Your smart lock may run out of battery, your mobile may be discharged or power outage will knock wifi router down. In any case, you may be unable to access your home.

Wireless connectivity

A Smart lock system has three components - a wireless modem, a smart phone and a cloud connection.

Bluetooth low energy (BLE) smart locks are the most popular. The user mobile has to be in close range of smart lock to unlock the door. The range is determined by BLE radio maximum output power and link budget. Nordic nRF52840 has maximum output power of 8 dBm and link budget of 103 dBm (BLE 1 Mbps mode).

Bluetooth Smart lock uses a gateway i.e mobile phone to connect to the cloud. The lock receives software upgrades via mobile from the vendor servers.

Device-Gateway-Cloud Architecture

WiFi smart lock is controlled via a mobile app. The lock connects to cloud directly through a WiFi router. This enables remote locking/unlocking of door from any location with internet access.

Other Access Options

A Smart lock can have multiple access options -NFC, Bio-metric, Keypad and Voice Control

Xiaomi Mijia smart lock employs Nordic nRF52840, which has a on-chip NFC-A tag. This smart lock can be unlocked by NFC compatible phone. It can also be unlocked by entering a key code or through fingerprint.

An increasing number of Smart locks are compatible with Smart home systems such as Google home, Apple home kit etc. A user can unlock home through a voice command using Alexa. Alexa can be connected with a WiFi bridge to access BLE based smart lock from a voice command.

Under the hood

Smart lock typically requires 4 AA batteries or 6 Volts to operate. It has four main integrated circuits (IC) - Micro-controller, BLE SOC, Motor Driver IC, and Power Management IC.

The motor converts electrical energy into rotational kinetic energy. The drive shaft transmits this torque and moves the deadbolt. The motor driver and motor is used to turn between lock and unlock position without physical contact.

Discovery of Bluetooth Smart lock

A Bluetooth Smart lock is in connection-less mode most of time and is waiting to be discovered by mobile phone. Its BLE link layer is in advertising mode and is periodically broadcasting advertising data. Advertising payload can be adjusted to determine the time spent in each advertising channel (37, 38 and 39).

Bluetooth Low Energy- Advertising & Scanning

The mobile phone is in scanning mode and has two timing parameters -scan window and scan interval. The discovery process is complete when mobile phone successfully receives the smart lock advertising packet. Now the mobile phone can setup a connection with smart lock. After the connection is established the user can request the door to be unlocked.

Responsiveness of BLE smart locks

A smart home user wants a quick response time from lock. A developer can reduce the discovery time by using a shorter advertising interval on the lock. The developer can also adjust the scanning parameters on the mobile. The mobile must scan on all three channels, use continuous scanning and making the scan interval as large to receive at least one advertising packet.

A shorter advertising interval will lead to smaller discovery time but will drain the battery quicker. A developer can use the Nordic Online Power Profiler to make trade-offs between Tx output power, Advertising interval and battery life.

Pairing smart lock with mobile

Pairing enables the smart lock to form an encrypted connection with the user mobile phone. First the home owner will enable BLE connectivity on the mobile and start scanning the lock on the vendor app. After a BLE connection is established between mobile and smart lock, the smart lock is ready to be paired with the mobile.

LE Secure Connection Pairing

There are two methods of pairing in BLE — Legacy pairing and LE secure connection (LESC). LE legacy was introduced in Bluetooth core specification v4.0. LESC is an enhanced security feature and was introduced in Bluetooth core specification v4.2. In both methods, smart lock and user mobile go through multiple phases to setup an encrypted connection.

A smart lock may choose to implement its own custom security protocol and not BLE link layer security protocol. E.g. August lock setup a unique 128-bit AES key for each BLE communication session.

Conclusion

Nordic Semiconductor has a large portfolio of wireless connectivity IC including BLE IC. I would recommend visiting their website to select the right product for your application.

--

--