The code for an arduino-based dorm automation system (DAS).
http://www.youtube.com/watch?v=Y7vDsM4oP3w&feature=youtu.be
Currently, the system has 2 relays to control electronic devices, a servo powering a deadbolt on a door, and a hall effect sensor to detect whether the door is open or closed.
Door can be unlocked remotely from virtually any mobile device. The back end software logs all changes (door unlock/lock and open/close) to a SQL database, which is then made available via a web interface.
Housed in an old DSL router shell. Works well as premade project box with some built in connectors.