Door sensors detect door position (i.e., open or closed) based on the precise gap between the magnet and the reed switch.