Detecting Euro Lock Cylinder Status

So for a while I’ve been thinking it would be really nice to know the status of my door locks, but I don’t have any interest in replacing them all with ‘Smart’ door locks, since they are too expensive and I’m not convinced of the security…

I have come up with an idea which will hopefully provide a way to detect lock status of a traditional door lock (if it works :slight_smile:)
My doors have nothing that protrudes out of the door when the key is turned, so the only way seems to be detecting the lock cylinder rotation and going from there…

Here is my idea… i’m keen to hear what people think, and any suggestions on how it may be improved.

Capture

I’ve designed the 3d print above to fit over the lower part of the door lock (that image is the back of it, so you can see the internals).
The idea being that the curved edge at the top fits against the lower rim of the euro cylinder.
The blue ball is a metal ball bearing and the red U shape is basically a channel for the ball to move in, with a dip at each end for the ball to rest into.

Next I’d fit a small magnet to the rotating part of the euro cylinder (ie, the red dot in the image above).

Now the hope is, that when you turn the key in the lock, the magnet picks up the ball bearing and moves it to one end of the channel as the key is rotated, inside the channel i’ll have some kind of conductor that is shorted by the ball bearing, which is simply wired up to a Xiaomi door sensor PCB.

The the key is rotated clockwise to lock the door, the ball bearing gets transferred to the left side of the channel and makes the circuit - showing the door as locked.
Rotate the key the other way and it moves the ball to the right, and the circuit is now open, so the door shows as unlocked.

I have got around to testing this theory out yet, and I’m getting it would require some tuning of the magnet position to reliably detect… but i’d like to get peoples thoughts on the idea.
Has anyone come up with anything better, or has any suggestions to improve?

My thought is that it is very small and fiddly, and might take a number of iterations of 3d printing to get it working smoothly.

And the other point is that perhaps the magnet can run a small reed switch itself (such as the Xiaomi one).

there are a few ideas on this thread:

Thanks for the comments.
Indeed the moving parts are quite small (ball bearing is 2mm) but printing the whole thing is only 25mins, so no major drama.
I initially thought about a reed switch, but the problem is the magnet would only activate the reed switch if the lock was rotated to a certain position - once the door is locked it’s possible to rotate the key another 160 degrees or so… i think this would move the magnet far enough away to stop detection.

@lolouk44 Thanks, I initially did have a read through that thread for inspiration, but it seems solutions there are for doors that have some kind of physical contact method (like something that comes out of the door) when its locked.

I did a similar thing but with a much larger lock, so there was much more room to play with. I will be interested to see your final result with such a small lock.

p.s. This is what I did with a Lockwood 001 lock
https://www.inspectmygadgets.com/a-diy-semi-smart-lockwood-lock/

1 Like

Thanks, that’s a nice little setup.

I’m now wondering if I could make use of multiple magnets positioned around the lock to trigger a reed switch… will need to do some testing later on :slight_smile:

how does the door lock into the frame?
I have fitted a micro switch into the keep on the frame where one of the bolts enters the frame.

Unfortunately that won’t work for my doors - they are all multipoint locks, so there are hooks which go into the door frame when you lift the door handle, then you can turn the key to stop the door handle being pushed down to pull the hooks back into the door.

The handle can be lifted and the hooks set into the frame without needing to turn the key (which effectively means the door isn’t locked… since it’ll open if anyone presses down on the handle).

Very interesting. Did anything come of this? I’m thinking of gluing a magnet to the rotating part of the lock. I would then use a aqara door sensor that would track how many times the cylinder has been rotated. It needs to rotate twice to lock or unlock.

Unfortunately I haven’t progressed this any further, after some playing around I realised that the euro lock is basically split in the middle, so turning the key on the other side of the door doesn’t turn the cylinder on the opposite side.
This would mean having to detect on both sides of the door, or having unreliable info (since it would only detect locking from the inside of the house for example).

I’m now looking at placing a small 3D printed shim inside the door, with one of these: https://www.ebay.co.uk/itm/DC5V-10mA-9x5-5x2mm-TV-DVD-EVD-Door-Detection-Micro-Switch-5Pcs/183739587538 attached to the end of it to try sense when the actual lock mechanism inside the door moves… currently awaiting delivery of the switches from China :slight_smile:

Edit - Also thought of what you are considering, but apart from the above issue, you also have no way of detecting rotation direction.
Eg. Rotate the key right to start locking, pass the trigger point of the magnet and you have 1 count, then rotate the key back the other way and you have pass 2… the system now thinks the door is locked, but actually nothing has changed.

Good point about the rotation direction. Ok I removed my lock from the door today and discovered there is a little plate that moves when you lock the door. So i’ve soldered a small rod to the mechanism that acts as an actuator. Next step is how to connect to a microswitch / sensor

I found a little time over the weekend to look at possible solutions and came up with something that is working reliably so far.

First I removed the mechanism from the door and noticed that the back part of the lock has an opening - inside this opening is the back of the part which moves when the lock engages.
I used some epoxy to stick a small magnet to that part, and then took a small (2mm dia) reed switch and put it inside some heatshrink with some 30awg wire running from it to a Xiaomi door sensor.

Detection works perfectly - so far I’m really happy with it… just another 3 doors to do! :stuck_out_tongue:

5 Likes

Hi,

Apologies for opening an old thread, I have the same doors as you and have been looking for a way to monitor the lock ‘state’ also.

I really like your solution! Are you still using the setup posted above? Has it held up? Is there anything you would do differently?

Also have you used the key hole to feed the two cables out?

Thanks,

Hass

Hey,

Yes still using this on my 3 external doors, all working OK.
I routed the cable through the cut out for the key part of the lock - if your lock is like mine you can remove the two screws for the handle and the lock barrel remains in the door, then pass the pcb through the cutout for the key and screw everything back on.
On one of my other doors I exited the cable straight out of the bottom of the handle and fitted the door sensor below which looks cleaner.
Tips if you do attempt this, use some good epoxy to secure the reed switch to the back of the lock so that it doesn’t move when refitting.
And if you have a metal door consider if you can route the cable to position the sensor elsewhere (my metal bifold door seems to heavily reduce the ZigBee signal)