In this post i’m going to test and play with a hall sensor, TLE 4913 is more a hall switch than a real sensor with can be very useful in many appliances
Because copy pasting hall effect article from wikipedia is useless, you can find definition and working principle here: https://en.wikipedia.org/wiki/Hall_effect
By the way, explaining how this sensor work is much more interesting. It’s quite simple, its state changes if a magnetic field is detected by the sensible area of the sensor. It acts as a switch, changing state according to magnetic field presence.
You can find datasheet here: https://www.infineon.com/dgdl/Infineon-TLE4913-DS-v02_02-en.pdf?fileId=db3a304316f66ee80117544449e10647
But we are going to focus on some properties
- « 2.4 V to 5.5 V battery operation » so we can power this chip with both 3.3V or 5V.
- « Switching for both poles of a magnet (omnipolar) » The sensor will act on the same same whatever is the magnetic pole detected
- « output latch and an n-channel open drain output transistor. » The opendrain latch is a very important information, we are going to take care about that during the rest of the article.
The packaging is very small, it will be necessary to make an interface to be able to use it in test circonstances.
First test – how to connect it?
Let talk about the open drain characteristic of this sensor :
Open drain output means the output is managed by a transistor in charge of setting Q output to a unique voltage.
When the module is on standby (no magnetic field) Q output is left floating (open, or hi-z). it can be considered on the same way as a pin not connected to anything. When a magnetic field is detected, internal transistor set the out to low level (ground, 0V)
So a pull up resistor is needed to make this output usable. This resistor allow to get a hight level (5V or 3.3V) when the sensor is inactive and a low level when the sensor is active:
And if you want to plug a LED:
The arduino on this video is not really useful. It’s used only as supply voltage to get 5V.
When a magnetic field is detected by the sensor, the LED is powered off.
First test with a magnet not very powerfull
And with a more powerful magnet