
A common sight in ‘smart homes’, door sensors allow you to detect whether a door is closed or open, enabling the triggering of specific events. Unfortunately, most solutions for these sensors are relatively bulky and hard to miss, making them a bit of a eyesore. This was the case for [Dillan Stock] as well, who decided that he could definitely have a smart home, yet not have warts sticking out on every single doorframe and door. There’s also a video version of the linked blog post.
These door sensors tend to be very simple devices, usually just a magnet and a reed relay, the latter signaling a status change to the wireless transmitter or transceiver. Although [Dillan] had come across recessed door sensors before, like a Z-wave-based unit from Aeotec, this was a very poorly designed product with serious reliability issues.
That’s when [Dillan] realized that he could simply take the PCB from one of the Aqara T1 door sensors that he already had and stuff them into a similar 20 mm diameter form factor as that dodgy sensor unit. Basically this just stuffs the magnet and PCB from an existing wart-style sensor into a recessed form factor, making it a very straightforward hack, that only requires printing the housings for the Aqara T1 sensor and some intimate time between the door and a drill.

Hmmm
Could a battery-less energy harvesting door open sensor be made? The magent swiping motion can be used to generate power using a well placed coil. It would make sense to generate the power from the door swing itself, and then have a small BLE or whatever radio transmit a few packets, then turn off when the power is exhausted.
That might work, i have a zigbee (Hue) switch which works without batteries by harvesting the energy of the switch press action.
As for the 3d printed solution presented in the video, i recon it would just as well work without the housings. The magnet can be press fitted in the top of the wooden frame directly. The sensor could be placed in the hole as long as the depth of the hole is precise and covered by a thin piece of plastic fixed with some silicone kit to prevent to dust coming in, or just print a cap to cover the hole. Nothing else needed besides the sensor.
That’s a difficult one. There’s very little power to harvest from a single cycle of a magnet moving away unless the magnet is so strong you can actually feel it when you open the door, especially to generate a decent wireless signal.
Perhaps if you located it near the hinge and pulled some of the mechanical energy from swinging the door.
Honestly though, you’ll have better luck with an inconspicuous solar cell that you use to charge a capacitor or tiny battery. You can also pull microwave energy in a dense wifi environment; plenty of examples of passive power like that.
this idea is probably even more ridiculous than the last.
i wonder why it isn’t possible to create a sort of low-voltage contact rail inside of a door. the latches that make a door click shut are made of metal, can’t they act as pogo pins or charging for a smart lock?
they could either tap into the doorbell line or come out of the frame as a connector to an AC adapter.
again, i am insane 75% of the time, so i understand any rebuttals to this.
It’s entirely possible but just impractical and error prone. The guys building and framing doors wouldn’t be building and framing doors if they could be doing low voltage electrical work.
It still doesn’t tell me if the door is actually locked or not. Basically the same as any wireless alarm contact transmitter. I feel an urge to yawn.
Use a smart lock for that. This is for useful for doors inside the house.
You are thinking too narrowly. These are useful for detecting a break in on external doors. I use them on internal doors as well (I have a multi level house). I use it to assist in automations like lighting and HVAC controls (if one of the doors in my house is left open in the winter the basement HVAC cooks the loft area).
Why do you want internal doors to be locked? That’s what this is for.
Why would it be limited to that? External doors are much more interesting to monitor. O, and you could train an AI model on the lock audio to determine if it’s locked or not. I am guessing this could work well, especially in combination with the door open/close sensor data.
A friend of a friend has installed “sensors” that can sense the lock bolt being locked in the toilets of a home for the elderly, such that staff can investigate when a toilet door is locked more than a certain time. The “sensors” were just two metal wires in the opening of the door frame that contacted each other when the lock bolt was inserted, with some ESP32 sensing it.
This can certainly be applied to a lock.
Must be terrible living with a mind that lacks of any imagination and creativity, no wonder you’re bored.
This is pretty insulting to the OP. Please remember the code of conduct.
You’re thinking of home security. These sensors activate lights based on interior doors. They’re invisible indicators of door state.
If you want it to indicate lock state, then put the sensor in the door jamb and the magnet on the dead bolt. This isn’t rocket surgery.
Maybe a more hidden solution would be to put it on the hinge side of the door, assuming there is still enough of a gap to sense when the door is open.
It gets hard to tell if the door is open if it is at the hinge side. You could put it near the bottom or on top of the door for better concealment.
I was thinking a magnetic proximity version of this on the hinge side would allow you to know not only open/closed, but approximately how widely it’s opened.
I may install this on my garage door so I could quickly tell if it’s open or closed by looking at the app. I could also write a script to remind me if the door is open at bedtime.
I always thought that’s what windows are for…. But seriously, I had the same need in the past for a basement door I regularly almost close but then forget to really close….
Folks keep posting about detecting a door being locked or not when the article is merely about determining if a door is open or not – a related but different state.
As to why one would want to know of an interior door is open or not I can apply this to a home of mine, a classic 1840 New England farm house. The upper floor has 2 bedrooms, 2 stairwells down, 1 up, a long hallway, a bathroom, a home office, and numerous closets.
This week the outside temperature was -8f, meaning the radiator heating system struggled. Unused rooms are shut off and allowed to cool to 40f, keeping the used ones at a comfortable temperature. However a door accidentally left open by us or the housekeepers or a guest, or even not properly closed (if not latched the old doors sometimes open) would disrupt that equilibrium.
An alert that a specific door had been open for an extended time would be very useful, and a big ugly sensor protruding from the antique doors and door frames most unwelcome. This project fits that bill.
I had several hidden sensors installed on different doors and the way I did was to place a reed switch in the door frame and a round magnet recessed in the door. I ran the magnet wires to the switch along the door trim, and with some caulk you can perfectly hide it. I modified sensors to run of USB via a 3.3v regulator. Works perfectly for years, completely hidden (may need some drywall work and/or painting), and doesn’t need batteries.
tiny nitpick…when i’m designing a 3d printed part i usually have $fn=10 at the top of the file so that openscad is fast as i iterate (though it’s getting to be less of an issue as time goes by). but when i am preparing to print it, i increase $fn to whatever it takes to make the lines disappear. $fn=50 is usually more than enough. just sayin :)
$fn = $preview ? 10 : 50;
In case you hadn’t already stumbled upon this, there’s a single-line handler for the behavior you’re describing in the OpenSCAD User Manual (which I’ve modified with your example values).
When I first saw that, I kicked myself for how much headache I’d dealt with in slow-rendering previews or accidentally exporting low-accuracy models for slicing.
Dang, that is a fine tip. On behalf of everyone else who somehow missed this in the documentation, thank you!
Industrial door controls (badge access doors on banks and other medium security areas) have them in the frames as well; the control board (since it’s generally all hardwired) has logic for ‘door forced open’ or ‘door left open too long’.
Nice. All except these are battery driven. I’d prefer just running two wires from a small reed switch back to a controller mounted in a box somewhere. But that’s just me though. I dislike changing batteries and those coin batteries aren’t cheap.
Do this:
DRV5032 ultra low power Hall switch + magnet. DS2413 with a Schottky-cap harvester to scavenge power from the 1-Wire line.
Robust✔ Reliable✔ Wired✔ Low power✔ No battery✔ Zero maintenance✔ Addressable✔ Multi-drop✔ Simple✔ Compact✔ Low price✔ Twisted pair bus✔
I took a totally different (less invasive) approach to the problem. I shoot a beam of a VL53L1X from a Tasmota device towards the door. Much more flexibility, and no batteries involved.
ToF seems overdoing it, might as well use a simple IR beam and reflector.
But either way it would get disturbed by humans in the place.
Or you could one of those ready made IR proximity thingies I suppose and install it in the frame or on it.
However it would be nice if you could also tell how wide ajar a door is I think, but then you are looking at a strain gauge or Hal sensor I guess. Or a potentiometer installed in such a way that it rotates with the door.
The problem for me is powering stuff, you need to have wires to the door or the infernal constant charging/replacing batteries.