Keyless Dorm Entry

35,256

136

44

Introduction: Keyless Dorm Entry

The basic problem behind this project was that keys are something very easy to forget or lose, and they are the only way into my dorm room. This is especially a pain when leaving the room for a short time, such as to go check mail or give something to a friend. It's a bad idea to leave the room unlocked, but a pain to take keys. A solution to this would be to provide another method of access with something easier to carry, or not even needing anything to carry anything at all. This must also be accomplished without modifying the door in any unauthorized way.

Step 1: Solution

A device will be attached to the door that is able to lock and unlock the door by pulling the lock. It will do this when the correct number is typed in, or an ID is scanned. A school idea is much easier to carry around, and is required to get into the building anyway. And even without it, typing in the correct number requires carrying nothing additional.

Step 2: Parts List

SX48 Proto Board ($15) - http://www.parallax.com/Store/Microcontrollers/SXProducts/tabid/138/CategoryID/15/List/0/SortField/0/Level/a/ProductID/362/Default.aspx - This is the microcontroller that is the 'brain' of the project. Almost any microcontroller would work just as well.

Magnetic Card Reader ($3.50) - http://www.allelectronics.com/make-a-store/item/MCR-12/MAGNETIC-CARD-READER/-/1.html - This is the card reader that was used to read the school IDs.

Keypad ($7.50) - http://www.allelectronics.com/make-a-store/item/KP-12/12-BUTTON-KEYPAD/-/1.html - This is the keypad that is used to type in passwords.

Servo ($5) - This is what unlocks the door.

Screen (???) - The screen to display the currently typed code. This was recycled from an older device and therefore not purchased.

Step 3: Magnetic Card Reader

The first step in this project is establishing how the card reader actually works. The datasheet can be found here: http://www.allelectronics.com/mas_assets/spec/MCR-12.pdf

The two most important data lines are RDT and RCT, which are data and clock respectively. The way this card reader sends what it's reading is using these two pins. When the clock line goes from 1 to 0, that means the next bit of the card is present on RDT. There is an example in the first picture.

The RDT line is inverted, meaning when the clock goes from 0 to 1, if a 0 is present on RDT, that means there's a 1 on the next bit of the card. The example above shows what might happen if the data "1101" was on the card. Note that the frequency of the clock pulses are purely dependent on the rate in which the card is scanned. They are not necessary uniform width.

The next part after grabbing the data is interpreting it. Most magnetic cards use the same format, including the school IDs. There is a picture of example data provided.

The data is in groups of 5 bits with 4 data bits and one odd parity bit. The first bit is a semi-colon, or a 'start sentinel'. It has the value of 11, and signifies the beginning of the card. There is also one parity byte at the end of the card. For this simplified design, the parity bits are ignored, because any misread card will simply result in an access denied error.

 


Step 4: Keypad

The keypad was probably the simplest thing to interface. It has a pin for every button plus one for ground. When a button is pressed, that pin is grounded. Connecting every pin to the microcontroller along with the microcontrollers internal pull-up resistors was enough to easily get which keys were pressed.

Step 5: Servo

This is what connects directly to the doors lock. This specific servo was controlled by sending specific frequency pulses into one of its pins. The appropriate frequencies were found by experimentation and then programmed into the microcontroller. Thus this was a very simple solution to unlocking the door.

Step 6: Screen

The screen was recycled from another old device. The protocol for the screen is luckily very common and very well documented. It even has its own Wikipedia page here: http://en.wikipedia.org/wiki/HD44780_Character_LCD. It works similar to the magnetic card reader in that there's a clock pin and data pins. The difference is there are more than one data pins that are used so that entire bytes can be sent at once. Also, communication is only one way; from the microcontroller to the screen. There are a few 'command' bytes and a data bytes. Command bytes are used for things like moving the cursor or clearing the screen. Whether or not a byte is a command is controlled by the R/S or Register Select pin of the LCD. If sending data, the byte is written to the screen where the cursor is and it uses standard ASCII text. I won't go too much into the details of the screen as it's very thoroughly documented elsewhere. For further reading, see http://home.iae.nl/users/pouweha/lcd/lcd.shtml

Step 7: Software

The last part of it all is creating the software that ties it all together. Unfortunately, the SX has a very limited amount of memory to work with so it required a few tricks to make the software work.

There is a flow chart of the design.

Some important things to keep in mind: Because of the limited memory of the SX48, it's not a good idea to attempt to store the entire data of the card or the entered key. The simple solution to this is to have a byte that remembers what 'place' it's on in the key or card. When a mistake is made, that is remembered, and the place variable is increased. That way, it only needs to remember if there was ever a mistake, and if there wasn't, and the end of the key/card is reached, the data must be OK. For security reason, it's very important that the system keep letting you scan a card or type a key once it determines a mistake has been made. Otherwise, it would be easy to break such a system by trying different keys. With all of these design considerations in mind, the system will remain completely secure while at the same time not need to worry about the limits of the hardware.

 

Step 8: Conclusion

The end result of the project is a fully working door that can be opened from without a key. The total cost of the project is under $40 which is a very good price for the final result. A lot of enhancements could easily be made. For example, the system currently is not able to relock your door, but such a thing would be trivial to add into the code. It wouldn't be too difficult to add some different ways of unlocking the door, such as texting a number or making a microphone to listen for a secret knock.

www.youtube.com/watch

