Garden & Home Reviews is reader-supported. We earn affiliate commissions from qualifying purchases — how this works.

How to Install a Door and Window Sensor

Home/Resources/Smart Home & Security/Installing a Door and Window Sensor
Wide view of a person mounting a small camera beside a front door, in soft early-morning light

Affiliate Disclosure

Some links on this page are affiliate links. As an Amazon Associate, we earn from qualifying purchases — at no extra cost to you. We do not buy, test, or physically handle the products we cover; our rankings come from aggregated owner reviews, ratings and expert consensus. Commissions never change our verdicts. How we rank · full disclosure.

Installing a door or window contact sensor is a 10-minute, no-tools job using the included adhesive. Each sensor is two pieces: a body on the fixed frame and a magnet on the moving door or sash. Cost is $15 to $30 per sensor. There is no wiring and no electrical risk, so no permit and no pro. The whole trick is keeping the two pieces aligned and within a quarter inch when closed, and choosing which openings actually need coverage. Most sensors report to a hub or security base station that turns an open into an alert.

How to Install Door and Window Sensors — Step by Step

Plan your coverage first

Walk the house and list every ground-floor exterior door, then accessible ground-floor and basement windows, then any upper window reachable from a roof or tree. Cover the doors an intruder would use and the windows out of street view before spending on rarely used openings. This priority order gives you real protection without a sensor on all forty windows.

Low-angle view of a person mounting a small camera beside a front door, in soft overcast light

Step-by-step installation

  1. Add the sensor to your system. In the hub or security app, put the sensor in pairing mode (usually by inserting the battery or pressing a tab) and add it near the hub before mounting.
  2. Identify the two pieces. The larger body holds the battery and radio; it mounts on the stationary frame. The smaller magnet mounts on the moving door or window.
  3. Clean the surfaces. Wipe both mounting spots with rubbing alcohol and let them dry. Adhesive fails on dust and grease.
  4. Position for alignment. With the door or window closed, hold both pieces so the alignment marks line up and the gap between them is a quarter inch or less. Mark or note the spots.
  5. Mount the body on the frame. Peel the adhesive and press it firmly for 30 seconds. On rough or exterior surfaces, use the screws instead.
  6. Mount the magnet on the door. Press it opposite the body, marks aligned. Use spacers if the door and frame are not flush so the two pieces sit close.
  7. Test open and closed. Open the door and confirm the app or panel shows open; close it and confirm it shows closed. Adjust if it stays open when shut (gap too big).
  8. Set the automation or alert. Decide what an open triggers: a phone notification, a chime, a light, or an alarm when armed. Test the full chain.
Close-up detail of the material being worked in a smart home & security project, in soft overcast light

Tools and materials

Usually nothing but rubbing alcohol and a cloth; a screwdriver only if you screw sensors down. Contact sensors are the low-cost backbone of a layered system — they pair with the hub in our smart home hub guide and slot into the base stations covered in our DIY security system picks. Combine an open-door trigger with a smart plug to switch on a lamp, or a camera to start recording. That layering is what turns a sensor from a chime into real security.

Wide environmental view of a person mounting a small camera beside a front door, in soft overcast light

Mistakes that cause false alerts

Do you need a pro?

No. Contact sensors are entirely adhesive-and-battery with no electrical connection, so a licensed trade is never required. This is among the safest DIY jobs in the home. Professional monitoring is a separate, optional service you can subscribe to for many DIY systems, but installing the sensors themselves is always a homeowner task with no code or permit implications.

We never buy, test or physically handle the products we rank. Recommendations come from aggregated owner reviews, star ratings, review volume and expert consensus — see how we rank.

More from this hub: Smart Home & Security · Setting up a DIY security system · Setting up a smart home hub · Installing a smart lock · Best DIY security systems · How we rank

Straight Answers

Frequently Asked

How big a gap can there be between the sensor and the magnet?

Keep the two pieces within about a quarter inch of each other when the door or window is closed. Most contact sensors trip when the magnet moves roughly a half inch away, so mounting them too far apart causes false open alerts even when the door is shut. The sensor body (the larger piece with the battery) goes on the fixed frame; the magnet (the smaller piece) goes on the moving door or sash. Alignment marks on the two pieces should line up when closed. If your frame and door are not flush, use the included spacers to close the gap.

Do contact sensors need a hub or can they work alone?

Most door and window sensors are part of a system and talk to a hub or base station over Zigbee, Z-Wave or a proprietary radio; they are not standalone. The hub is what turns an open signal into a notification, a siren, or an automation. A few Wi-Fi contact sensors connect directly to your router and app without a separate hub, which suits a very small setup. If you already run a smart home hub or a DIY security base station, add the sensor to that rather than buying a separate ecosystem.

Where should I put door and window sensors?

Cover every ground-floor entry first: exterior doors, then accessible ground-floor and basement windows, then any second-floor window reachable from a porch roof or tree. Prioritize the doors an intruder actually uses, front and back, and the windows out of street view where someone could work unseen. You do not need a sensor on every single window; focus on ground-level and easily reached openings. Add a sensor to interior doors like a home office or gun safe room if you want extra alerts there.

Will the adhesive hold, or should I screw sensors down?

The factory foam adhesive holds well on clean, dry, smooth surfaces at room temperature, and it is the standard mount for renters since it leaves no holes. Wipe the surface with rubbing alcohol and let it dry before pressing the sensor on for 30 seconds. Screws are better on rough, textured or exterior-grade surfaces, on doors that slam hard, and where you want a permanent install. In cold or humid spots, adhesive can let go over time, so a screw or two adds insurance for a garage or basement door.

How long do contact sensor batteries last?

Most run 1 to 3 years on a single coin cell (commonly a CR2032 or CR123A), because they only transmit when the door or window changes state rather than continuously. The app or panel warns you with a low-battery alert weeks before it dies, and swapping the cell takes seconds. If a sensor drains batteries in months, it is usually being tripped constantly by a misaligned magnet or a loose door, which makes it transmit far more often than normal, so fix the alignment rather than just replacing cells.