How to Make a Smartphone Connected Door Lock

, , , , , , , , , , , , , , , , , , , , , , ,

Post navigation

100 thoughts on “How to Make a Smartphone Connected Door Lock

  1. Wow! That's an awesome video! Thanks for using Blynk.

    By the way, if you'd like to share the access to the lock – you can use the Sharing Functionality. In this case you won't need to give others your email and password.

    http://docs.blynk.cc/#sharing-shared-access-to-your-hardware

  2. I am trying to do this project for a school project but when ever I type in the code to test if it works I get this error:
    /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/bindings/bindings.js:91
    throw err
    ^

    Error: Could not locate the bindings file. Tried:
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/build/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/build/Debug/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/build/Release/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/out/Debug/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/Debug/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/out/Release/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/Release/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/build/default/pigpio.node
    → /home/pi/Smartphone-Doorlock/node_modules/pigpio/compiled/9.3.0/linux/arm/pigpio.node
    at bindings (/home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/pi/Smartphone-Doorlock/node_modules/pigpio/pigpio.js:5:31)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/Smartphone-Doorlock/doorlock.js:47:12)

    Do you know what I should do to fix this?

  3. I'm getting an error when I try to run 'sudo node /path/doorlock.js' (obviously I replace path). I checked to make sure all the dependencies were installed correctly (they did). The error message thrown is '/path/node_modules/pigpio/node_modules/bindings/bindings.js:91
    throw err
    ^

    Error: Could not locate the bindings file. Tried:
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/build/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/build/Debug/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/build/Release/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/out/Debug/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/Debug/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/out/Release/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/Release/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/build/default/pigpio.node
    → /home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/compiled/6.12.3/linux/arm/pigpio.node
    at bindings (/home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/pi/Downloads/Smartphone-Doorlock-master/node_modules/pigpio/pigpio.js:5:31)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/Downloads/Smartphone-Doorlock-master/doorlock.js:46:30)"
    My interpretation is that it is not creating the nodes so I reinstalled the latest recommended C compiler which yielded an identical error. Any advice is appreciated. I'm a veteran user so I just need a solution. Also just in case anyone else was having the issues. I had trouble installing npm on/off for some reason, and had to cd into the troublesome directory and sudo chown root:root * that sucker which fixed it nicely. Thanks in advance!

    Edit: I checked and pigpio's C library was installed correctly in /usr/share and I think some other places. I believe there must have been a version change which broke your code. Unfortunately I don't know javascript so I cannot help you.

  4. Could you add another button on the case that is programmed to lock or unlock the door depending on which state it is in?
    I don't know too much about this kind of stuff but for sure want to learn about it. The servo is it always in one place until told to be moved or can it be freely turned as you want but moves when it is told to? If it can be moved freely an opening could be made on the casing so you could reach a finger in a turn the lock physically right? Also, does the servo keep track of how much it has turned or is it just a motor that moves when it is told?
    I would love to learn about this so if you have any knowledge to share please do so! Thanks.

  5. Hi guys, i have recently bought my raspberry pi 3 but when i use this tutorial i get the following code after trying to start doorlock program,

    [email protected]:~/code/Smartphone-Doorlock $ sudo node doorlock.js
    /home/pi/code/Smartphone-Doorlock/doorlock.js:40
    var blynkToken = '042336f74eb64113b4e1e00d40eaded7':
    ^

    SyntaxError: Unexpected token :
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

    It would be greatly appreciated if someone can help me with this!!!

  6. You should be able to design it so you can use the servo and the key to open and close the lock. You just need to have a slack between the servo and the lock turn. Like let the servo lock with a fork on the original manual lock turn.

  7. i faced an issue , the lock was working perfectly earlier, but now the state of motor is 1.0 or 0.0 and the motor is not working . Although it's working for simple interfacing with R-pi code.

  8. I keep getting the error "could not locate bindings file" when running the program with "sudo node doorlock.js"
    do you know what might be wrong?

  9. Would be good if you could manually override your servo if you need to enter with a key in case your internet is out

  10. how can i running at startup? i have follow all the instruction but everytime i power on my raspberry in blynk it says offline, i must run it on terminal every single time. or do i used to run it on terminal every time? thanks

  11. Guys, I just stumbled onto your site today. You two rock! This is a GREAT site. I am pretty obsessed with home automation and seeing what home users can accomplish. I love that you guys are giving us great tools and the projects are in stable shape. Seriously making them pretty and hiding wires and painting cables.. I would rather we do that and you guys concentrate on the bones and muscle of the projects. (I am just putting that in cause amazed when people are complaining about "I see wires!!!!". They should know how to hide a wire!) I am looking back now at your project list for fun cool ideas! you ROCK!

  12. Since you already have raspberry pi , you can install https://github.com/KhaosT/HAP-NodeJS into the pi and configure properly so this will be available in you home network and can be accessed by any apple devices.

  13. For doors with not a turning handle on the outside, would it be possible to remove the door knob lock (we call it tongue in my country, I am talking about the thing that closes and opens when you turn the door knob). Remove it or replace it with one that opens and closes with some basic force then have an external lock that has a female insert screwed on the door and a male remote controled piece on the wall that locks the door tightly closed using the app.

    that way you can still use your doors lock system and as a backup and keep that unlocked when you want to remotely open the door by opening the external mechanism.

  14. Thanks. But why would you not combine a 3d printed housing for the Pi as well so it doesn't look like garbage.

  15. Any thoughts on using an HTTP server on NodeMCU rather than a NodeJS on Pi. I'm thinking less complexity, less spaghetti. A magnetic closure sensor would be cool too so that you could also open/close state.

  16. Can u please make a video on temperature control ing using pis controller? It's my final year project if anyone in the comment section knows this please help me

  17. its stupid to use raspberry pi for this. All you need is a simple wifi connected board that does on off and is connected to a smart home hub. takes less space therefore better.

  18. Amazing video, but I was wondering if it’s possible to add Alexa voice recognition to some how control the raspberry pi in order to lock and unlock the door 🙂

  19. Innavations full of image!~ the most difficult task for a a new project is from idea to a real product, …Makerfabs provide maker& startups PCBA prorotyping , to make these project from dream to true..

  20. Just use esp886 and some microcontroller like stm32 still there's a need for a server or computer logged into internet so we can access and that's why we use raspberry. Miss you guys, hopefully you are doing great in your other projects. YouTube isn't enough anymore

  21. That's amazing. Many of Molilock's app controlled door lock can be controlled by an app. I think it meets the need of current customers

  22. To anyone having issue with the install.

    DO NOT FOLLOW THE NODE INSTALL GUIDE THEY SUGGEST.

    Legit don't do it. Just install from apt-get. This allowed me to run the program with no issue.

  23. This looks really nice, but also really dangerous if someone really uses this. Blynk has to get 1 database breach and every door can be unlocked by logging in and yeah, opening the door. It looks fun for other things tho! 🙂

  24. Kits? can you give an SD card with all the tec parts done? So i can just plug and play with my Pie?
    Anyways, awesome vid! I'm doing to a door that's a secret door to a secret room. It'll also be spring loaded so it'll unlock and open. I'm going to put most of this inside the door and connect the wiring inside the wall. Been wondering how to do the lock on this door, so thanks again!

  25. It is possible to connect the App with Alexa or Google Assistant? To Lock and Unlock with Voice Command?

  26. Plastic parts, glue, double sided tape, an overkill controller, that runs 3rd party software and uses unreliable SD card as storage… Wow! There's some high level security for your home… 😉

  27. Can you please make a tutorial on port forwarding the blynk local server on raspberry pi ?
    Thank you in advance.

  28. A couple of suggestions to improve your project: couple the servo with a gear and put a thru shaft. Gear should engage to the shaft on shaft's axial movement (like a car gear box). Put a handle to the back end of the shaft and a spring which would push the shaft towards gear. When someone pushes the handle from inside that would disengage the gear, and you can lock/unlock the door manually by the handle. I hope this makes sense.

Leave a Reply

Your email address will not be published. Required fields are marked *