SLYA063A august 2022 – may 2023 DRV5032 , TMAG5131-Q1 , TMAG5170 , TMAG5170-Q1 , TMAG5170D-Q1 , TMAG5173-Q1 , TMAG5273
Hall-effect sensors measure the magnetic field strength of a magnet. There are three different types: switches, latches, and linear sensors.
Switches and latches provide a digital output based on the magnetic field strength. Switches provide an output when the field is above a certain threshold as shown in Figure 2-1; latches switch the output when the sensed magnetic field changes from north to south or from south to north as shown in Figure 2-2. These devices only provide the digital response but are cheaper than linear Hall sensors and come in low-power variants. These devices can provide information similar to a brushed rotary encoder where the incremental increase and direction depending on the implementation is known.
Linear Hall sensors express the strength of the magnetic field as a register output or analog output as shown in Figure 2-3. If sensing more than one axis of the magnetic field is needed, Hall-effect sensors such as the TMAG5170, TMAG5170D-Q1, TMAG5173-Q1, and TMAG5273 from Texas Instruments are sensitive to all three axes of the magnetic field, making it possible to determine the rotation of a magnet with only a single sensor. These devices include a CORDIC algorithm to easily obtain the angle of the magnetic field rather than calculating it based on separate field data. Linear Hall sensors cost more than a switch or latch but provide additional data about the rotation and can even be used to determine the absolute angle of the magnet.
Rotational encoding with a switch uses two sensors out of phase to measure the direction of change in the rotation.
It is possible to obtain rotational information from a single device with a latch when using a ring magnet. But using multiple latches provides even more information about the system and increases the number of positions that a given ring magnet can detect. For example, when using a 16-pole ring magnet, a single latch provides a high and low signal to determine a change in the rotation. But if two latches out of phase are used, as shown in Figure 2-4, now four different combinations of the switching outputs of the two latches are available to determine the rotational change. This configuration also gives a smaller rotational resolution since the number of state changes per rotation has increased.
The placement of the sensors is important to obtain a good quadrature output from the latches. The single-latch implementation cannot provide information about the direction of change, but the multiple-latch implementation can – by using the order of rising- or falling-edge changes.
A 3D linear sensor can determine the angle of a magnet using multiple axes of the magnetic field. Using a single diametrically polarized cylindrical magnet setup above the Hall-effect sensor, as shown in Figure 2-5, the X and Y components of the magnetic field changes in a sinusoidal pattern as the magnet rotates above the Hall-effect sensor. The fact that these two signals are out of phase makes it possible to calculate the exact angle of the magnet.
Some Hall-effect sensors have a built-in algorithm to determine the angle of the magnet so that the microcontroller only has to read a register instead of doing any post-processing on the magnetic field data. With a 3D Hall-effect sensor, the third magnetic field axis can implement stray field immunity or a push function on the dial. Additionally, the magnet does not need to always be directly above the Hall-effect sensor to accomplish rotational sensing. Since the sensor is sensing all three axes of the magnetic field, placing the magnet in plane or offset from the Hall-effect sensor still can still yield accurate rotation information.