ESP32 comes with in build hall sensor, this sensor can be used to detect presence of magnet, Like door sensor. In this tutorial we will see how to read its value and detect presence of magnet.
A Hall effect sensor is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity sensing, positioning, speed detection, and current sensing applications.[1]