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?