SLYA058A June   2022  – September 2024 DRV5021 , DRV5032 , DRV5033 , TMAG5123 , TMAG5124 , TMAG5170 , TMAG5233 , TMAG5273 , TMAG5328

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Hall-Effect Sensors in Smart Locks
    1. 1.1 Tamper Detection
  5. 2Methods for Hall-Effect Based Rotational Position Sensing
    1. 2.1 Switch Implementation
    2. 2.2 Rotational Sensing With 3D Hall-Effect Sensors
  6. 3Summary
  7. 4References
  8. 5Revision History

Switch Implementation

One way to detect the position of a deadbolt using switches is by having a magnet rotate around the center shaft. From this, you can have Hall-effect switches placed to determine when the deadbolt is in the unlocked position and locked position. These switches can also be placed to determine if the lock is installed on a right-handed door or left-handed door.

 Hall-Effect Switch Implementation ExampleFigure 2-1 Hall-Effect Switch Implementation Example

In this example, there are three switches to determine the position of the deadbolt rotation as the magnet sweeps around the center shaft. The center switch can be used to determine when the deadbolt is completely open and the two end switches can be used to determine when the deadbolt is completely closed, one for a left-handed door installation and one for a right-handed door installation. This way, the lock can be installed on any door and still detect the position of the deadbolt. Figure 2-2 shows an example of the magnetic field of the magnet as the magnetic field moves along this path and the digital output of the switches. The Bz1, Bz2, and Bz3 lines are the magnetic field strengths at each sensor while the D1, D2, and D3 lines are the digital outputs based on the sensors Bop. The device hysteresis due to the smaller Brp of the device is not accounted for in this graph so this only shows when the switches can turn on in either direction.

 Hall-Effect Sensor 2mm Gap – One-Eighth-Inch
                    MagnetFigure 2-2 Hall-Effect Sensor 2mm Gap – One-Eighth-Inch Magnet

This simulation assumes the use of the DRV5032FB which has a typical magnetic threshold of 3mT. However, if an in-plane Hall-effect switch that senses magnetic fields parallel to the package marking surface is needed, the TMAG5233 can be considered. The sensor is placed 2mm away from the end of the magnet which yields a 12mT peak in the sensed magnetic field. The mechanical tolerance of each switch can be adjusted by changing the distance between the magnet and sensor or by using a device with a different threshold. By increasing the distance, Figure 2-3 shows a tighter tolerance for when the switches detect the magnet.

 Hall-Effect Sensor 4mm Gap - One-Eighth Inch
                    MagnetFigure 2-3 Hall-Effect Sensor 4mm Gap - One-Eighth Inch Magnet

While this implementation only uses three switches, adding switches or changing the placement can give more information about the position of the deadbolt. The magnet used for the above simulations is an N52 bar magnet with a 1/16th inch diameter and one-eighth inch thick. If a larger magnet is used, the magnetic field strength can be increased to allow the switches to turn on sooner for the rotational motion. For example, a similar bar magnet with a one-fourth inch thickness with a 2mm gap between the end of the magnet and the sensor yields the following.

 Hall-Effect Sensor 2mm Gap - One-Forth Inch
                    MagnetFigure 2-4 Hall-Effect Sensor 2mm Gap - One-Forth Inch Magnet

The new peak magnetic field is roughly 13.3 mT. This increase is not very large but also gives a wider angle range of when the sensor output is triggered. Selecting a magnet for this application can rely heavily on the space available in the system but factors like desired tolerance need to be considered and compared to the magnet threshold of the sensor.

Using a Hall switch is a low power and low-cost implementation. The previously mentioned DRV5032FB can operate on less than 1µA to preserve battery life in this application. An alternative design is the TMAG5233, a low cost, in-plane Hall-effect switch. The TMAG5233 has an omnipolar magnetic response that enables the device to respond to both noth and south magnetic poles that are horizontal to the package marking surface. The TMAG5233 is available in 5Hz and 40Hz duty cycle options.

Hall sensors also provide additional product lifetime when compared to reed switches. For more details on a comparison between reed switches and Hall sensors, see the Reed Switch Replacement with TI's Hall-effect and Linear 3D Hall-effect Sensors application note.