Diagrams of connections to Raspberry Pi

Connect LED

Connect temperature sensors DS18B20 (1-Wire)

Connect switch buttons Pull_Up

Connect switch buttons Pull_Dn

Connect load (lights, receptacles, fans, etc.) via a relay module

Example of connection to Raspberry Pi

Connect sensors (detectors, switch buttons …)  to Raspberry Pi  inputs via PC817 optic couplers.

Connect actuators (lights, fans, valves…) to Raspberry Pi  outputs via ULN2003A array and a relay.