# Cancel latching hall effect sensor effect

I want to use a hall effect sensor to detect when a door is close or not; the sensor would be in the door frame, and a little permanent magnet would be on the door. However, I learned that the sensor I got is latching: at first it outputs 0, when I bring the magnet in the right direction it turns 1, and when I remove the magnet it stays 1.

For my project, I want the sensor to turn HIGH only when the magnet is close to the sensor. To solve this, I could probably get a different non-latching hall effect sensor, but I wanted to know if there was a way to do this with the current sensor I have.

I thought about using a 2nd magnet that would by default make the sensor output 0, but would not be powerful enough to compensate the field generated by the magnet on the door.

Better ideas? Is it worth it?

• Why not just use a simple reed switch? Feb 13, 2016 at 9:21
• What happens when you remove power from it? Does it revert back to 0? Feb 13, 2016 at 10:18
• Hall sensor just doesn't work as you described, it just detects magnetic field and it doesn't latch. Feb 13, 2016 at 10:41
• @MarkoBuršič there are latching hall effect sensors. allegromicro.com/en/Design-Center/Technical-Documents/… Feb 13, 2016 at 10:43
• @MarkoBuršič: See Melexis MLX92211-AxA 3-Wire Hall Effect Latch, page 1. "With latching magnetic characteristics, the output is turned low or high respectively with a sufficiently strong South or North pole facing the package top side. When removing the magnetic field, the device keeps its previous state." Feb 13, 2016 at 14:06