First developed in the 1930s, magnetic switches work similar to relays, closing an electrical contact in the presence of a magnetic field. Unlike relays, magnetic switches are sealed in glass. Advantages of magnetic switches over traditional relays include lower contact resistance, faster switching speed and longer life. Because they are sealed, magnetic switches eliminate sparking hazards in flammable or explosive environments.
The switch consists of an elongated glass capsule roughly a centimeter in length and a few millimeters in diameter. Two or more wires pass through the capsule's ends. Inside, thin, stiff metal contacts sit a fraction of a millimeter apart, overlapping each other. The glass capsule is hermetically sealed, preventing corrosion on the metal contacts. Simple magnetic switches have a pair of contacts; more complex ones have several sets of contacts inside the same glass envelope.
One of the contacts in the glass capsule is made of a magnetic material; the other is non-magnetic. A nearby magnetic field from either an electromagnet or permanent magnet pulls one contact against the other, closing the switch. When you remove the magnetic field, the spring action in the stiff metal contacts opens the connection. Because the thin contacts have low mass, they can operate up to 10 times faster than conventional relays with similar ratings.
Because magnetic switches have small contacts placed close together, they cannot handle large currents. Carrying currents of more than few amperes requires a more robust metal-to-metal connection, such as standard relays have. Some magnetic switches can handle in excess of 10,000 volts, though most operate at much lower voltages.
The pulling force a magnet exerts follows an inverse-cube law: doubling the distance to a magnet reduces its force to one-eighth the previous amount. This means a magnetic switch is sensitive to the movement of a nearby magnet. A burglar alarm, for example, has a small permanent magnet mounted to a door and the magnetic switch mounted next to it on the door frame; opening the door actuates the switch immediately.