The door sensor is made of - wires - 2 contacts One wire should be connected to the ground and the other to an INPUT port. To know whether the door is open or closed, poll the INPUT port.