[[File:AMT Door 2 RFID Reader.JPG|thumb|right|400px|RFID reader outside suite 113.]]
See foballthethings.org for where this project has gone in general
Getting Access
When you [[Becoming_a_Member#Provisional_Membership|become a provisional member]], you’ll get a key fob with an RFID number assigned to it. The trouble is we have no idea what that long string of numbers is. In order to get your ID into the database, attempt to use it on the door several times a few minutes apart. Email [email protected] with what time you did this at and one of them will be able to retrieve your ID from the logs.
AMT Door 2
The [113] door works… I’m not sure how well… and I blame [[User:Spacepenguine|spacepenguine]]!
When AMT grew into the space next door (room 113) to our original room we needed to expand our RFID access system. AMT Door 2 was designed to build on the original design and be a unified system driving both doors. A number of flaws detailed in [[#Thoughts_for_the_Future|#Thoughts for the Future]] have meant that AMT Door is only on the door to room 113.
All of the files for this design (acrylic cases, software, boards) are in the AMT Door 2 Repository.
Block Diagram
[[File:AMT Door 2 Implemented Block Diagram.png|RTENOTITLE]]
Software
The authentication software running on the Raspberry Pi is nearly a wholesale copy of the code DavR wrote for AMT Door 1. It listens for a tag number on a serial port and verifies it against a cached copy of the valid key list. A cron job periodically pulls the valid key list from our Drupal site. An authentication file is required (“.codez.inc”, not included) in order to pull these numbers. It is located in the /authCode directory of the repo and includes a setup script and daemon for running on Debian systems. On the provisioned Raspberry Pi/recovery image I have cloned a copy of the amtdoor2 repo in ~/repos/amtdoor2 and run the daemon right from there.
The Panel Controller has an ATMega16U4 with firmware on it to read and forward IDs from the RFID reader and controls for the panel LED and door relay. The software is based on LUFA lib, which is used for the USB virtual serial communications, bootloader, and Makefiles. This code is located in the /panelMcuCode directory of the amtdoor2 repo. I was having trouble getting the bootloader to load properly, so the hardware in the space is the application .hex binary loaded using an AVR ISP.
Hardware
File:AMT_Door_2_RFID_Reader.JPG|RFID reader outside suite 113.
File:AMT_Door_2_Panel_Controller_Connected.JPG|Panel Controller on the inside of the suite 113 door.
File:AMT_Door_2_System_Power.JPG|12V power, the power injector, panel controller, and RFID reader wired up.
File:AMT_Door_2_Electric_Strike.JPG|Electric strike installed in door.
Since there were several parts needed (door relay, 5V regulator from 12V door power, RJ45 connector, microprocessor) close to the RFID reader, I built up a custom PCB to combine all of these on a single board. The microprocessor is a ATMega16U4 (meant for ATMega32U4 but there was a part shortage), and the board is essentially a fork of the Adafruit ATMega32U4 breakout board, which was used for development. This processor was chosen because it has 2 serial ports, one hardware and one virtual usb. The schematic and board files can be found in the /physical directory of the amtdoor2 repo.
Design notes:
- Originally, this board was meant to fit under RFID reader and has the same width and hole pattern. However, having the relay control on the outside of the door would allow anybody with a 5V source to open the door. This is not a good idea (duh).
- The relay chosen has a 5V latching input and controls the 12V power to the electric strike.
- USB serial and 5V power is available either on the Cat-5 connector or the USB mini receptacle. R6 and R7 should be stuffed appropriately to control the power source.
- 12V relay power is only available on the Cat-5 connector. This was an oversight. One of the boards in the space has rework from +12V to one of the blank pins on JP1.
- Extra I/O and 2 blank pins (for rework, like a 12V connection) are available on the bottom edge header, JP1.
- There is one known schematic error. The VCC and +5V nets should be connected. Both boards in the space have this reworked.
On the other end of the Cat-5 cable in the block diagram is a power injector. This is used to combine the USB and 12V power signal into the single Cat-5 cable. There are no active components on this board. Although this was meant to be the computer closet side of a long Cat-5 cable (see [[#Thoughts_for_the_Future|#Thoughts for the Future]]), it is now located near the Panel Controller due to SI issues. It is required because there is no 12V input on the Panel Controller besides the RJ45 connector.
For consistency, we used the same third-party components on this revision of the door:
- RFID Reader: Parallax RFID Card Reader (28140)
- Electric Strike Plate: [http://www.magneticlocks.net/proddetail.asp?prod=MAG-HS125SLD 12V Fail-Secure Electric Strike MAG-HS125SLD]
Thoughts for the Future
The system was originally designed to have a block diagram more like:
[[File:AMT Door 2 Original Block Diagram.png|RTENOTITLE]]
However, this design relies on a number of troubling details:
- USB does not play nice over 40′. The connection becomes extremely flaky, and it is not rated for this due to maximum round trip times.
- USB does not play nice over Cat-5 cable. USB is 90 ohm differential; Cat-5 is 100 ohm. Although this seems really close, the distortion is bad enough that even 6″ of Cat-5 cable will fail the USB 1.1 certification tests. Don’t do it.
- As noted above, putting the Panel Controller (including the 12V door relay) on the outside of the door is a bad idea (duh).
- The USB data pairs are current routed over one of the adjacent pairs that is not a twisted pair.
- We need to have both 12V and 5V adapters when we could just regulate the 12V to 5V for the Raspberry Pi too.
This system could be improved without making new boards by stationing Raspberry Pis at each door and eliminating the power injectors:
- Rework +12V onto one of the blank pins on JP1.
- Rework +5V onto the other blank pin of JP1.
- NOTE: R6 should be stuffed and R7 should be NOSTUFFed. This should be the current state.
- Ditch the power injector board and connect Raspberry Pi and Panel Controller directly with mini USB.
- Jump the +5V from Panel Controller to the Raspberry Pi’s 5V GPIO pins.
This system could also be improved with another revision of boards that keeps the Raspberry Pi and power connections in the computer closet:
- Use a different MCU with 2 hardware serial ports. For example, the ATMega2560 in an Arduino Mega.
- Swap the USB signal in the 40′ long cable from computer closet to door for TTL Serial.
- Either build an FTDI usb-serial adapter into the power injector or swap the mini USB ports on the power injector for .1″ headers that can be used with FTDI Friends or similar.
- Add a voltage regulator to power the Raspberry Pi off the 12V rail of the power injector.
Recovery
Since Raspberry Pis have a slight tendency to corrupt SD cards on unexpected power loss, a complete image of the functional system is located on a flash drive. The flash drive should contain a single .img file that can be written over the SD card with the dd command.
AMT Door 1
The [114] door works great and I blame DavR!
Block Diagram
[[File:Amt door.png|amt door block diagram]]
Software
The program controlling access to the door lives on a Sheevaplug (kind of like a raspberry pi but more stable according to DavR). It listens for a tag number on a serial port and verifies it against a cached copy of the valid key list. A cron job periodically pulls the valid key list from our Drupal site. An authentication file is required (“.codez.inc”, not included) in order to pull these numbers. You thought we would just give it all away? That would be too simple. DavR wrapped up this code into the AMT Door 1 Repo.
To actuate the 12V power relay and talk TTL serial there is a Teensy microcontroller. The software on this teensy is not known, but is likely similar to the arduino code listed below in [[#Legacy_Door_Page|#Legacy_Door_Page]].
Hardware
- RFID Reader: Parallax RFID Card Reader (28140)
- Electric Strike Plate: [http://www.magneticlocks.net/proddetail.asp?prod=MAG-HS125SLD 12V Fail-Secure Electric Strike MAG-HS125SLD]
- Sheevaplug
- Teensy
SMS/Phone App
You can use a silly android app to unlock the door!
Source Code!
Code is here:
https://github.com/atom-bomb/Android_AMT_Unlocker
Binary!
An installable android thingy is here:
https://github.com/atom-bomb/Android_AMT_Unlocker/AMT_Unlocker.apk/qr_code
Before you use the app:
- Point your browser at http://acemonstertoys.org
- Login as yourself
- Click ‘My Account’->’Edit’->’Personal Information’
- Enter a 4-digit door passcode
- Click ‘Save’
Other android apps
Both of these can show the space’s status:
- https://play.google.com/store/apps/details?id=ch.fixme.status&feature=search_result
- https://play.google.com/store/apps/details?id=ws.narro.the.in.spacedirectory&feature=search_result
Fobs
When we need more fobs, anything that says “125khz rfid” should be compatible. And usually are under $0.50/each in bulk on ebay. If we are completely out and need some asap, jameco sells them for like $1-2 each and they arrive really quickly.
Legacy Door Page
(see page history)