Alarm diy with arduino

Possibly something like below. You will need to use an analog input (A1 in the example).

image

When the door is closed, the switch is open and the voltage is 2.5V.
When the door is open, the switch is closed and the voltage is 0V.

Bypassing the switch will result in 0V and hence the system thinking that the door is open.