RFID apartment lock (& iPhone app)

November 5, 2010

Octopus cards in Hong Kong can be used to purchase almost anything, such as groceries, McDonalds, and public transport. Since everyone has one, a lot of apartments are using them for access control.

One of my first projects after moving back to Hong Kong was installing an electronic lock on my apartment door. My door can be now be unlocked with an Octopus RFID card, iPhone app, or over the web.

Parts List

  • Compaq Evo T20 thin client running linux (and Ruby!) (any dedicated PC would work too)
  • USB Octopus Card Reader (Sony FeliCa ISO14443C)
  • Door with a lock that can be unlocked by turning the handle from the inside.
  • 12V central locking actuator from a car door.
  • Vellman K8055 USB interface board
  • Ruby octopus reader library, etc (http://github.com/ndbroadbent/octopus)

I wrote a small ruby library to read an octopus card ID (http://github.com/ndbroadbent/octopus), using a USB RFID reader for the 13.56 MHz Sony FeliCa chip. I used a K8055 USB interface board to switch on a relay every time an authorized octopus card was recognized.

My apartment door lock is the “button” kind, with a button in the middle of the handle that pops out when the knob is turned from the inside. So I put a screw into the base of the handle, and mounted the actuator on the apartment door, so the actuator turns the handle and unlocks the door. Of course its not the most elegant solution, but the actuator was only about $7 USD… It can only unlock the door, but I don’t need it to lock automatically.

I added a web server, and wrote an iPhone app so that I can unlock the door via our wifi connection. I’ve also added some more relays to control the house lights and ceiling fan.

Here’s some photos of the lock and the iPhone app (sorry for the quality):