Thursday, February 25, 2010

RFID Operated Door

Ever wanted a door to open using an RFID tag? I did. So I made it happen.

So how does it work? How about a few pictures:

(Mostly) overall view

A view of RFID reader board taped to the door

Yes, I did attempt to tape a computer supply to my door. It failed as you can see.

The motor and the bracket it is attached to.

Front view of the motor mount, with the belt attached. The motor is a no-name brand motor I found for cheap on Ebay. I searched "12v high torque motor" and bought a 60rpm model. Most of the ones I looked at came with a mechanical drawing of the mounting holes, so I used that to design the bracket.

The door knob with the belt attached, and the controller board. The three buttons are for motor up, motor down, and auto-open. I use the up/down buttons to adjust the position of the motor, and the auto-open to automatically open the door from the inside. There is also an LED on there which lights when a card is read.

For the RFID reader board, I am using an ID-20 RFID reader (available here). The chip is pretty easy to use, just give it power and swipe a readable card and it outputs the data from it. The range is also pretty good: it reads about 2cm away, through the door.

To read the data and run the motor, I am using a Freescale HCS08QG8 micro-controller, which is what I had on hand. It is the 16 pin model, so I had plenty of pins to play with. I also bought a few relays to switch on the motor power using the micro-controller.

For fun, I wired a tri-color LED to sit in the peep-hole for the door.

The LED glows blue all the time...

...until a valid card is swiped, which turns the LED green. It (should) turn red for an invalid card, but I don't have any to try it with.

The schematic for the entire circuit.

To connect the LED and auxiliary board, I am using Cat5, since it cheap and has 8 conductors. I am using some generic wire I had lying around for the motor.

Things to note about the circuit:
The way I wired the relays allows the micro-controller to switch on and off the power, and switch the direction of the motor. I am using transistors to activate the coils in the relays, because the micro-controller can not put out enough power.

For the pull-ups shown for the buttons, I intended to use the pull-ups built into the chip. For the first day I had it setup like that, but I was woken up at 6am by my door opening it self. I later found out it was most likely caused by interference. The Freescale chip is known for having weak pull-ups, especially for wires over 6 inches. Basically, the wires running to the auxiliary board were acting like antennas. I added external pull-ups and turned off the internal ones, and haven't had a problem yet.

Overall I'm happy with the system. I haven't used my keys in over a week, and it's quite nice. I am also glad to see I could do this without making permanent modifications to the door. I am looking into designing a coil for the reader, and I'll post about that if it happens!

So what do you think? Any other pictures or info you want?