SLYA057A March   2022  – September 2024 DRV5021 , DRV5032 , DRV5033 , TMAG5123 , TMAG5124 , TMAG5170 , TMAG5231 , TMAG5233 , TMAG5273 , TMAG5328

 

  1.   1
  2. 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 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 being installed.

The last application for sensors discussed in this paper is open and close detection for the door. 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, this can put stress on the motor or leave the bolt in a substandard state, such as only partially locked, which puts the system at risk.

TMAG5273, TMAG5231, DRV5032 Smart Lock Position Sensing Block DiagramFigure 1 Smart Lock Position Sensing Block Diagram

Figure 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. 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 the device 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 use two of the axis to determine angular data while the third axis can be used to implement tamper detection.

TMAG5273, TMAG5231, DRV5032 Slide-By Magnet ExampleFigure 2 Slide-By Magnet Example
TMAG5273, TMAG5231, DRV5032 Rotational Magnet ExampleFigure 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.

TMAG5273, TMAG5231, DRV5032 Omnipolar Hall-Effect Switch FunctionalityFigure 4 Omnipolar Hall-Effect Switch Functionality
TMAG5273, TMAG5231, DRV5032 Hall-Effect Latch FunctionalityFigure 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 a 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 design 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.

TMAG5273, TMAG5231, DRV5032 Magnetic Field for Linear Slide-By MagnetFigure 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 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 and reports the angle through registers, freeing up MCU processing. These devices also offer a wake and sleep mode that is useful in achieving a low-power implementation.

TMAG5273, TMAG5231, DRV5032 On-Axis Field ComponentsFigure 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 one must consider low-power Hall-effect sensors, such as the DRV5032 FB version, for battery powered systems. If an in-plane Hall-effect switch that senses magnetic fields parallel to the package marking surface is needed, the TMAG5233 can be considered.

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 design 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 the contactless nature, Hall-effect sensors provide a more robust design that is not affected by wear and tear like other design implementations.

Table 1 Recommended Hall-Effect Devices
Device Characteristics Design Considerations
DRV5032 Ultra-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.65V with typical current consumption below 1uA. DU and FD variants in X2SON have dual unipolar functionality.
TMAG5231 General purpose, low power omnipolar Hall-effect switch available in SOT-23 package. Cost-optimized for low power consumer applications.

TMAG5233

In-plane Hall-effect switch (vertical sensor) available in industry-standard SOT-23 package. Has an omnipolar magnetic response that reacts to both north and south magnetic poles parallel to the package marking surface.
TMAG5273 Low 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.7V. Configurable power mode options allow for system performance and current consumption optimization.
TMAG5170 High-precision linear 3D Hall-effect position sensor with SPI available in 8 pin DGK package. Measures magnetic field strength on all 3 axes and reports data over SPI. This device offers high precision and self-diagnostic features beneficial for system monitoring.