Sunday, September 25, 2011

RFID Garage Door Opener

    I spend a lot of time in and around my garage and encourage other nerds to do the same. I want to make sure that if someone is working on a project and I am not around that they can still access my garage. Giving people house keys is a bad idea because they are easily copied and give unlimited access to the entire house. RFID tags, however, are hard to copy, easy to revoke, and allow for time-based access. So I built a box to activate my garage door opener using an RFID reader.

    I started with a Parallax RFID reader from RadioShack. Then I added an Atmega 328p microcontroller, reed switch relay, DS1306 real time clock, LM386N-1 audio amplifier, speaker, and support circuitry to create an RFID control box.
    The smaller box contains only the RFID reader itself. It is pushed as close to the door as possible so tags can be read through the rubber trim surrounding the door. The following photo shows the metal race that the door travels along, the edge of the RFID reader box, the strip of rubber trim, and the box that I made using tape to delineate the area near the reader so that it can be located when the door is closed.
 The larger box contains the rest of the circuitry. I cut two breadboards to fit into the slots of a cheap project box from RadioShack and placed the noisy components on the bottom board and the sensitive ones on the top board.
    The bottom of the box has a DB-9 connector for RS-232 that allows for configuration via a separate computer. The microcontroller only has one UART so the DB-9 connector has to share it with the RFID reader. There is a small constant switch adjacent to the port to select between the two.
    The firmware is AVR-GCC C and I used Python to make a pygtk GUI for configuring tag information. Now I can grab an RFID tag out of the drawer and assign it a description (i.e. 'Rebecca's tag.') and a period of time for each day of the week (i.e. weekends between noon and 5pm) when it is valid.

    Contact me if you are doing something similar and have any questions or want a copy of the firmware (under the GPL). I didn't capture the schematic in Eagle but I did take photos of my notebook and adjusted the contrast until they are semi-legible.