SLYA057 March   2022 DRV5021 , DRV5032 , DRV5033 , TMAG5123 , TMAG5124 , TMAG5170 , TMAG5231 , TMAG5273 , TMAG5328

 

  1. 1Application Brief

Application Brief

Position Sensing in Electronic Smart Locks

The internet of things has given rise to many smart home appliances that improve accessibility and security such as connected thermostats and smart locks. Some electronic smart locks include sensors to detect the position of the bolt or to prevent tampering with the lock housing. Having a sensor to determine the end of travel for the bolt can be useful in reducing strain on the motor or detecting when the lock is moved by other means such as a key. Including sensors in smart locks can also provide additional system information such as the direction of travel for the bolt, which can determine if the lock is installed on the left or right side of the door. From simply determining the end of travel of the bolt to more advanced functionalities that require in-between position information, sensors can provide the necessary level of detail in detecting the position of the bolt depending on the application requirements.

Another use for sensors in smart locks is tamper detection. This functionality is useful for preventing someone from gaining access to the internals of the smart lock and hacking their way through the door. Tamper detection can be implemented to prevent external magnetic fields from impacting the performance of other Hall-effect sensors in the device or to just determine if the case is being opened after it is installed.

The last application for sensors discussed in this paper is open and close detection for the door itself. This use case is something that can be included in smart locks or as a separate module in home security systems that can be useful in making sure a door is completely closed before a smart lock tries to move the bolt. If the bolt is moved before the door is completely closed, it can put stress on the motor or leave the bolt in an non-ideal state, such as only partially locked, which puts the system at risk.

Figure 1-1 Smart Lock Position Sensing Block Diagram

Figure 1-1 shows one implementation for using positions sensors in electronic smart locks. In this diagram, the position sensor is monitoring the change from the gearbox instead of the motion of the deadbolt itself. Additionally, a sensor is being used to provide tamper detection information to the main controller.

Different Types of Hall-Effect Sensors

TI offers three different types of Hall-effect sensors: linear, latch, and switch sensors. Linear sensors can detect a varying magnetic field and report the strength, which is useful for applications like slide by displacement, angle calculation, and proximity sensing. Linear sensors can be sensitive to fields in different directions depending on how the device is oriented or how many dimensions it is sensitive to. Devices that are built for two-dimensional (2D) or three-dimensional (3D) sensing can be used to perform angular measurements to determine the rotational direction of a magnet. Since only two dimensions are needed to implement rotational sensing, a 3D device can utilize two of the axis to determining angular data while the third axis can be used to implement tamper detection.

GUID-20200917-CA0I-8JJV-THVV-KNPNKRHXDDVC-low.gifFigure 1-2 Slide-By Magnet Example
GUID-20201118-CA0I-PSGC-L9RC-NFKVMNRHQLSZ-low.gifFigure 1-3 Rotational Magnet Example

Latch and switch devices can provide a digital output for when the magnetic field strength crosses a threshold. This is useful for applications like event counting, contactless switches, and tamper detection.

GUID-3D715C63-84F8-43DF-8EEB-8C9CE3182F8A-low.gifFigure 1-4 Omnipolar Hall-Effect Switch Functionality
Figure 1-5 Hall-Effect Latch Functionality

Hall-Effect Sensor Benefits

Hall-effect sensors are not the only option for implementing a magnetic switch. Reed switches are another common component in applications that require simple on and off or open and close proximity detection. However, one of the main disadvantages of using Reed switches is its limited lifetime due to the mechanical nature of the device. Hall-effect sensors do not have mechanical contacts like Reed switches and provide a more robust solution that is not impacted by mechanical wear and tear. More information about Hall-effect sensors replacing Reed switches is found in the Reed Switch Replacement with TI's Hall-Effect and Linear 3D Hall-Effect Sensors application note.

Using Linear Hall-Effect Sensors in Smart Locks

Two common implementations of linear Hall-effect sensors in smart locks are tracking the motion of the bolt and tracking the rotation of the key or motor. Tracking the position of the bolt can be accomplished by using a single axis (1D) linear Hall-effect sensor to create a slide by displacement. For more information on the slide by implementation, see the Tracking Slide-By Displacement with Linear Hall-Effect Sensors application brief.

Figure 1-6 Magnetic Field for Linear Slide-By Magnet

Tracking the rotation of the key or motor can be accomplished by using a simple cylindrical magnet that rotates along with the motor and a linear Hall-effect sensor. As the magnet rotates, the magnetic field components in two axis will change in a sinusoidal pattern. Detecting these sinusoidal changes requires at least 2D sensitivity in a Hall-effect sensor so that the varying fields can be used to determine the angle of the magnet. Because of this, the dial can be implemented using two 1D linear Hall-effect sensors or a single 3D linear Hall-effect sensor. Additionally, some linear 3D Hall-effect sensors such as the TMAG5273 and TMAG5170 have a built in CORDIC engine that calculates the angle and reports it through registers, freeing up MCU processing. These devices also offer a wake and sleep mode that is useful in achieving a low-power implementation.

GUID-20201229-CA0I-DMBF-S1VD-JNRFV5BPCJ91-low.gifFigure 1-7 On-Axis Field Components

Switch and Latch Hall-Effect Sensors in Smart Locks

Both switch and latch Hall-effect sensors can be implemented in similar manners. These devices can be used to implement end of travel to determine when the bolt is completely locked or completely unlocked. Using multiple switches or latches can provide more precise information about the in-between states of the bolt. However, the use of more than one sensor increases the total power consumption, so it is important to consider low-power Hall-effect sensors, such as the DRV5032 FB version, for battery powered systems.

Switches and latches are also useful for implementing any open and close functionality or tamper detection in a smart lock. While this application can benefit from having multiple directions of sensitivity, it can be accomplished with a simple low-power switch or latch. Tamper detection can go a step further and provide stray field immunity for external magnets. This functionality is useful to prevent an external magnet from tricking the open and close sensor into thinking the door or lock casing is closed when it is actually open or being tampered with. For more information about these functions, see the Limit Detection for Tamper and End-of-Travel Detection Using Hall-Effect Sensors application brief.

Conclusion

Hall-effect sensors can provide a versatile and robust sensing solution for position sensing and tamper detection in electronic smart locks. The various device types and package options add design flexibility to work with different magnets and sensor placements for the application design needs. Additionally, low-power options provide an additional benefit to battery operated applications. Lastly, due to their contactless nature, Hall-effect sensors provide a more robust solution that is not affected by wear and tear like other design implementations.

Table 1-1 Recommended Hall-Effect Devices
DeviceCharacteristicsDesign Considerations
DRV5032Ultra-low-power digital switch Hall-effect sensor available in SOT-23, X2SON, and TO-92 packages. Both omnipolar and unipolar options available.Great for low power applications. This device can operate on as little as 1.65 V with typical current consumption below 1uA. DU and FD variants in X2SON have dual unipolar functionality.
TMAG5231General purpose, low power omnipolar Hall-effect switch available in SOT-23 package.Cost-optimized for low power consumer applications.
TMAG5273Low power linear 3D Hall-effect position sensor with I2C interface available in 6 pin SOT-23 package.Measures magnetic field strength on all 3 axes and reports data over I2C interface. This device can operate on as little as 1.7 V. Configurable power mode options allow for system performance and current consumption optimization.
TMAG5170High-precision linear 3D Hall-effect position sensor with SPI interface available in 8 pin DGK package.Measures magnetic field strength on all 3 axes and reports data over SPI interface. This device offers high precision and self-diagnostic features beneficial for system monitoring.