I live in residence at the University of Toronto, and in my building we have to use key cards to enter and exit our rooms. Like many students around me, I often forget my key card inside my room when I leave, locking me outside!

EDIT: there is a youtube demonstration athttp://www.youtube.com/watch?v=2v30EHG4x_s

So, I decided to design a solution- an electronic door-opener which pulls down the door-handle of my door, allowing me to enter without my key.

If you have a similar situation, you might want to do something like this, but this was more of a fun weekend hack than a real attempt at an implementation, hence the huge quantities of duct tape.

Step 1: Parts List

For this project, which was completed over the course of a weekend, I used some spare parts and some new ones, making the overall cost very low.

Power Supply/Regulation

- A 5V regulator (I used L7805)
- 100uF and 50uF capacitors (I used random ones lying around, use whatever you have)
- A 12V 1A wall-wart power supply (don't use less than a 1A supply, the motor needs a lot of current!)


I used a PIC16F506, any reasonable microcontroller will work.

Keypad setup

- 8 resistors (used for pull-down, I used 10K, anything around that area or less should work great)
- 16-key keypad (any normal matrix-style keypad will work)

Motor setup

- A $4 12VDC motor with a gear on the end
- A 5V relay


- A PC speaker (any speaker capable of beeping is fine)
- A prototyping board of some kind, or breadboard
- Duct tape (you know it!)
- Soldering iron, solder, flux, and the like

Step 2: Outline of Operation

The design is very simple. This section will explain the main concepts of the operation of the system.

The keypad is constantly monitored by the microcontroller.

When a key is pressed, the microcontroller beeps the speaker.

If a key code is typed, the microcontroller checks to see if the code is correct. If the code is not correct, the button is beeped at a low pitch, indicating a failed attempt to enter.

If the code is correct, the relay is activated for 5 seconds. The motor is then directly powered by the 12V wall wart, which turns the door handle, opening the door.

Step 3: Schematic, Notes

The schematic is shown below. I used the 7805 regulator (shown top right) to derive 5V from the 12V supply. The 5 volts delivered by the regulator directly power my microcontroller.

The keypad is a series of buttons with wires connected in a matrix. If the top-right button is pressed, for example, pins x1 and y1 are shorted together. The x pins are the rows of the keypad and the y pins are the columns. Below is a diagram of the keypad.

A word of warning: the open circuit resistance between pins was, in my keypad, actually only about 250Kohms. Initially I used 100Kohm pull-down resistors, which caused the pins to sometimes mistakenly register as being ON when they were supposed to be OFF, which meant that button presses were interpreted by the microcontroller incorrectly. Reducing the resistance of the pull-down resistors resolved this problem.

Step 4: Code

For reference, I have attached the code I used in this project.

I use the CCS C compiler. There is a free verison out there, which works with many PICs, although I think it does not work with the PIC16F506. The code is provided as a reference to help further understand the design of the machine.

My technique for reading from the keypad matrix is to push pins x1-x4 to 5V, then read the values of y1-y2. Assuming that only one key is being pressed, the y pin which is high will represent the y-coordinate of the buttonpress. Repeat this process pushing y1-y2 to 5V and reading from x1-x4 to determine the x-coordinate.

Step 5: Demonstration

Here is a youtube video showing the device in operation, and some photographs of the back side of the device and door.

Step 6: Future Improvements

In the future, I plan to make a number of improvements to my device.

Instead of using duct tape, I will use velcro to attach the motor housing and microcontroller board to the door. The duct tape is both inelegant and less secure than velcro, and if the controller needs to be reprogrammed then it can be easily removed if it is velcro.

I have heard that powering a relay directly from the PIC is bad practice. In the future I will use a transistor. In addition, powering the speaker directly from the PIC makes for a very quiet speaker. I will use a transistor, or perhaps op amp, to increase the volume of the speaker.

Finally, I plan to have a "program" switch, which will allow me to program in any code I want into the microcontroller. Right now, I need to take out the pic and program it on my computer in order to change the unlock code. I will implement a programming switch which will allow me to reprogram it to whatever code I like without removing the pic from the installation.

<p>you should post this instructable to DIY university contest! </p>
Hi Colin. We spoke last year about a project i am working on. I would like to touch base with you now that i am back on it. Are you interested?
Well if you know anyone i will pay big money to get it done asap. Thanks
I understand the time it takes to get it perfected... Totally makes sense. If you can put me in touch with that contact anyway i really need it... Even if a quick meeting with get me on my way. Thanks !
Hi Colin timeline is this weekend. I need a simple 12vdc relay to stay energized for 5 to 10 secs. <br/>I heard a 555 timer is the way. I have the parts ( i think) good money for someone who knows this better than i. Also need a signal from a mic amped up to trigger same relay. My number in Toronto is 647 984 4314
Sorry, but that seems like a bit too optimistic of a timeline for anyone I know. To get a circuit working and reliable takes a long time, particularly because you typically need to order parts several times and do a couple of iterations to get everything perfect!<br><br>Just as a piece of advice though, a 555 timer will do the job, but it's an ancient analog part. You might be better off getting something like an Arduino, which can simplify things like making the timer more accurate. It can understand things like a microphone input, which would be much more challenging to handle in an all-analog circuit.<br><br>Anyway, good luck with the project!
Hey Colin. Great projects. I'm looking for someone in Toronto to do some circuits for me with 555 Timers, 12VDC relays etc for cash asap. Do you do that ? If not do you know someone?
Hi! I think I might know somebody who could help you... could you elaborate a little bit on what you're looking for, and your timeline?
Woww man!!!... just the circuit to turn on the motor is the most complicated part.. :S ;o congrats!!!
Can I us an arduino, by th way , great instructables, but u should upgrade the schematic quality
&nbsp;Go Toronto!<br />That's really neat, but is it really safe?
Well,&nbsp; I guess I didn't put a lot&nbsp; of thought into safety. Presumably if somebody saw me enter my key code then they could get into my room at any time without me knowing, which would be unfortunate. I&nbsp;consider that to be the only real security vulnerability though, because a brute force attack on the outside is implausible and too time-consuming, and I don't predict that the keypad will show signs of visible wear on the buttons.<br /><br />The only thing which I&nbsp;actually predict might happen is that the keypad gets vandalized (cut off with scissors, ripped off, etc) in which case I need to find a new authentication technique.<br />
i can help you with that just send me all the schematics with more quality and i can make you an authentication technique<br><br>HOPE YOUR RESPONSE!!
keep the keypad on with packing tape :)
awesome project man.Can you send me this project circuit at my email at mfdh_90@yahoo.com or at my instructables accound.i really need this project for my class.thank you.
I scanned some schematics: http://www.flickr.com/photos/colin353/4385411009/ Good luck with your project!
nice, I'm thinking about doing something similar for my dormroom door (maybe with rfid), the biggest issue is the door handle actuator. Your duct-tape approach might be what I end up doing :D<br />
Actually yes, my original plan included RFID, but I decided that RFID&nbsp;readers are pretty expensive. My entire hack cost next to nothing, so I decided to be cheap.<br /><br />I have to say though, RFID would be pretty amazing! If you get that working, I&nbsp;would be very interested to see your plans. As an upgrade to my current setup I am considering alternate methods (aka cheap hacks) for wireless authentication, but I'd have to do some math/experiments to figure out how they might work.<br />
I just got a nice $30 rfid reader + breakout from sparkfun, I'll probably install it sometime next week and post some photos...&nbsp;I already have a belt-driven door opener setup that works quite well, currently running with an arduino.<br />
Thats exactly what I was planning for my Dorm door... however I am putting a twist on this keypad entry... look for an instructable in the near future...<br />
hey check this video out <a href="http://revision3.com/systm/rfid" rel="nofollow">http://revision3.com/systm/rfid</a><em><strong> you could use somin like it for a door<br /> <br /> </strong></em><br />
If I put this in, my roommate would break it out of spite.<br />
Now this is pretty cool, but it would be even cooler if it also openedthe door too.<br />
hello im doing a project just like urs but i have a problem, ur motor goes forward to pull the thing and open the door and the the spring pulls the string back? o do u reverse the thing so it lets the string away? thanks great project btw<br />
hey sorry one more thing i have had a hard time trying to look for a motor strong enought like to pull my door thingy open, ive tried many motor i mean i have a collection -.- i even tried some geared ones but none seem to have enought torque so now am asking, did u take that one from a 12v blender? thanks :D<br />
cupnoodles- <br /><br />By random chance, I came across the datasheet for my motor! In caseyou're still interested in the properties of the motor, check it out:<br /><br /><a href="http://www.activesurplus.com/files/mabuchi.pdf">http://www.activesurplus.com/files/mabuchi.pdf</a><br />
haha, no, it did not come from a 12V&nbsp;blender. The critical thing to note about my setup is the fact that I am winding the string around a shaft of very small radius. This means that I have to make a large number of turns to get the door handle down all the way. This way, torque requirements are reduced. <br /><br />I also am pulling from the farthest distance away from the axis of rotation of my door handle- my lever arm here is about 15 cm, which makes it much easier to pull the door-handle down. And, for added security, I added a small weight to the end of the doorhandle to aid in pulling in down.<br /><br />All in all it's not a particularly powerful motor, but with the given setup it's capable of pulling the doorhandle down.<br />
In this project, the motor is not reversed. The door handle has a natural tendency to return to its normal position, and so when the motor turns off, the door handle unwinds the string back to its original state.<br /><br />Thanks for checking out my project!<br />
&nbsp;Kool, gonna do something like this with my old pc
This is a pretty cool project. I really want to learn more about PICprogramming, but I need a programmer to program with! (And some PICs...)<br /><br />I do have an Arduino however, so I've played a bit with that. I justdon't have any projects I want to do ATM, since I have no optocouples (Iwant to build a CNC machine but I'm worried about blowing one or moreparts, so...).<br /><br />Anyhow, I've got a few ideas for wireless that you could use.<br /><br />#1) (I'm not sure about the legality of such a device operating - FCCregs and all that) You can use a cordless phone to send data - just popit open the handset, de-solder the mic and put some type of jack onthere. The audio comes out from the base on the phone wires, which youcan hook into anything you want. Alternatively, just write a program tocompare the audio of the button presses.&nbsp;<br /><br />#2) IR - you can easily salvage an IR receiver (basically an LED, AFAIK)from an old VCR/TV/DVD player. Then just hook up the remote and storethe bits flashed by the remote. If you wanted to you could just writeyour own PIC based device to flash your own code(s).<br /><br />#3) Garage door opener. Just get the proper communication parts.<br /><br />#4) Wireless keyboard<br /><br />There are probably plenty of other options (optical sensors, LEDs, laserpointers), but those are just a few.<br /><br />Great instructable!<br /><br />
Great soloution !<br />Nice work :)<br />
Great work, and when you leave the University, the tape and stuff comes off the door without a trace.&nbsp;&nbsp;Excellent!<br />&nbsp;<br />I did the same thing back in the 70s when I was in college, except my roommate and I&nbsp;used a remote control taken from an old Motorola &quot;Works in a drawer&quot; color TV.&nbsp; <br /><br />(This is several years&nbsp;before IR remotes. The term &quot;couch-potato&quot; hadn't been invented yet&nbsp;-- people were staying slim by&nbsp;getting up and changing the station every five minutes by hand.&nbsp; The lazier ones were using a notched broom handle to move the knobs....but I digress)..<br /><br />This remote had four tuned rods inside it&nbsp;that were struck by a hammer when you pressed a button; two for volume up and down and two for channel up an down.&nbsp; No batteries required.&nbsp; A barely ultrasonic tone emitted from the&nbsp;struck rod would be received by the TV and a solenoid would mechanically turn the dial one notch per tone.&nbsp; We took out the receiver circuit and wired it to a bigger solenoid&nbsp;stolen from a old washing machine.&nbsp; The solenoid pulled a wire that turned the door knob, and a spring pulled the door open.&nbsp; Of course you had to remember to take the remote with you, but that was part of the fun.&nbsp; It had a rather eerie effect when a press of a button produced a loud clang from the solenoid and the door slowly opened with no one behind it.&nbsp; Great at Halloween!
Wow, that's amazing!&nbsp;I&nbsp;would have been completely unable to build this if I&nbsp;didn't have access to microcontrollers. Very impressive that you could do it all in analog!<br />
awesome, but you'd better fit everything into a box :D<br />
That is cool stuff! I have no need for it, but still an interesting project, well done!<br />
thanks!<br />
you know you could get a couple of those &quot;clip on hanger holders&quot; for doors, or the things used to hang christmas wreaths, and put one on the top of the door and the bottom, and a tensioner between them (screen door turnbuckle?<br /><br />That would give you a mechanically sound place to mount actuators and not have to put tape there.<br /><br />The thing would be portable too, maybe marketable.<br />
Actually, that is a very smart idea, and I never even considered that. I&nbsp;do consider the duct tape to be inelegant and also mechanically ineffective. I&nbsp;plan to replace the duct tape with velcro, which will hopefully deflect less (presently a potentially serious design flaw) when the motor is running at full power. <br /><br />Unfortunately, in my specific case, I&nbsp;suspect that the door-hanger idea would not work-I&nbsp;have a large space underneath my door which could be utilized for a door-hanger, but unfortunately above the door there is very little room for something like that.<br />
I&nbsp;am humbled by your Hack-A-Day featuredness.&nbsp; Well done.<br /><br /><br />I&nbsp;will now fade into the shadows gracefully....<br />

About This Instructable




More by colin353:Homebrew Digital Effects Pedal An Electronic Door Opener 
Add instructable to: