SLYA093 September   2025 TMAG3001 , TMAG5253

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Benefits of Hall-Effect Sensors
    1. 2.1 Hall-Effect Sensors for Keys
    2. 2.2 3D Hall-Effect Sensors for Knobs
  6. 3Keypress Design Considerations
    1. 3.1 Simulating Keypress Design
    2. 3.2 Keypress Bench Results
  7. 4Keyboard Design Example
  8. 5Summary
  9. 6References

Hall-Effect Sensors for Keys

For keyboards, a common design used in today's designs are mechanical switches. These mechanical switches work by relying on physical contact between components in order to register keystrokes. The downside to this is that as time goes on, these mechanical components tend to degrade due to the constant friction of these moving parts. Additionally, due to the fixed nature of these switches, they can only provide an on or off response. For these reasons, Hall-effect sensors provide a great alternative to mechanical switches.

Hall-effect sensors in keyboards work by detecting changes in the magnetic field to determine key presses, rather than relying on physical contact like mechanical switches. When unpressed, the magnet rests at an elevated position as shown in Figure 2-1. As the key gets pressed, the magnet moves closer to the sensor increasing the magnetic field seen by the sensor, shown in Figure 2-2. By eliminating this need for physical contact, keys that use Hall-effect sensors are able to last significantly longer than the mechanical switch counterparts.

 Hall-Effect Sensor With Magnetic Key
                    UnpressedFigure 2-1 Hall-Effect Sensor With Magnetic Key Unpressed
 Hall-Effect Sensor With Magnetic Key Fully
                    PressedFigure 2-2 Hall-Effect Sensor With Magnetic Key Fully Pressed

With 1D linear sensors like the TMAG5253, a voltage output that is proportional to the key being pressed is provided. Depending on the polarity of the magnet, this voltage output can either increase or decrease as the magnet approaches the sensor. As shown in Figure 2-3, the TMAG5253's voltage output can decrease when the device sees a negative magnetic field and increase when the device sees a positive magnetic field.

 TMAG5253 Linearity of the Magnetic
                    ResponseFigure 2-3 TMAG5253 Linearity of the Magnetic Response

Using this linear voltage output, an analog-to-digital converter (ADC) can be used to set the actuation point for the keyboard keys. This enables the ability to provide users with adjustable actuation points for the keyboards. By being able to customize the distance a key needs to be pressed before the key registers a keystroke, users are able to optimize the keyboard for speed, accuracy, and comfort based on preferences. Alternatively, if just an on or off functionality is required, the TMAG5231, which is a high-precision Hall-effect switch, can be used. A switch can be useful as this allows for quicker sampling as this is easier to grab data when only looking for an on or off response.

In addition to allowing for an adjustable actuation point, the TMAG5253 also has an enable pin that can be used to save power and help reduce the number of required ADCs. When designing keyboards, an important consideration is the number of keys on the keyboard. A standard full-sized keyboard typically has 104 keys which can mean that a microcontroller can need 104 ADC pins. With the enable pin offered by the TMAG5253, multiple devices can share the same analog output which helps to reduce system cost by reducing the number of required ADCs.

 Timing Diagram for Multiplexing the Sensor
                    OutputsFigure 2-4 Timing Diagram for Multiplexing the Sensor Outputs

Figure 2-4 shows how a microcontroller can be used to multiplex between multiple sensors. When GPIO1 is high and GPIO2 is low, Device 1 becomes enabled and is what drives the output line whereas Device 2 is disabled. Also, when GPIO2 is toggled high and GPIO1 is low, Device 2 is enabled and drives the output line whereas Device 1 is disabled. The TMAG5253 is capable of supporting a capacitive load of 1nF. This means that if the load capacitance on each sensor is 20pF, up to 50 sensors can share the same output.