A Reed Switch Module is a magnetic sensor that is normally open and get closed when exposed to a magnetic field. In our example turn off the built-in LED on pin 13 if the sensor is closed. For this you need to keep a magnet near the sensor. The module includes a 10 K Ohm resistor, so no additional parts needed.
KY-025 Reed Switch Module for Arduino is a small electrical switch operated by an applied magnetic field, commonly used as proximity sensor.
The module has both digital and analog outputs. A trimmer is used to calibrate the sensitivity of the sensor.