Introduction: Add an IOT Lock to ANY Drawer!
Hello! After quite a while I decided to share my latest project with all of you. This one was just an idea that I got after purchasing a cheap solenoid lock online, and it turned out to be a great project.
So, basically the base idea was to make a secure (or at least secure-ish) spot for my stuff while I'm gone, or just a place to store stuff I don't want to misplace. I was originally thinking of maybe embedding some sort of RFID setup but I thought to myself: "Hey, you know what would be sick and unnecessary? Making the frickin' lock IOT!". So that is pretty much what I ended up doing. A 12V solenoid lock, an ESP8266, a relay, a stepdown module and quite a few wires. That is really it for this project, because I just wanted a quick and simple solution. I also kinda wanted to add an LED strip inside of the drawer but i then dropped the idea, as it would require another relay and also wasn't necessary at all considering I could already see inside the drawer without having a light source inside. But who knows, maybe I'll upgrade my drawer someday in the future and if I will see the need for a light inside, I might just add it. If you are planning on setting this up in a dark room, maybe you'll want to include a LED strip or maybe just a few diodes inside, so feel free to upgrade, however keep in mind that it will require a bit of extra soldering as well as a tiny bit more software changes, however those are super easy to do (will be explained later, don't worry :D).
Right, now that you're all familiar with what we're going to be making, let's get to it!
Very little is needed (as usual :D)
ESP8266 - The brains
Lock - Well, the lock
Adapter - You need 12V for the lock, 1A is fine
Relay - To control the lock
Wires - Connect the stuff, bro
Stepdown - To get that voltage down for the ESP
Soldering iron - I didn't link because I believe everyone reading this has at least one already
A drill - To drill :O
Hot glue gun - Pretty optional, just to secure the circuit inside, but you can just use tape or something if you wish
A drawer or door or whatever you want to lock - That's pretty self explanatory
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Connecting the Circuit
If you have everything ready, you can start putting together the circuit.
Basically it's ADAPTER -> STEPDOWN and RELAY -> ESP8266 -> RELAY -> LOCK
Here is a schematic to help you understand.
Note that the DC barrel on the drawing symbolises the 12V in.
Step 2: IOT! (Via Blynk)
If your circuit is done and everything works, it's time to get to programming it! Don't worry however as this is the easy part, thanks to Blynk!
Blynk is a really cool app that pretty much makes everything IOT super simple to set up, with literally requiring you to only edit 3 words in the code! Those words are your Authentication Token, WiFi name and password. Dead simple, tons of instructions for setting up Blynk online, so I won't go over that here, but if you do have any questions, just comment and I will try to answer them as well as I can.
So after you edited the script and uploaded it to your ESP8266 (or you can really use any WiFi board you like) it is time to check it and program the open/close button. In my schematic I used the D7 pin but if any other pin is more convenient for you, you can simply set that up using the Blynk app on your phone.
The app setup itself is very straightforward and all you need is one button to activate the relay. Blynk also has a feature where the app gives you a notification when your device goes offline, so I added that as well. It's literally just drag and drop.
Those screenshots are of my app, but feel free to adjust yours to your liking.
Step 3: The Installation
You're almost there, after checking your circuit, isolating the wires properly and testing out the app, you can finish this simple project and make your lock useful!
If by now you haven't chosen the door/drawer to lock, now is the time to do so.
The lock has screw holes for convenient mounting, so I just used those. Just take some nice long screws and after marking and pre-drilling your holes, just screw it in and trust me, it's not going anywhere.
Since we soldered the circuit together, the possibility of wires ripping out and locking you out is minimalised and therefore just putting hot glue on the ESP and relay and mounting them to the door/drawer that way is completely fine. By the way, if your circuit is on a prototype PCB, it will make the glueing process a lot simpler, and the result will look cleaner, if that is what you care about.
You might need to add an extra hole for the 12V DC power in. If you do, you're gonna need to resolder the 2 wires, but that takes just a minute. In my case I did have to make a hole for the wires, and I also found the
Also it should be noted that in my case I had to cut a little piece of wood that I drilled to the top of the drawer, so that the lock would have something to latch on to.
Step 4: The Conclusion
And there you have it, now you have an IOT lockable drawer!
Here is a video of mine, as you can see you can move the drawer a bit but not enough so that you can see what's inside. This is because of the wooden latch position, I had to mount it a little bit back so that the opening and closing actions would be smooth :D.
If you enjoyed my Instructable, please consider liking it and these are the kind of projects that I usually make, so if you are really interested, you can follow me!
As always, any questions are welcome in the comments, I will do my best to answer them as well as I can.
With that, I think we're really done. See y'all next time, so until, then, bye!