Application Note for Texas Instruments models including: Texas Instruments, Hall-effect sensors, smart locks, position sensing, tamper detection, DRV5032, TMAG5233, TMAG5170, TMAG5273, TMAG3001, SLYA058A, application note, electronic components, sensors
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 ...
In addition to being used to detect the position of the deadbolt, Hall-effect sensors can be used to determine if someone is attempting to tamper with the lock ...
www.ti.com Table of Contents Application Note Position Sensing in Electronic Smart Locks Using HallEffect Sensors Justin Beigel Position Sensing ABSTRACT There are two main uses for Hall-effect sensors in electronic smart locks; tamper detection and position sensing of the deadbolt. The position sensing can be implemented in different ways with Hall-effect sensors depending on the level of information needed by the system. This document covers the different approaches to position sensing for electronic smart locks. Table of Contents 1 Hall-Effect Sensors in Smart Locks...................................................................................................................................... 2 1.1 Tamper Detection............................................................................................................................................................... 2 2 Methods for Hall-Effect Based Rotational Position Sensing..............................................................................................3 2.1 Switch Implementation....................................................................................................................................................... 3 2.2 Rotational Sensing With 3D Hall-Effect Sensors................................................................................................................6 3 Summary................................................................................................................................................................................. 9 4 References.............................................................................................................................................................................. 9 5 Revision History................................................................................................................................................................... 10 List of Figures Figure 2-1. Hall-Effect Switch Implementation Example..............................................................................................................3 Figure 2-2. Hall-Effect Sensor 2mm Gap One-Eighth-Inch Magnet..........................................................................................4 Figure 2-3. Hall-Effect Sensor 4mm Gap - One-Eighth Inch Magnet...........................................................................................4 Figure 2-4. Hall-Effect Sensor 2mm Gap - One-Forth Inch Magnet............................................................................................ 5 Figure 2-5. 3D Hall-Effect Sensor Placement Example............................................................................................................... 6 Figure 2-6. 3D Hall Sensor Rotation Example.............................................................................................................................6 Figure 2-7. Hall Sensor Offset From Axis of Rotation..................................................................................................................7 Figure 2-8. Magnet Offset From Axis of Rotation........................................................................................................................ 7 Figure 2-9. Magnet on Gear Example......................................................................................................................................... 8 Trademarks All trademarks are the property of their respective owners. SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors 1 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated Hall-Effect Sensors in Smart Locks www.ti.com 1 Hall-Effect Sensors in Smart Locks Electronic smart locks have become a key part of a smart home and can be implemented in many different ways. One of the common key elements in a smart lock is understanding the position of the deadbolt. This can be used to reduce strain on the motor as well as provide information about the current state of the lock. If the lock is supposed to be fully closed but gets stuck part way, this can be reported to the user via notification that their door may not be all the way closed. The position of the deadbolt can be implemented with a variety of technologies including optical switches, rotary encoders, mechanical switches, and Hall-effect sensors. In addition to being used to detect the position of the deadbolt, Hall-effect sensors can be used to determine if someone is attempting to tamper with the lock or gain access to the internal circuitry. Tamper detection provides an additional security feature to reduce the potential risk of someone breaking into a house through the smart lock. 1.1 Tamper Detection There are a couple different ways that someone could tamper with a smart lock. One of these is to attempt to access the internals of the device by removing the outer shell to trick the device into opening. In this case, switches can be used to determine when the shell has been removed or bent out of position. This implementation is described in the Limit Detection for Tamper and End-of-Travel Detection Using Hall-Effect Sensors application brief. If the smart lock uses Hall-effect sensors to determine the position of the magnet, someone could try to trick the sensor by using a large magnet to trigger the sensor. One way of eliminating this risk is to have an additional sensor that alerts the main controller of the smart lock when a magnetic field stronger than the design accounts for is present in the system. The additional sensor implementation is also shown in the Contactless, Hall-Effect Variable-Speed Trigger Reference Design With External Field Protection design guide. 2 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated www.ti.com Methods for Hall-Effect Based Rotational Position Sensing 2 Methods for Hall-Effect Based Rotational Position Sensing There are different ways of implementing position sensing in an electronic smart lock depending on the amount of resolution desired. Switched implementations can be used to give an absolute position of the deadbolt being completely open, completely closed, or somewhere in the middle depending on the position of the switch in the layout. Depending on how many states are desired, a varying number of switches can be used. Another method is to have a Hall sensor measure the angle of rotation for the motor or center shaft of the lock. Lastly, the motor itself can have encoding on it. Hall-effect sensors can be used to implement motor encoding as well. For more information on Hall sensor motor encoding, see the Incremental Rotary Encoders application brief. 2.1 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. Figure 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. SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors 3 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated Magnetic Field Strength (mT) Methods for Hall-Effect Based Rotational Position Sensing 12.5 10 7.5 5 1.25 Bz1 Bz2 Bz3 1 D1 D2 D3 0.75 0.5 www.ti.com 2.5 0.25 0 0 -2.5 0 -0.25 10 20 30 40 50 60 70 80 90 Angle Figure 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. Magnetic Field Strength (mT) 6 5.5 5 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 0 1.8 Bz1 1.65 Bz2 Bz3 1.5 D1 1.35 D2 1.2 D3 1.05 0.9 0.75 0.6 0.45 0.3 0.15 0 -0.15 10 20 30 40 50 60 70 80 90 Angle Figure 2-3. Hall-Effect Sensor 4mm Gap - One-Eighth Inch Magnet 4 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated www.ti.com Methods for Hall-Effect Based Rotational Position Sensing 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. Magnetic Field Strength (mT) 15 1.2 Bz1 13 Bz2 1.04 Bz3 11 D1 0.88 9 D2 D3 0.72 7 0.56 5 0.4 3 0.24 1 0.08 -1 -0.08 -3 -0.24 0 10 20 30 40 50 60 70 80 90 Angle Figure 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. SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors 5 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated Methods for Hall-Effect Based Rotational Position Sensing www.ti.com 2.2 Rotational Sensing With 3D Hall-Effect Sensors In a system that needs a higher resolution of the rotational angle, a single 3D Hall sensor can be used to detect the angle of the magnet. Since this device only requires one device, the best placement for the sensor is directly on top of the magnet so the rotation only happens on the Z axis of the sensor. Figure 2-5. 3D Hall-Effect Sensor Placement Example Magnetic Field Strength (mT) The sensor and the magnet are perfectly aligned so only the X and Y portions of the magnetic field are varying while the magnet rotates. 90 Bx 70 By Bz 50 30 10 -10 -30 -50 -70 -90 0 40 80 120 160 200 240 280 320 360 Angle Figure 2-6. 3D Hall Sensor Rotation Example As shown in Figure 2-6, only two of the magnetic field axis are needed to determine the angle of the magnet so the third axis is free to implement tamper detection or to gather additional information on the device status. To determine the angle of the magnet, the data can be processed with an MCU. However, devices like the TMAG5273 and TMAG5170 have an integrated CORDIC algorithm that reports the angle as a register value 6 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated www.ti.com Methods for Hall-Effect Based Rotational Position Sensing so no additional calculations are needed from the MCU. If there is a shift or offset in the magnet and sensor alignment, then the Z axis of the magnetic field will change. If the magnet is still aligned with the axis of rotation but no longer aligned with the sensor, then the Z axis starts to change in a sinusoidal pattern. 90 Bx 70 By Bz 50 Magnetic Field Strength (mT) 30 10 -10 -30 -50 -70 -90 0 40 80 120 160 200 240 280 320 360 Angle Figure 2-7. Hall Sensor Offset From Axis of Rotation Having the Z axis magnetic field vary like this indicates that the magnet is still rotating about its center, but the magnet is no longer aligned with the sensor. Another offset that can occur is having the magnet no longer on the axis of rotation. As long as the sensor is still in line with the axis of rotation, this causes the Z axis magnetic field to become a constant. 75 60 Bx By 45 Bz Magnetic Field Strength (mT) 30 15 0 -15 -30 -45 -60 -75 0 40 80 120 160 200 240 280 320 360 Angle Figure 2-8. Magnet Offset From Axis of Rotation Knowing the expected results from these two different offset types, the Z axis of the magnetic field can be used for predictive maintenance of the system. If these offsets appear while the product is in use, it means that something has shifted and may need to be realigned. The offset in the Z axis could also be used to determine if an external magnet is being applied to the system. If this is the case, there could also be an impact to the expected data of the X and Y magnetic field axis. SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors 7 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated Methods for Hall-Effect Based Rotational Position Sensing www.ti.com Many times, the magnet for this implementation cannot be placed directly on the center shaft or motor. In that case, a gear can be used to offset the magnet rotation and change the resolution of the magnet angle to the deadbolt position. By using a gear ratio that allows the magnet to spin more than the center shaft, a larger angle variation will occur for the motion of the deadbolt. This can be used to gain increased resolution on the position of the deadbolt if desired. An example of this is shown in Figure 2-9. Figure 2-9. Magnet on Gear Example This example has the offset gear that rotates a magnet directly above a linear Hall sensor as well as a magnet that moves along the outer edge of the larger gear. The smaller magnet moves in an arced path that works with the switch implementation previously discussed. This is just one way to implement these magnets for this application. Since the magnet is the main care about, the method of mechanical motion can be changed or adjusted as needed to fit the application. 8 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated www.ti.com Summary 3 Summary Using Hall-effect sensors to determine the position of a deadbolt in an electronic smart lock can be done in two main ways. A switched implementation provides a lower power consumption per device while the 3D Hall sensor provides additional information on the position of the deadbolt. The tolerances of the design can also be varied as needed by selecting different magnets or sensors. Device DRV5032 TMAG5233 TMAG5170 TMAG5273 TMAG3001 Table 3-1. Recommended Devices Characteristics Design Considerations 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. 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. High-precision linear 3D Hall-effect position sensor available in SOT-23, X2SON, and TO-92 packages. Both omnipolar and unipolar options available. 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. 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. Lower power linear 3D linear and angle Halleffect sensor with I2C interface and wake up detection in YBG package. Measures magnetic field on X, Y, and Z axes and reports data over I2C interface. Great for low power applications. This device can operate on as little as 1.65V. Configurable power mode options allow for system performance and current consumption optimization. 4 References 1. Texas Instruments, Limit Detection for Tamper and End-of-Travel Detection Using Hall-Effect Sensors, application brief. 2. Texas Instruments, Contactless, Hall-Effect Variable-Speed Trigger Reference Design With External Field Protection, design guide. 3. Texas Instruments, Incremental Rotary Encoders, application brief. 4. Texas Instruments, Reed Switch Replacement with TI's Hall-effect and Linear 3D Hall-effect Sensors, application note. SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors 9 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated Revision History www.ti.com 5 Revision History Changes from Revision * (June 2022) to Revision A (September 2024) Page · Updated the numbering format for tables, figures, and cross-references throughout the document ................ 1 · Added 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 sentence.......................................................................3 · Added Recommended Devices table................................................................................................................. 9 10 Position Sensing in Electronic Smart Locks Using Hall-Effect Sensors SLYA058A JUNE 2022 REVISED SEPTEMBER 2024 Submit Document Feedback Copyright © 2024 Texas Instruments Incorporated IMPORTANT NOTICE AND DISCLAIMER TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATA SHEETS), DESIGN RESOURCES (INCLUDING REFERENCE DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES "AS IS" AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS. These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable standards, and any other safety, security, regulatory or other requirements. These resources are subject to change without notice. TI grants you permission to use these resources only for development of an application that uses the TI products described in the resource. Other reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims, damages, costs, losses, and liabilities arising out of your use of these resources. TI's products are provided subject to TI's Terms of Sale or other applicable terms available either on ti.com or provided in conjunction with such TI products. TI's provision of these resources does not expand or otherwise alter TI's applicable warranties or warranty disclaimers for TI products. TI objects to and rejects any additional or different terms you may have proposed. IMPORTANT NOTICE Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright © 2024, Texas Instruments IncorporatedAntenna House XSL Formatter V7.4 R1 Windows : 7.4.1.63121 (2023-12-20T11:05 09) iText 2.1.7 by 1T3XT
![]() |
The Engineer's Guide to Temperature Sensing: Challenges and Solutions A comprehensive guide for engineers from Texas Instruments on temperature sensor design challenges and solutions, covering thermistors, RTDs, IC sensors, and thermocouples for monitoring, protection, and compensation in various applications. |
![]() |
Extending Battery Life in Smart E-Locks: Power Management Architectures This document explores power management architectures for smart e-locks, detailing how switching converters like boost and buck can significantly extend battery life compared to traditional LDO implementations by optimizing standby and active power consumption. |
![]() |
In-Package Hall-Effect Current Sensors for Solar Inverter Applications This application note from Texas Instruments details the use of in-package Hall-effect current sensors, such as the TMCS112x and TMCS113x, across various solar inverter systems, including string, residential, hybrid, and micro inverters, to enhance accuracy, reliability, and efficiency. |
![]() |
Texas Instruments 1988 Semiconductor Products & Circuit Design Tools Master Selection Guide Explore Texas Instruments' comprehensive 1988 catalog of semiconductor products, circuit design tools, and support services. Find part numbers, technical data, and product information. |
![]() |
Texas Instruments AWR6843AOP: 60-GHz mmWave In-Cabin Sensing Reference Design This reference design guide from Texas Instruments details the AWR6843AOP 60-GHz mmWave sensor for advanced in-cabin automotive applications. It covers child presence detection, seat occupancy, and intruder detection, outlining hardware, software, and processing techniques. |
![]() |
HA541/HB541 Texas Instruments Product Details - Worldway Electronics Find detailed product information for HA541/HB541 from Texas Instruments, including part number, category, applications, RoHS compliance, stock availability, and EDA/CAD models. Worldway Electronics is a franchised distributor. |
![]() |
MMWave SDK User Guide: A Comprehensive Guide to Texas Instruments' mmWave Software Development Kit Explore the MMWave SDK User Guide from Texas Instruments. This document details the MMWave Suite, demos, system overview, and getting started procedures for developing mmWave applications. Learn about configuration, data processing, and troubleshooting. |
![]() |
TIDEP-01022 Reference Design Bill of Materials (BOM) Overview An overview of the Bill of Materials (BOM) for the Texas Instruments TIDEP-01022 Automotive Reference Design, summarizing the types of electronic components and manufacturers listed. |