# Home made door lock sensor

**URL:** <https://community.smartthings.com/t/home-made-door-lock-sensor/25354>\
**Category:** Projects & Stories\
**Tags:** project\_locks, project\_sensors\
**Created:** [October 7, 2015, 4:01pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354 "2015-10-07T16:01:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![djtucker](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/djtucker/32/23621_2.png) [@djtucker](https://community.smartthings.com/u/djtucker)\
**Post date:** [October 7, 2015, 4:01pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/1 "2015-10-07T16:01:02Z")

</div>

I’m looking to build a door lock sensor which will be based on a microswitch buried into the rebate on the door, that switches when the deadbolt is extended into the cavity.

The question is, how to get the state of that microswitch reported back to SmartThings? one option I looked at already is the Fibaro FGK-101 which is a z wave contact sensor with an extra set of screw terminals inside allowing a NC or NO external switch to be wired in…almost perfect, but if the extra terminals are used the regular contact sensor does not function, which seems a waste.

I also wondered if this could be done with a Raspberry Pi, since I have an unused one, and that could perhaps become a multiple sensor used as a doorbell, lock sensor (as above), motion detector, mail delivery sensor, door camera, BLE beacon etc.

What do you think - any better suggestions out there?

edit: I should also add that I am a UK user

edit: I am marking this solved as I am returning my SmartThings kit due to lack of useable functions at this time in the UK. I may be back !

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 7, 2015, 4:05pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/2 "2015-10-07T16:05:27Z")

</div>

ThingShield. It’s a bridge between and arduino and smartthings. Very popular for just this kind of project. It’s what many of the makers use.

You’ll find most of them in the following topic. This is a clickable link.