Share

    Recommendations

    • Water Contest

      Water Contest
    • Fix It! Contest

      Fix It! Contest
    • Metalworking Contest

      Metalworking Contest

    44 Discussions

    why not.. get another door, modify that, then replace it.. then put the original back when you go?

    So I take it that this uses odd parity? Also, doesn't having the left most bit being the ones place go against most convention of binary? Finally, is the data in ASCII or is it raw binary to decimal data conversion?

    Nice Instructable.  Definately need to secure the ribbon cable better.  There is another Instructable using RFID the author there had a chip implanted in his hand (same type used for dogs) all he does is wave his hand at the door and it unlocks as I recall it is on his car.  Possibilities with the chip are endless one has to decide if they want they want to get implanted.

    15 replies

     I've done RFID too and i'd be keen to get an implant but so far i have been unable to find a 'medical grade' 125kz manchester tags in low quantities in Australia

    Hey Andrew I would think that a vet would have these on hand, provided they are the same type. The problem then might be in Australia any medical laws in using a product designed for animal husbandry for human medical. Since they would be implanted into a canine it too would need to be "sterile" or of "medical grade". Mike aka: Foxtrot70

    I've found one now! They are on their way from America as i type. Hopefully within a week i will have one in my hand (literally)! Just trying to find/convince a medical person to do it for me. As you mentioned, because they are not certified for implantation in humans, most medical practitioners will not do it due to liability issues. I'm open to doing it myself but i'd rather that someone with medical experience done it for me. Even piercing shops seem to be reluctant though.

    Hey Andrew - They are concerned with infection and product failure. If you do it yourself, get in touch with a Vet or MD or even piercing shop and review insertion and sterilization procedures and local anesthetics, again this might be problematic as to who is administrating the anesthetic. You might try looking up the Instructable of the individual who made an RFID controller for his car and has chip emplanted in his hand he might be able to provide more information in this area.

    The chip i have bought is a HitagS 2048 from Brett @ http://www.sleepallday.org. He's a great guy, he helped me determine it's compatibility with the ID-12 chip. They are programmable to 'modes' and in particular he has programmed it to EM4102 standard for me (which can be read by the ID-12). I'm quite well aware of the reasons people seem reluctant to help out but failling to find someone to actually do it for me, i will be seeking propper medical advice on how to make sure i do it safe. The last thing i want is to have it get infected and end up in hospital to have it removed. I'ts sort of a catch 22 situation where if i get a medical person to do it for me, there is much less risk but they won't take that little risk. On the other hand, there is much more risk if i do it myself but i'll only do it myself if i can not find a 'propper' person to do it for me. So far 3 peircing parlours have declined my request to do it for me which seems odd. One of them is known as a more extreme peircing place too. I'm going to see if my GP will do it for me next.

    Sounds like you have a good handle on everything. After looking at the various comments about implanted chips amazing the level of ignorance out there from all quarters. Since your project is a very limited one your personal identity security is not a question unless you decide later on to include internet access. Your project is really good one and pardon the pun...very handy!

    Hey Andrew - COOL BEANS! Tell me asbout the procedure. Currently do you experience any discomfort? Have you had a chance to try the circuitry? This is really exciting! - Mike

    Well i finally found a local piercer to do it for me. He was actually quite excited to do it - the very opposite of all the others. It was a very simple, quick and nowhere near as painful as i expected. He simply grabbed a 10g peircing needle (probably could have got away with a 12), peierced the skin and pushed it in till the tip was about where the end if the chip should be. Then he just twisted the needle about 90deg to open the hole a bit more. That probably hurt the most. Then he removed the needle and popped the tag in, giving it some help from the back of the needle. A little pressure and a couple of minutes later i was on my way with a bandaid to cover the wound. Note that this was a piercing needle, not a normal syringe type needle. On a pain scale out of 10 for me, only about a 2-3 and that was when he twisted the needle, other than that, it was about a 1. Within about 2 hours i barely even knew i had it done other than some tenderness around the injection site. Now, about 36 hours later its almost painless unless i have something push hard into the webbing where it pushes the implant in further. That should go with healing though. It took a while to get the smile off my face the first time i heard that gratifying 'beep' as the tag read on my door entry system after getting it done! the pic is a little deceptive, it looks like the injection site is in the webbing but it's not.

    implant_sml.jpg

    Hi Andrew - Pic looks great! Did the piercer use a local anesthestic? What was the cost of the chip and cost for implantation? When you wave your hand at the sensor, pardon me I have to ask this, do you command, "Open Seseme"? What is the furthewst distance you can be from the door sensor? Upon further consideration I think this would be rather secure, short of a retina scanner, no keys or access cards to loose. - Mike

    No anasthetic. Not really needed. The chip was US$10 plus shipping from sleepallday.org and they charged me US$35 to implant it but i suplpied my own sterile needle. It can be read through my hand by the ID12 but not much more than that. So about 3-4cm. That could be better with an external antenna though. I would not say it's any more secure than keys but it is definately more convinient. The tags CAN be copied so there is risks but with a read distance very short, someone would have to get pretty personal with me to read it and not only that, they would have to care and think it would be EASIER than just smashing my window or door down. It's not as if i use this for access to my bank account or something that would offer much reward if it was compromised.

    Cool! I have one question, though. Do electronics and other stores give you trouble when leaving by setting off alarms? That would seem to be the only problem after everything is said and done.

    No, not at all. They operate on different frequencies so there is no problems. Airport scanners are fine too.

    Hey Andrew - Here is a comical thought...If I were going to implant one of these chips I think I would have it implanted in my second finger, that way when ever I used the chip I would be giving the device "The Bird" - LOL

    you said not modifying your door in an unauthorized way.
    since when is this become authorized
    the matron would kill you if you did this without its permission