WiFi Your Door Lock With An ESP

The Internet of Things is upon us, and with that comes a deluge of smart cameras, smart home monitors, and smart home locks. There actually aren’t many smarts in these smart conveniences, and you can easily build your own. That’s what [MakerMan] did with some off-the-shelf parts and just a little bit of code. Now he can open his door with WiFi, and it’s a nice clean build.

The build process began by first removing the existing barrel bolt on the door. This was replaced by a deadbolt that also had some really neat solenoids inside for remote activation. This was mounted to the door in a way that the door could lock, with a minimal amount of damage from some skillful hacksaw work. The only thing left to do after this was add some electronics and brains to the lock.

For this, [MakerMan] added a button and LED to the outside of the door. Some of these wires were fed into the lock mechanism, with a few more run over to a project enclosure mounted next to a power outlet. The project enclosure holds an ESP-8266, power regulator, and relay board, and the ESP is running code that instantiates a web server that will unlock the door with a few clicks on a web page.

Sure, it’s probably not the most secure lock on the planet, and the 5V linear regulator is held on to the relay board with hot glue, but this is an exceptionally well-documented project, and all the code is available in an archive.

18 thoughts on “WiFi Your Door Lock With An ESP

  1. “The Internet of Things is upon us, and with that comes a deluge of smart cameras, smart home monitors, and smart home locks. ”

    WiFi people and complete the “smart” circle.

  2. how long till it becomes worthwhile to capture traffic on people’s wifi’s to open their locks?

    i mean, how long before enough people have stuff like this that it can be reasonable expected for a thief’s chance of gaining entry to be some probability of success, times the expected amount of cash value for goods stolen, divided by the time spent to be a worthwhile thing to consider?

    not that i’d want to do it, but theft is a business too, and the same opportunity vs cost vs payback calculations apply….

    1. Well on top of this, given this is a home built solution, I’d personally want to add another layer of encryption on top for the application, and make it time release asymmetric encryption, kind of like bank pin-sentry machines.
      Obviously this’ll require a little more coding on the lock *and* on the phone, so a web based app is probably out. Likewise it’ll have to be a custom built side-loaded app that NEVER hits any appstores.
      A lot of work but well worth it for peace of mind.

    2. here is the thing, cracking a wireless lock is automatically less risk than a physical lock, it doesn’t require someone to actually be in front of the lock trying to crack it. Combine that with the fact that the cops always catch the dumb criminals first and i would hypothesize that these kinds of break ins are already happening out there in the world. It might not be a wide spread thing due to the technical learning curve but it is definitely something concerning.

      The real issue to think of is that it is easy to notice a broken window or kicked in door but when one of these locks is cracked then the homeowner might not even know about the break in until several days later, covering up any evidence that may have been left behind. After-all, who goes through their house every day to check on all of their possessions when they think that their house is secure and smart thieves always case the target first so that they know what to grab as well as the best time to do so.

      1. To further your point Mike, also consider that your home insurance may not pay out for any stolen possessions. Without some form of evidence like a broken window or forced lock it’s only the claimants word that someone entered your house without permission and took something. Even if you had concrete evidence they may still refuse to payout as the lock the thieves gained access through is not from an approved manufacturer – If anyone is planing to make and install a lock like this I would definitely recommend they contact their insurance company and get in writing that they will still payout even if access is gained through your home made lock.

  3. I guess if the power goes off, is the door locked by default.

    You’re also stumped if you lost/forgot your phone or it has no battery, Enjoyed the vid though – thank you.

    1. Over-complicating a simple process. Besides the power issue, which is valid, I’ll bet it takes longer too. First you have to unlock your phone (unless you are one of those that holds on to it constantly), start the app, push unlock.

      No thank you, my little unpowered key works just fine, and is very compact.

  4. Hmm, this sort of issues crops up often in vague terms occured to me a little while ago with fixes to all the above problems/exceptions (so far) so a genuine access be accepted without negative repercussions. I’m still in process of looking at the IP for that and few variations bit messy but, at first glance feasible – which raises the question of a suitable commercial partner with terms of reference short to long term, how to manage the harder tech/production/financing part and what sort of exit position be most appropriate/profitable…Cheers

  5. This is so ugly, power hungry, and insecure….

    Use an esp32, or board with low power bluetooth + a servo controller + servo. Use your original barrel lock, but embed all components into the core of the door. You’ll need to dig out a cavity. Run the power inside the bottom of the door or between the windows. You could also imbed a battery pack depending on the power draw, frequency of use, and ease of recharging.

    Mechanically couple the servo to the lock mechanism, and have the board power up and check for your phone every few seconds. Servo position 1 is unlocked. Position 2 is locked. Inbetween motions, the servo is unpowered. All components should fit in a 2″x1″x0.5″ cavity. Use one of the apps out there or create your own to control the board over Bluetooth, and now you can unlock the door whenever you are nearby. When you are not, the device sits idle for the most part, scanning every few seconds for your phone. Bonus, your house key still works.

  6. The most problematic part of that video for my area is the breaking of the weather seal. There would definitely be a puddle on the other side of that push button and LED.

  7. This is a topic I have been circling for a few years without a real solution..
    It is easy as hell to lock a door via whatever + MQTT, but then take into consideration these two requirements:
    1. It _has_ to have a physical fail safe such as a key in case the power is out
    2. It must be de-energized in both the locked and unlocked position, so a servo actuation or other, but not a solenoid is needed.
    (3. it must be made from off the shelf parts)

    I’ve thought about an actuation that is mounted on the original barrel lock, that can be overridden/overpowered by the turn of a key, but the idea often becomes unnecessarily complex.

  8. Before any of this is done, we need a SECURE method of communication between devices.
    SSL Cert on house devices and device level certs so your phone works, neighbors won’t.
    No ONLINE services should be involved. No IFTTT, no cloud anything other than backup video storage for monitoring.

    The IoT is very easy to use — but it comes with many risks.
    * Security (usually lacking in reality)
    * Service longevity — Think about how many devices/services have come and gone, even pay ones. Do you really want a device that your use of is completely controlled by the fiscal wisdom of some random CEO with a golden parachute or by some idealist that can’ support financial or physically the infrastructure for the device/code.

    For truly long term usable Iot devices, all the supporting code/services need to be LOCAL. The only part that should be “I” is the access — and that is only if truly needed.

    Door lock as example.
    Local Wifi/Bluetooth communication to lock and unlock.
    Automatic re-lock on close after timer (long enough to prevent lockout from running to get paper etc – maybe 5 min)
    Internet status report to secured device, not random website without at least 2 factor authentication.
    Internet video/audio (like ring doorbell) but without vendor specific site requirement.
    Data logging to a locked box with health status sent to insurance company – (audit trail) Insurance company gets notice of status of logger no data over internet. Used during dispute of breakin if needed (video footage /timecode etc)

    Without doing it this way, we will always be at someone else’s mercy.
    Free from $ to implement does not mean a real world free device if you’ve lost control of it instantly.

Leave a Reply to Barefoot Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.