Orienting Bar Magnets to Operate Magnetic Sensors
In order to use magnetic sensors, you must properly position and orient bar magnets near the sensor. In order to do this correctly, you must understand how a sensor responds to magnetics fields. By knowing the shape of a bar magnet's field, you can easily determine how to operate a sensor with a bar magnet.
Sensors with different technologies tend to have particular sensing directions. This is usually related to the implementation of the sensing technology inside of a chip. This set of images shows the typical behavior for many common devices. Note that there are many exceptions! You must consult the data sheet of any particular device before using it!
Digital Hall-Effect devices typically have a sensing direction perpendicular to the chip face. Most Hall-effect devices are polarity sensitive. There are some omnipolar Hall-effect devices that are not polarity sensitive.
TMR and GMR devices typically have a sensing direction parallel to the chip face. GMR devices are typically not polarity sensitive. TMR devices are typically polarity sensitive. Note though that there are some specialized devices with different polarity sensitivity. You must always consult data sheets for any device. Note too, that there are devices with sensing axes perpendicular to the chip face.
Devices based on Hall-effect, GMR, TMR, and similar technologies can be thought of as "point sensing" devices. They measure the magnetic field at a very small sensing region inside the sensor. For most practical purposes, you can think of these sensors as measuring the field at a single point in space. This is in contrast to devices such as reed switches or sensing coils which respond to the field in a larger volume of space. The response of such devices is a much more complicated function of field direction and strength.
You must always check the data sheet. You cannot assume what the sensing axis is or what the polarity sensitivity is from the type of technology.
General Shape of Bar Magnet Field
This diagram shows the general shape of the field from a bar magnet. There are some important features to note.
- The field points outward from the north pole.
- The field points inward to the south pole.
- The field "wraps" around the magnet.
- The field is strongest near the poles.
This is discussed in more detail in the article about bar magnet fields.
Typical Unipolar Hall-effect Switch Response to Fields
A bar magnet must be placed in the proper location and orientation for use with magnetic sensors. The 2-D field plots show the fields with a magnet placed in various operate positions. The 3-D plots show the activate regions.
A typical unipolar Hall-effect switch requires the field to point through the sensor in a particular direction. In order to do this with a bar magnet, the magnet must be in the proper location. The red arrows on the device show the field direction that the device is sensitive to. The red arrow on the magnet shows the north pole.
The device illustrated here is commonly referred to as a "south pole activated" device. The name only holds true when the south pole is the closest magnet pole to the face of the device. It will work just as well with the north pole on the other side of the device. In the 2-D diagrams, the face of the device is toward the top. Notice how the south pole must be near the top or the north pole near the bottom. This is the only way for the field to point in the correct direction.
For omnipolar Hall-effect devices, the field can point in either direction. For omnipolar devices, the magnet poles can be reversed. Note that some Hall-effect devices work with the field pointing in the opposite direction. These are sometimes called "north activated" devices. It just means that the red arrow would be pointing into the device in the opposite direction.
It is generally better to think in terms of the field direction that to think of south or north pole activation. As shown here, the field must be pointing from the bottom to the top in the 2-D plots. If you think about the field direction and know the general field shape of a bar magnet, it is straightforward to figure out where the magnet can be.
Typical GMR Switch Response to Fields
A bar magnet must be placed in the proper location and orientation for use with magnetic sensors.
A typical GMR switch requires the field to point through the sensor in a particular direction. In order to do this with a bar magnet, the magnet must be in the proper location. Note that a typical GMR device is polarity insensitive. The magnet poles can be exchanged.
The upper 2-D graphs show the field directions for only the two left 3-D images. The fields for the right most 3-D image would require the field to point into the plane of the 2-D graphs.
Note the potential complexity of the sensor response compared to a unipolar Hall-effect switch. This is due to a combination of polarity insensitivity as well as the different sensing axis of the device.
Typical TMR Switch Response to Fields
A bar magnet must be placed in the proper location and orientation for use with magnetic sensors.
A typical TMR switch requires the field to point through the sensor in a particular direction. In order to do this with a bar magnet, the magnet must be in the proper location. Note that a typical TMR device is polarity sensitive. The red arrows show the north pole in the 3-D images.
The upper 2-D graphs show the field directions for only the two left 3-D images. The fields for the right most 3-D image would require the field to point into the plane of the 2-D graphs.
Note the similarity of this to a typical GMR device. Note that half of the GMR regions are missing. This is because of the difference in polarity sensitivity.
Many people have gotten used to the idea that "south poles activate hall-effect sensors" or other such recipes. The idea that simply moving a magnet close to a sensor causes it to operate is widespread. To some extent, it is true. But in many applications, this will simply not work well.
If you are serious about working with magnets and sensors, I'd encourage you to get used to thinking in terms of fields. Once you become familiar with bar magnet fields and sensor response, it becomes easy to look at an application and decide what needs to be done. The proper orientation of magnets and choice of sensors is key to creating good designs.