Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Reed switches, motion and smoke detectors all have NO contacts and can be almost directly connected to any general purpose I/O pin of any port.
The other side of a switch is to be connected to GND.
So, when a switch is activated it pulls the uC pin to GND (logic '0'), when it is inactive, the internal pullup keeps the level at the logic '1' ..