> [@Announcing the "ST\_Anything" Arduino/ThingShield Project](https://community.smartthings.com/t/announcing-the-st-anything-arduino-thingshield-project/9087):
>
> 1/16/16 - Updated to reflect recent ST IDE nomenclature changes and v2 SmartThings Phone App image. Just a heads up - The current Arduino IDE 1.6.6 has a bug in it which throws a compiler error (invalid namespace) when trying to build ST\_Anything. Please continue to use v1.6.5 until 1.6.7 is released. You can use the latest “Hourly Build” of the 1.6.7 IDE as well, since I have confirmed the bug has been fixed in that version, as of 11/28/15. I am happy to share with the SmartThings Community a project that my son and I have been working on for the past two weeks - ST\_Anything! Our goal was to make it as easy as possible for anyone with some Arduino hardware/software skills to be able to get a new “Device” up and running in a matter of minutes versus hours/days. We have implemented many…

Also see the pressure mat topic. There’s discussion there on connecting contacts sensors to other devices.

> [@United security pressure mat](https://community.smartthings.com/t/united-security-pressure-mat/12101):
>
> Hi folks - has anyone tried to connect and make work the United Securities z-wave pressure mat? I would like to use this to send me a txt when someone is standing at my front door and to turn on the light when we walk downstairs. Our stairs are in the middle of our house so a motion sensor won’t work without creating a bunch of false alarms. Ken

---

<div class="post-metadata">

**Author:** ![djtucker](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/djtucker/32/23621_2.png) [@djtucker](https://community.smartthings.com/u/djtucker)\
**Post date:** [October 7, 2015, 4:50pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/3 "2015-10-07T16:50:47Z")

</div>

Thanks @JDRoberts for those ideas. Unfortunately I cannot source any of those products in the UK…I will try and edit my original post to show I am in UK. Cheers

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 7, 2015, 5:01pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/4 "2015-10-07T17:01:22Z")

</div>

I believe the Thingshield uses zigbee, it should be the same for all countries unless you can’t get compatible Arduinos.

---

<div class="post-metadata">

**Author:** ![djtucker](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/djtucker/32/23621_2.png) [@djtucker](https://community.smartthings.com/u/djtucker)\
**Post date:** [October 7, 2015, 5:26pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/5 "2015-10-07T17:26:52Z")

</div>

No problem getting Arduinos, and yes zigbee would be fine…but Samsung does not ship Thingshield to UK. One guy on UK eBay is trying to sell one for $100 !

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 7, 2015, 5:38pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/6 "2015-10-07T17:38:15Z")

</div>

> [@djtucker](#):
>
> No problem getting Arduinos, and yes zigbee would be fine…but Samsung does not ship Thingshield to UK. One guy on UK eBay is trying to sell one for $100 !

Yikes! Must have some “no export” technology, then, some of the encryption technology falls into that. Or it may be boosted zigbee. That does make it more challenging.

Perhaps check with some of the maker groups in the UK to see what they use for Zigbee or Z wave communication. Zigbee needs to use the zigbee home automation protocol, 1.2, usually abbreviated ZHA 1.2

You could also check with robotics groups, but they’re more likely to use the zigbee green energy profile, which is not compatible with SmartThings.

Based on something someone else said earlier today, mysensors might be a European option, but no one is written an interface yet so you’d have a pretty big project. The people in the thingshield topic could probably help.

> **[Home | MySensors - Create your own Connected Home Experience](https://www.mysensors.org/)**
>
> Do It Yourself, Internet of Things

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [October 9, 2015, 12:14am UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/7 "2015-10-09T00:14:22Z")

</div>

@djtucker @JDRoberts,

I used an Ecolink zwave sensor and a tiny microswitch that I mounted inside the lock itself. I also created a device type for it as well. Needs a little cleaning up, but it works:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/5/1/51c94d9b0bef192ebf21f0be49e10a88b8caa255.jpg)

 ![](https://global.discourse-cdn.com/smartthings/original/3X/4/f/4f813b9bf71f6c310e0dc218cc388bd98bfa57e1.jpg)

 ![](https://global.discourse-cdn.com/smartthings/original/3X/5/a/5ab69930344f00bdf233d8061542bf4246aa68d5.png)

---

<div class="post-metadata">

**Author:** ![shashvat](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@shashvat](https://community.smartthings.com/u/shashvat)\
**Post date:** [September 7, 2016, 4:15pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/8 "2016-09-07T16:15:48Z")

</div>

John - I really liked your solution for checking if the door is locked - do you have any further pictures/tips on how I could go about making this? Would most sensors work this way? I’m good with prying open electronics and soldering wires and hope to engineer something like this as well.

---

<div class="post-metadata">

**Author:** ![kevin](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/kevin/32/142294_2.png) [@kevin](https://community.smartthings.com/u/kevin)\
**Post date:** [September 7, 2016, 4:55pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/9 "2016-09-07T16:55:52Z")

</div>

@shashvat - GoControl WADWAZ-1 sensors (and Ecolink?) have internal screw terminals so you don’t have to do any soldering in the sensor. I had some wired contact sensors with my previous home automation system and used those rather than mounting the GoControl

@johnconstantelo - That is really slick! Could one sensor be used with magnet on door frame AND using the internal contacts for the lock as you did? Does/can the DTH report both separately? I thought about attaching magnet to my sliding door “bar” (1" dowel rod) to make sure it was in place since the “locks” on sliding doors are pretty much useless. Its pretty easy to shake the door up and down to unlock them (on cheap/older ones anyway).

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [September 7, 2016, 10:57pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/10 "2016-09-07T22:57:42Z")

</div>

> [@shashvat](#):
>
> do you have any further pictures/tips on how I could go about making this? Would most sensors work this way?

Thanks @shashvat. Those are the only 2 pictures I took, but they are big and you can zoom in to see a lot of detail. Click on the picture, and then click on it again to see it in it’s original size.

Here are some tips on doing this with a microswitch:

- Use a thin and small microswitch like the one I used from Radioshack so that it fits within the turn knob’s housing. Take the housing with you if needed to make sure. Notice in the second picture where I had to use a plastic spacer to make sure the switch made good contact on the barrel.

- Rotate the knob all the way to the locked position and tape it that position so it doesn’t move on you while placing the switch and the high tech piece of toothpick on the barrel. 😉

- Hot melt glue is awesome for a little project like this. Be careful not to get glue by the switch’s hinge or button. You want smooth operation.

- Give yourself plenty of wire to work with, and don’t go too thin. You can accidentally cut the wires if you put the housing back on too tight. The extra wire you give yourself can easily be tucked away.

As @kevin said, the sensors that work best are the ones with screw terminals inside. The sensors I know of like that are Monoprice, GoControl, Ecolink, and Schlage. You could use something like an Iris sensor by soldering wires too where the reed sensor is, but that’s a lot of work in my opinion.

> [@kevin](#):
>
> That is really slick! Could one sensor be used with magnet on door frame AND using the internal contacts for the lock as you did? Does/can the DTH report both separately?

I believe there was a question about that somewhere in the Community in another discussion, and the answer was yes you can, and yes regarding the DH. Let me do some searching and I’ll post back the link as soon as I find it. Be right back…

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [September 7, 2016, 11:34pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/11 "2016-09-07T23:34:34Z")

</div>

> [@kevin](#):
>
> Could one sensor be used with magnet on door frame AND using the internal contacts for the lock as you did? Does/can the DTH report both separately?

Found it! Sounds like the GoControl Contact Sensor may be the one to use.

> [@\[OBSOLETE\] GoControl Door/Window Sensor, Motion Sensor, and Siren DTH](https://community.smartthings.com/t/release-gocontrol-door-window-sensor-motion-sensor-and-siren-dth/50728/1):
>
> GoControl Contact Sensor v1.10 WARNING: This update may temporarily cause the primary tile to display the wrong state. It will correct itself the next time the device wakes up or you can force it to immediately correct itself by opening the settings and tapping Done. The values of the capabilities that other SmartApps use are not effected. Changes: New setting that allows you to display the main tile as a garage door sensor. Removed the ability to manually change the icon because when that’s enabled the Android app is unable to display different icons for open vs closed. I’m not sure if that problem effects the iOS app. Improved Health Check integration which should reduce the number of false offline statuses. Due to the way SmartThings implemented the Health Check feature t…

I have a few of the Monoprice ones,so I may have to try this out for fun.

---

<div class="post-metadata">

**Author:** ![ana0001](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@ana0001](https://community.smartthings.com/u/ana0001)\
**Post date:** [February 7, 2018, 4:53pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/12 "2018-02-07T16:53:32Z")

</div>

Hello! I’m taking a subject of entrepreneurship and we have to present an idea to put in the market. My group thought about a keychain with a little light that warns us if we locked our front door or forgot. In case we forgot, the red light of the keychain will light up. Otherwise the light will be green.  
We don’t have a deep understanding of electronics, but from what I searched I think the best way to do this would be with a piezoelectric sensor installed in the lock, so that when the door latch goes into the cavity, the sensor will be activated. I probably also need a arduino, right? To receive the information of the sensor.  
My question is: what else do I need to send that information to the keychain? How can that be done?

What are the main components to do something like this?

If anyone could explain me just the basics, it would be a big help already.  
Thanks.

---

<div class="post-metadata">

**Author:** ![ana0001](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@ana0001](https://community.smartthings.com/u/ana0001)\
**Post date:** [February 7, 2018, 4:54pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/13 "2018-02-07T16:54:15Z")

</div>

Hello! I’m taking a subject of entrepreneurship and we have to present an idea to put in the market. My group thought about a keychain with a little light that warns us if we locked our front door or forgot. In case we forgot, the red light of the keychain will light up. Otherwise the light will be green.  
We don’t have a deep understanding of electronics, but from what I searched I think the best way to do this would be with a piezoelectric sensor installed in the lock, so that when the door latch goes into the cavity, the sensor will be activated. I probably also need a arduino, right? To receive the information of the sensor.  
My question is: what else do I need to send that information to the keychain? How can that be done?

What are the main components to do something like this?

If anyone could explain me just the basics, it would be a big help already.  
Thanks.

---

<div class="post-metadata">

**Author:** ![SmartHomePrimer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/smarthomeprimer/32/86542_2.png) [@SmartHomePrimer](https://community.smartthings.com/u/SmartHomePrimer)\
**Post date:** [February 7, 2018, 6:09pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/14 "2018-02-07T18:09:56Z")

</div>

NYCE sensors have been working on a way to do this, but have not released a product to date. A hub or bridge in between will be required to translate the communication type of the sensor to internet protocol. Examples are Bluetooth to IP, Zigbee to IP and Z-Wave to IP. A keychain is an idea that might have been better accepted some years ago, but with pretty much everyone in the world now caring a smartphone and home automation on track to be embedded in TV, set top boxes, kitchen appliances and voice assistants, the preferred notification device will be via smartphone.

The current sensors available from NYCE could be modified to sense a door has lock and they’re some of the smallest available with Zigbee radios built-in.

[http://nycesensors.com/products/](http://nycesensors.com/products/)

There’s also a very small Z-Wave radio sensor called Strips. This video could show how a product like this could be made to react with the bolt of a lock interfering in the path of the sensor to indicate door locked/unlocked.

---

<div class="post-metadata">

**Author:** ![Michele\_Mike\_Vincigu](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/michele_mike_vincigu/32/183942_2.png) [@Michele\_Mike\_Vincigu](https://community.smartthings.com/u/Michele_Mike_Vincigu)\
**Post date:** [February 26, 2018, 2:26pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/15 "2018-02-26T14:26:32Z")

</div>

Hi there

I made something similar to this after seeing your post. I was using a Xiaomi door sensor.  
The only hick-up I have is being able to edit the DH to make it say Lock and Unlocked instead of Open and Closed. I thought I could just take the door and change the Labels but it doesn’t seem that simple.

Any idea are appreciated.

Thanks  
-mike

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [February 26, 2018, 7:02pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/16 "2018-02-26T19:02:18Z")

</div>

Point me to the DTH you’re using and I can help.

---

<div class="post-metadata">

**Author:** ![mebejedi](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mebejedi](https://community.smartthings.com/u/mebejedi)\
**Post date:** [December 16, 2019, 5:26pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/17 "2019-12-16T17:26:27Z")

</div>

OK…so I figured out a way to do this. After reading lots of threads about reed switches, microswitches, and pressure sensors (some of which are scattered on my desk right now) and trying to figure out where to place these various things…it occured to me:

I just need a metal contact to close the loop. Isn’t my deadbolt made of metal?

So, I decided to make my deadbolt the switch:

1. I had a slim piece of wood (picking numbers at a Christmas party), which I drilled tiny holes through with a tiny screwdriver. I was using wires from a phone cord, which were very tiny (I didn’t want big holes in the wall.)  

2. I drilled an angled hole from the outside of the doorframe to the deadbolt hole, ran the wires through the hole, and threaded my wood base.

 ![02](https://global.discourse-cdn.com/smartthings/original/3X/2/9/29b163cf548d36f90efeeeaec419650fabd36525.jpeg) ![03](https://global.discourse-cdn.com/smartthings/original/3X/1/0/1073e17c218476ff097920fce2ff2c95381758d9.jpeg)

1. I then stripped a considerable amount of wire and wrapped it around the base.

 ![04](https://global.discourse-cdn.com/smartthings/original/3X/5/2/521a95bb02cd21bd33197e07facea4cfe67330e3.jpeg) ![05](https://global.discourse-cdn.com/smartthings/original/3X/b/8/b89c75e390a2a077c39a7d08e5ac5ce2a242c4c5.jpeg)

1. While this went in perfectly, there was no contact. I figured I could put something behind the wood base, but I had an old wire run with a thick neutral wire, so I cut off two pieces and wrapped those around the existing wire and wood base. (Protip - be sure to cut yourself when stripping the wire. The Home Improvement Gods still demand a blood sacrifice. It would explain why my project didn’t work the first time.)

 ![06](https://global.discourse-cdn.com/smartthings/original/3X/a/c/ac9ab01cd9181b5ebf09ea2c6f3822b2f6b0bc84.jpeg) ![07](https://global.discourse-cdn.com/smartthings/original/3X/2/9/29a5af4ac3eba594303cc4818b4c85955e7f3c01.jpeg)

Be careful for any stray wires. My app kept reading “Closed” until I finally saw this.

 ![08](https://global.discourse-cdn.com/smartthings/original/3X/5/5/55dbe976fcc8c8fc955db36770526af8c9607102.jpeg)

1. Carefully pull the wood base to the back of the deadbolt hole, and try your deadbolt. Voila!

 ![09](https://global.discourse-cdn.com/smartthings/original/3X/9/e/9e4ea3cac305e835360a0dd0fd0bdc51ee6af471.jpeg) ![11](https://global.discourse-cdn.com/smartthings/original/3X/0/8/0881e417cdc31a3a2ff31cb0a22cbd7720e3ca88.jpeg) ![12](https://global.discourse-cdn.com/smartthings/original/3X/8/6/8674a8f42a0a88c11a7f1ac5199e04ac2b0f99a2.jpeg)

Now…I’ve got to do this to my garage entry door…

---

<div class="post-metadata">

**Author:** ![rontalley](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@rontalley](https://community.smartthings.com/u/rontalley)\
**Post date:** [December 16, 2019, 6:29pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/18 "2019-12-16T18:29:41Z")

</div>

Very creative! I just use SmartLocks. Figured not only will they report lock/unlock status, but can also lock/unlock without having to physically do it.

If door remains unlocked for 30 minutes  
And  
Door contact hasn’t changed in the last 29 minutes  
Then lock door

If presence sensor arrives  
Then unlock door

If alarm is set  
Then lock door

These rules are inconstant play.

I get it though. SmartLocks are not cheap. 😩

---

<div class="post-metadata">

**Author:** ![mebejedi](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mebejedi](https://community.smartthings.com/u/mebejedi)\
**Post date:** [December 16, 2019, 6:36pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/19 "2019-12-16T18:36:28Z")

</div>

I have a smart lock on my front security door, but didn’t want to put on one my back door (expense was one factor, though.) It’s a Kwikset, and it’s set to lock itself one minute after being unlocked. I won’t trust that to ST.

I just wanted to know if the back door was locked before we left the house. I have a Homeseer 200+ right by my front door, and now the indicator light will blink if the back door is unlocked to remind us to lock it before leaving. Also, I use Echospeaks to tell me when a door is unlocked, open, etc.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [December 16, 2019, 6:43pm UTC](https://community.smartthings.com/t/home-made-door-lock-sensor/25354/20 "2019-12-16T18:43:27Z")

</div>

I’m confused. Are you running current through those wires? If so, that’s a heck of a fire hazard to put inside your wall. Just sayin’… 😱 🚨 🚒 🚑

[Next page](https://community.smartthings.com/t/home-made-door-lock-sensor/25354.md?page=2)
