Reed switch

The reed switch module supplies a digital signal. When a magnet is placed near the glass enclosure a high signal is output, when the magnet is moved away a low signal is output.

Reed switch PCB layout
Circuit details

Reed switch design symbol

Reed switch circuit details
To generate a digital signal from the reed switch, it is connected as part of a potential divider. When a magnet is placed near the switch the contacts close, producing low resistance between the switch terminals (compared with R6) making the output signal high. When the magnet is moved away, the switch contacts open producing high resistance between the switch terminals (compared with R6) making the output signal low. The XLD block is for a PCB mounted reed switch. In practice, reed switches are often mounted remotely from the PCB e.g. on door frames in security systems. If you want a remotely connected reed switch in your design use the external switch module [22].
Programming
Reading the state of the reed switch requires the same code as reading the state of a push button. Details are given here