
The sensor is used to detect whether a door/window/drawer is closed or not. This kind of sensor is commonly found in burglar alarm systems to detect intrusion. It can also be used in home automation system for example to turn on a light when a wardrobe door is opened.
The sensor is made of two parts. One is a reed switch enclosed in a plastic housing with two wires that can conduct electricity. This part is normally mounted on a door/window frame. The other piece which doesn't have wires attached to it, contains a magnet and typically mounted on a door.
The reed switch reacts whenever a magnet is brought near to it. For this particular sensor, the switch is normally open (doesn't conduct electricity) and when a magnetic field is exposed to it, the switch closed (conduct electricity). The binary status (open or close) of the switch can be read by a controller through the two wires. Take note that the switch cannot be used as power switch. It is for signal switching only.
The good thing is, the two parts doesn't have to be physically in contact for the switch to close. Therefore, there is no friction that can hinder the door movement. The maximum separation between the two parts when the door is closed has to be around 15mm for the switch work.
This sensor comes with self-adhesive tape backing for easy mounting. If you want to have something more permanent, there are mounting holes which you can use to screw in the sensor (screws are not included).
Technical details: