Sensor magnets (also known as reed switches) are electrical switches operated by a magnetic field. They can be used to detect specific actions, like the opening of a door, and are widely used for electrical circuit control.
Sensor magnets can be used in door and window sensors, and are commonly found in burglar alarm systems. They're also widely used for communications. Once the magnet is pulled away from the switch, the reed switch will go back to its original position. A reed relay is when there are one or more reed switches inside a coil.
Sensor magnets can be used to reduce current leakage. This is useful for applications in hazardous areas, for example where there's flammable gas in the area, or in medical devices. Sensor magnets are also useful in locations where it isn't possible to make direct contact with the switch, such as in explosive or toxic environments.