Ready to put a combination lock on your door to keep out intruders? You've come to the right place! In this i'ble I will show you step by step how to make a combination lock for your door!

Watch this video of the finished product!


What did you make?
Hi, I'm 15, and I made Lockduino! It's a lock that is controlled by 4 potentiometers and a pushbutton. It may also be controlled by IR in the future :?
I just used some perf board, ribbon cable and basic electronics to make it. I got so mad with the perf board (my dremel is very tiny and doesn't cut well) so I brandished my oscillating saw and zzzzzzzip! Whoops! Maybe next time I should be a little more careful ;-).
How did you make it?
Tell us how you got the idea for the project.
We were staying a rental cabin in the mountains for the weekend and I was utterly enthralled by the electronic keypad that you typed in your cabin code to get it. You type in the code and heard, "WRRAANT" and the door popped open. So I decided to make one; modified. Hence I present to you: Lockduino! 
Did you work with anyone else?
Nope. Just me!
Did your plan and ideas change as you worked on the project?

No, not really. I pretty much stuck the same plan the whole time.
Where did you make it?
I made it all in my room on my electronics work table and downstairs by our computer (for programming Arduino).  A lot of running up and down the stairs!
How did the project connect to other activities in your life?
Well, it keeps out my friends when I don't want them in my room, it keeps my stash of equipment safe and sound!
What did you learn?
What I learned was how to properly use if statements with Arduino. It took some time  but I got the hang of it. You can see this thread to see how I was in misunderstanding about how to construct my if statements!

Step 1: Ingredients:

  • Arduino
  • Micro servo
  • Green LED
  • Red LED
  • (2) 350 ohm reistors
  • 10k ohm resistor
  • (4) 10k, 50k, or 100k micro potentiometers (the higher the resistance the better
  • Perf board
  • Momentary pushbutton
  • 2.54 cm. pin headers
  • Insulated jumper wire
  • Heat shrink
  • Ribbon Cable
  • 9v battery and clip
  • 4 AAA battery holder
  • Soldering pencil
  • Tool to cut perf board (I found that the oscillating saw works the best!)
  • Razor blade
  • Wire cutters
  • Wire strippers
  • Needle-nose pliers
  • Electrical tape
  • Helping hands are helpful!
  • Hot glue gun
  • Heat gun
  • Sharpie
  • Paper and pencil
  • Drill with 1/4  bit, and 3/8 bit.
  • Insulated ring terminal
  • Basswood or 1/4 ply
  • Double-sided tape

Important Terms:

  • Block - Any code in between two brackets; for eg. { code here } 'code here' is "in the block."
<p>Interesting project with the Arduino but there are several thing I'd like to point out:</p><p>Well, lets face it: anyone will just keep turning the knobs until they can get in so you could add a variable to count the number of attempts and then lock out once say, 5 attempts were wrong. With an Arduino of course you could have a smartphone app that wirelessly communicates with the Arduino and sends a text message if anyone enters.</p><p>The possibilities are endless.</p><p>Keep posting!</p>
If you'd like to try then have fun breaking in have fun! That's a good idea though! At the time I barely new about electronics so that was all I knew about. I may make a second version. . .
<p>can you please help me.. I followed your connections but my LED lights wont light up and my servo is not functioning properly :( I used this for my elective project..</p>
Did you use a ribbon cable?
yes I used the ribbon cable.. I passed the project but the LED is still not working but the servo works fine :)
<p>I'm glad you passed! Well it's very difficult for me to help you because there are a number of things that can be wrong. Try checking these things:</p><p>1) LEDs are wired correctly, Cathode (shorter lead) to GND, and the </p><p>Anode to the correct pin on the Arduino. </p><p>2) In the sketch make sure which pins the LEDs are supposed to be connected to, then trace your LED connections and see if they go back to the correct pin. </p><p>3) Nothing is shorting out</p><p>4) Bad LEDs</p><p>I'm sorry I can't really help you further, as I cannot see your project. Good luck!</p>
<p>ok.. thanks for the tips :)</p>
Hello! Good day. Can I ask for the schematic diagram of this project (Arduino Combination Door Lock: Lockduino). Can you please send it to my email, lovelyjoy767@gmail.com. Thanks!
Hey! I just realized that I haven't made a schematic would you please give me a couple of day since I'm busy. I need to make one anyways.
I am tired and I didn't read much (and am currently unable to view the comment on this i'ble) so I don't know if you mentioned whether it would be possible to change the code or not... Otherwise, I am 100% impressed by this creation.
Ok! I clearly gave instructions on how to make the code and change it! Maybe you should have a nice, long rest, then come back after a cup of coffe and read it again :). I hope you can understand it.
i took apart my comuter and found a cable labled "FD" connected to the floppy disc drive<br/><br/>the computer is still working
I have built this, but i get a &quot;error compiling&quot; . <br>If I remove all the code for the servo it works fine. Any suggestions?
Have you installed your Arduino(I think you only need to do this with the Mega 2560 and ADK) correctly? You can do this by (windows) going to device manager and right clicking the unknown device and click update driver software. Then click &quot;browse my computer for software&quot; and browse to the location of your Arduino folder. Once there click on the folder that says drivers(do not expand it). Lastly click open. That should install the drivers. I forgot to install the drivers on my Arduino when I was working with some led and they just did random things.
GpaSteve, I just think I know what your problem is. You most likely haven't installed the servo library. Is this true?
Servo library is loaded. Will remove and reload and see if that fixes it <br>Thanks for the response
I'm not sure what your problem is because that's the code that is running on my Arduino right now. Can you take a screenshot of the error and the highlighted text? Thanks!<br><br>And, what is the name of your servo library folder, is it just named 'Servo' or is it something else like 'Servo.h'?
Error message: <br>Error Compliling <br>C:\Users\steve\Documents\Arduino\libraries\Servo\Servo.cpp: In member function 'int Servo::readMicroseconds()': <br>C:\Users\steve\Documents\Arduino\libraries\Servo\Servo.cpp:327: error: 'clockCyclesPerMicrosecond' was not declared in this scope <br> <br>Folder is servo, servo.h is in this folder. <br> <br>Thanks for your assistance <br> <br>Steve
Steve I honestly have absolutely no idea what is the problem. You will have to ask a forum. <br>Does Arduino highlight any certain text? Can you post a pic of the highlighted text? Thanks.
No text is highlighted. <br>Thanks for all your assistance. I will ask around. <br> <br>
Ok. I'm sorry. I don't think it's the code because it's running on my door as I type. <br><br>Good luck.
Not sure what happened but its working now. Thanks again for you help <br>
If statements are annoying it took me about a week to figure them out (really annoying) <br>But I figured it out and it turned out to be a simple syntax error Stupid me
Yeah were you doing this???<br><br>if (this == this) ; {} (adding the semicolon)<br>instead of this?<br><br>if (this == this) {} <br><br>Because that's what I do all the time :D
hi relay liked this you explained the code witch helped me out loads as i am new to arduino and try ting to make a model rocket launcher with a keypad lcd and relay not having must look but think this will help me get some where but i noticed that you disabled the copy on you code would you send me the code so i can try this out thanks
Hey robbi! I'm really glad I was able to help you! Actually, I did not disable copying. Yes, I know, it shows a circle with a cross, but all you have to do is simply to click, drag and select the text. You can do that or you can click in the gray area and hit ctr-A to select all the text within the box. <br> <br>Glad you appreciate! <br> <br>P.S. <br>Don't forget to give it a vote :D
this is genius i want to try this with slider pots to open a secret compartment
Or you can wait until I make version two that uses a &quot;credit&quot; card- so all you have to have is a thin slit somewhere where you put in the card, then it pops open :D
Wow, congratulations! That's a smart idea and I bet it was incredibly fun to make. <br> <br>You've got a great future :)
Yes I had TONS of fun making it! <br> <br>Encouragement like yours keeps me going. Thank you very much!
|Whatever the FD Drive is! <br> <br>..I am so old and I'm only 25, holy moly. ;_; <br> <br>Neat project! But I hope you're joking about the FD Drive comment..?
No really, I have no idea what a FD drive is! I guess the only thing would be Floppy Disk? Dude, that's old school stuff! I use SD cards, micro SD cards, USB drives, and micro USB drives. Floppy disks, CDs, tapes- I know nothing ;-)
Great job, I love your creativity. Be carefull with the power outages when the door is closed with you outside the room ;-) <br>
Haha yes! Actually my doorknob is very bad, so if I turn the doorknob really, really hard it will come open. You gave me a idea, I should make a backup power supply :D<br><br>Thanks!
Why not provide for a &quot;through the door&quot; power supply, so the Arduino is not even turned on until you insert an &quot;electronic key&quot;? That would provide power to the board and servo, and make it even more secure.
Yeah I could put a DC jack on the side of my wooden frame! That would be cool! <br>I may do that in one of my future locks- there's more to come. This one was just for play, nothing realistic. I'll make a real one for a safe some time.
Very nice project ... <br>Please change your name: give yourself a boost for completing such projects. <br>Get rid of the loser: you are a winner!
Haha yes I was thinking about changing my name but I have totally no idea what to change it to! Everything already seems taken! <br> <br>And thanks!
i really like the idea of &quot;one off&quot; security systems. Having store bought stuff just seems to me that the bad guys get a guide as to how to defeat them. Home made one of a kind could take too long to figure out. One must of course resist the temptation to show everyone &quot;how cool&quot; your locks are. Keeping your home and personal defense abilities and plans a secret is the way to go.
Yeah, I would never spend all that money on security systems when I could make one for about 1/4 the price (if not less). I have plans for a better lock than this one, using similar concepts, but it's a lot harder to open the just turning four knobs. Like you said, I could tell you, but that would give away my the key to my house :D. I made my i'ble just to give you an idea of how to make one then you can expand of that. Haha, come to think of it, it would be quite senseless to make an i'ble of a lock for your front door :D.
I think you could make something simpler with reed switches (ones that you can control with a magnet). You just make several rotatable reed switch modules (rotatable for configurable combination), then make a interface outside like you have and attach a magnet to the moving piece so that the magnet is where the number is (in front of or behind the perf board). Then you just need to detect the state of four switches and you're good. With some multiplexing or creative logic gates you could maybe merge into one signal line. You just MAKE a circuit taking in 4 input states that only gives a 1 when they're all on (three AND gates, single quad-gate AND chip).
Yep Yep, I'm sure you could do something like that!
Love this! Great idea!
Glad you enjoyed!
If you used full-sized pots, you could have actual knobs.
Too bad I didn't have any. But yes, that's what I was intending on doing. But I kinda like the ring terminals, I think thy look cool.
Great project, very nice and orginal! Deserves a patch.
Thanks for the patch!
nice and very cool
I'm happy you liked it!

About This Instructable


268 favorites


Bio: ¿Qué tal? I'm 16 and enjoy learning about electronics. I am self-taught. I love programming my Arduino and soldering circuits. My newest hobby is ... More »
More by FoamboardRC: Control Your RC Plane With Your Phone's Acclerometer DIY Receiver Controlled Switch (Cheap and Easy) Complete Guide to Building Your First RC Foamboard Plane
Add instructable to: