DEV Community

Xingliao Smart Home
Xingliao Smart Home

Posted on

A Door Sensor Is a Gap Measurement Before It Is Anything Else

What the magnet actually does

Inside every contact sensor is a reed switch: two thin metal blades that touch when a magnetic field is present and spring apart when it weakens. The magnet on the moving part holds the blades closed while the door sits in its frame. Nothing about this is sophisticated, and that is the point: the technology is decades old, cheap, and almost never fails electrically. What fails is geometry. The blades open when the field at the switch falls below a threshold, and that field depends on distance, alignment, and the material between the two halves. Almost every "faulty sensor" complaint is one of those three, not the electronics.

The gap number that decides reliability

Manufacturers quote an operating gap, commonly 15 to 25 millimeters for standard models, sometimes more for wide-gap versions. The quote assumes perfect face-to-face alignment with the magnet's strongest axis pointing at the switch. In practice, a sensor installed at two thirds of its rated gap has no margin left for a door that flexes, a frame that shifts, or a magnet that was mounted slightly off-axis. The professional rule is simple: install at half the rated gap or less, and you will never troubleshoot phantom alarms or missed openings again. Wide-gap models exist for real constraints, not as a general upgrade.

Why doors are the easy case and windows are not

A wooden door in a wooden frame moves predictably, and a standard gap spec was written for exactly that case. Windows break the assumption in three ways. Metal frames, especially aluminum, conduct the magnetic field and distort it, effectively shortening the operating gap. Tilt-turn windows open by tilting before they swing, which can trip or miss depending on where the magnet sits. Sliding windows move parallel to the frame, so the gap changes slowly and a weak sensor may never trigger. For these cases, recessed sensors set into the sash, or dedicated wide-gap units, are the correct tools. Our sensor lineup separates standard and wide-gap models for this reason.

Alignment, sag, and seasonal movement

Three slow processes erode an installation that worked on day one. Doors sag on their hinges over years, shifting the magnet laterally out of the sweet spot. Wooden frames swell in humid seasons and shrink in dry ones, changing the resting gap by several millimeters across the year. Paint layers accumulate on both surfaces, quietly adding thickness every repaint. A sensor that passes a summer test can fail in a January draft. The defense is margin: a gap installed at half spec absorbs all three processes without a service call. This is why we document mounting tolerances per model on the manufacturer page instead of a single number.

Flush, surface, and hidden installs

Recessed sensors set into drilled holes in the door edge are invisible and mechanically protected, but they demand accurate drilling and leave no room for later adjustment. Surface-mounted sensors install in minutes and tolerate alignment error, at the cost of visibility and vulnerability to tampering. Hidden installs inside the frame trade both problems for service difficulty. The choice should follow the door's construction and the owner's tolerance for visible hardware. All three styles exist across the hardware range, and on any install the test is the same: check the door at its normal resting position and again open a few centimeters, because the transition zone is where marginal geometry reveals itself.

Questions that matter on site

Five checks take ten minutes and prevent most callbacks. Measure the actual resting gap, not the nominal one. Confirm the frame material, and shorten the target gap if it is metal. Check that the magnet and switch are face-to-face rather than offset along the frame. Open the door slowly and confirm the transition happens crisply rather than chattering. Ask what the system reports when the gap degrades, because some platforms flag weakening contact as a low-signal event before it becomes a missed alarm. Specifications for every model are available from our engineering desk.

Top comments (0)