How to Train Your Door Lock
This article takes a look at how current- or next-generation technologies can provide the potential for innovative applications and the problems and solutions that may arise.
Have you ever thought that a door lock could do more than just lock and unlock a front door? Current- or next-generation technologies provide the potential for differentiating applications, but these technologies are bringing new challenges.
Using an electronic door lock as an example, in this article we will discuss how to add features and benefits to a lock to make it smart, while also being secure and working for a long time without changing the battery. Many environmental influences “attack” this kind of keypad and reduce its lifetime and reliability, including moisture, dirt, raindrops and ultraviolet rays from sunlight. In addition, cyber attacks on the Internet of Things devices are happening almost every day. Thus, a well-protected wireless communication and tamper-proof front panel and keypad are mandatory features.
Have you ever thought that your door lock could do more than just lock and unlock your front door? Current- or next-generation technologies provide the potential for innovative applications, but new challenges are arising that you’ll need to resolve. For example, handling the demand of exchanging data on small or simple nodes via a network (Internet of Things [IoT]) and integrating capacitive touch technologies.
First, let’s look at the type of features and benefits that equipping a front door with an electronic door lock can provide:
- Opening the door with a keypad could be very convenient if you are inadvertently locked outside.
- You can forego bringing your keys when going out for a run.
- You can give access to others, either temporarily or with time limits and restrictions.
- Your children can open the door when returning from school without having to be responsible for a key.
While electronic door locks should work reliably, they are susceptible to many environmental influences. Moisture, dirt, raindrops and ultraviolet rays from the sun can erode materials over time. In addition, as an IoT device, a lock is vulnerable to cyber attacks, making protected wireless communication and a tamper-proof front panel and keypad mandatory features. These are only some of the challenges.
Figure 1 shows the important components of a physical lock, including the keypad, wireless connection, display, and control.
Figure 1. Door lock block diagram.
Extending battery life is a critical objective when designing a door lock, which is predominantly in idle mode. The microcontroller (MCU) needs to have enough compute power to control the radio communication through Bluetooth® low energy or Wi-Fi®, as well as the other parts of the system. In the example block diagram in Figure 1, the Texas Instruments SimpleLink™ MSP432™ supervises the whole application. This MCU can alternate between various run and power-saving modes flexibly and efficiently, providing power-down modes in the sub-microamperes. The performance to-energy consumption ratio has enough computation bandwidth in active mode to manage all tasks, including:
- The control and acquisition of data from the keypad with TI’s CapTIvate™ touch technology (on the MSP430FR2633 MCU).
- Control of the relay or motor of the lock/unlock mechanism.
- Sensing upon lock manipulation with input/outputs (I/Os).
- Integration into a burglar alarm system.
- The ability to open the door remotely through an internet connection to the home network.
- The ability to share status information with remote devices connected through Bluetooth low energy (BLE) or Wi-Fi.
The integrated analog-to-digital converter (ADC) on the MSP432 MCU has up to 16 bits of resolution, offering a pathway to add premium features such as:
- Environmental sensor measurements (humidity, temperature, air pressure).
- Motor control and jamming protection.
- Motion detection and daylight sensing to control lights at the front door.
Devices like smart door locks could become a target for a cyber attack or manipulation. The implemented security features of the MCU need to provide secure communication, encrypting transmitted data by using a secure encryption standard (e.g. AES256) encryption and protecting stored data with the microprocessor unit (MPU) and intellectual property (IP) protection. This means that the MCU should provide a very high level of security to:
- Securely store data like encryption and authentication keys for a keypad or network access.
- Enable users to add or remove keys or restrict access rights by time.
- Conduct secure wireless over-the-air firmware updates.
It is essential to keep the encryption and authentication keys secure, not only when the devices get attacked via the wireless communication channel, but also when the application gets physically tampered with, the encryption keys need to be always stored securely inside the MCU.
It is possible to design a capacitive touch technology-based keypad so that it’s both stylish and well-isolated against environmental influences. It is also very easy to avoid issues, like a mechanical malfunction of the buttons on the keypad, and to protect the keypad from dirt and water. A flat panel without any gaps or mechanical moving parts can be encapsulated with much less effort and is only required at the fixed borders of the panel.
Maintaining performance in the presence of water drops or heavy moisture on the panel requires a technology sensitive enough to detect the differences between water and human fingers; otherwise, the panel may misinterpret actual key presses or ignore them completely. The CapTIvate touch module implemented in the MSP430FR2633 provides a sensing system that can detect such situations and react and filter for them.
Adjusting a capacitive sensor to various application-dependent parameters like panel size, panel material, casing, printed circuit board (PCB) structure, material, and thickness could become very complicated. To simplify this process, a software abstraction layer (API) gives users access to all important sensor data but also allows for trimming, adapting the sensor to changing requirements and reading sensors or element data. You can often benefit from a higher-level graphical user interface (GUI) that can help you design, configure and continually tweak different sensor parameters during the design cycle. Figure 2 shows an example of a GUI that can help simplify both the capacitive touch design and tuning processes.
Figure 2. GUI for tuning capacitive touch detection.
Door lock keypads should be able to operate with touch detection in the presence of steam, mist or spray (such as fog or raindrops). When designing a moisture-tolerant application, we recommend:
- Providing as much spacing as possible between buttons.
- Providing significant spacing between buttons and nearby ground planes.
- Routing all electrode connection traces on the PCB layer furthest from the surface.
- Setting sensor idle states to high-Z (floating) so that nearby sensors don't provide coupling points that can cause false detections.
- If possible, using a nonconductive enclosure for the product.
Some capacitive touch implementations also allow touch-on-metal detection to make an even more robust or tamper-proof solution.
To set up a wireless communication channel with its many parameters and functions, you should use a well-designed configuration tool and software development kit (SDK) – especially when data security on the communication channel, flexibility in the protocol and standard, and scalability of the application are important. All required functions need to be available and easy to use. SDKs support faster development of your application and also can help alleviate problems arising later, especially in the security area, as test cases and good coverage for that are harder to establish.
E-lock manufacturers often need to tweak their products, swap out different feature sets or change wireless protocols to serve different regions or markets (such as residential, commercial or hotel, and industrial). An extendable functional software framework enables them to scale quickly. Figure 3 shows the firmware layers of an abstracted functional software framework that provides multiple APIs, driver libraries, cross-platform plug-ins, and Portable Operating System Interface (POSIX) and real-time operating system (RTOS) support.
A software framework additionally offers a single development environment that delivers flexible hardware, software and tool options to allow you to develop wired and wireless applications. With such a structure, you can maintain 100 percent code reuse across host MCUs and multiple communication standards, enabling an easy configuration for your application and the ability to spend more time for testing.
SDK plug-ins also provide an easy way to add Bluetooth low energy connectivity to a new or existing application. For example, using a host MCU and adding Bluetooth low energy through a network processor provides extended functionality and unparalleled system design flexibility, which are critical in industrial applications. SDK plug-ins could drastically reduce both development time and potential errors during the implementation of the communication protocol.
Figure 3. Components and layers of an SDK.
The increasing complexity of wireless connections and capacitive touch functions represent challenges for developers, especially when it is important to reach the maximum performance with the highest reliability and security. As we’ve shown, you need to consider and resolve many pitfalls and hurdles. Using MCU peripherals with a focus on the end application and a tool set with easy-to-use SDKs can reduce this burden and enable a speedy time to market.
Co-authors of this article: Dung Dang and David Lara
- Texas Instruments Access Control Panel with Bluetooth low energy, Capacitive Touch, and Software Integration Reference Design.
- Texas Instruments SimpleLink MSP432 SDK.
- Texas Instruments SimpleLink MSP432 SDK Bluetooth low energy plug-in.
- Texas Instruments CapTIvate Technology Guide.
- Texas Instruments CapTIvate Design Center.
Industry Articles are a form of content that allows industry partners to share useful news, messages, and technology with All About Circuits readers in a way editorial content is not well suited to. All Industry Articles are subject to strict editorial guidelines with the intention of offering readers useful news, technical expertise, or stories. The viewpoints and opinions expressed in Industry Articles are those of the partner and not necessarily those of All About Circuits or its writers.