Skip to content
tzikis edited this page Oct 20, 2011 · 12 revisions

Intro

Jarvis is the system we have designed to control the door at our hackerspace. The door has an electric door which is wirelessly controlled by a computer using XBee modules. That way, we can open the door when we wish to, using our software.

Communication

The XBee modules implement the 802.15.4 low-power protocol for communication. The main reasons we use them are:

  • They are very popular in the hobbyist and Arduino communities.
  • They support I/O line passthrough
  • They support Serial (Rx/Tx) passthrough

I/O line passthrough

The XBee modules have 8 Digital Input/Output (DIO) pins. The awesome thing about them is that you can set a pin, i.e. pin D0 on an XBee (let's call it XBee1) as an input, the status of which will be continuously broadcast to another XBee, Xbee2. If you also set D0 of XBee2 as an output, then XBee1's D0 pin status will control XBee2's D0 pin status! Therefore, if XBee1's D0 status is set to LOW, XBee2's D0 will change to LOW as well!

Serial passthrough

Serial passthrough is the killer feature of the XBee modules. Serial interfaces consist of at least two pins, Tx (transmit) and Rx (receive). For two devices to talk to each other using a serial interface, you need to connect the first device's Tx pin to the second device's Rx pin and vice versa. XBees are connected to the computer and other devices (like the Arduino) by a serial interface.

What the XBee does is take the data it receives, and broadcast it to all nearby XBee modules. When a module receives data, they send it through their transmit pin to their device. This way, an Arduino and a computer can talk to each other through their serial ports, and their data are wirelessly passed through by the XBee.

Door controller

The circuit that controls the electric door lock is a fairly simple one. First of all, the electric door's operation is as dumb as it gets. When it is powered, the door unlocks. We are taking advantage of the I/O line passthrough features of the XBee to control a relay which powers the electric door lock, hence opening the door. We have simply attached the DTR serial pin of the computer to pin D0 of the XBee conected to the computer, and attached a relay control circuit (there is an excellent Sparkfun tutorial on that) at pin D0 of the XBee on the door. We have set the DTR pin to LOW by default, and when we want to open the door, we set it to HIGH (5V) for two seconds, (which is more than sufficient for the door to unlock), and then back to LOW. When the D0 pin of the computer's XBee is set to HIGH, the D0 pin of the door's XBee is also set to HIGH, which in turn controls the relay, which powers the door lock, and the door unlocks.

Remote

We wanted to be able to open the door using a remote, when someone rings our doorbell for example. To achieve that, we are using yet another XBee module powered by batteries, with a huge mushroom-type button acting as the circuit power switch. The XBee is configured to automatically send commands to the computer when powered on, so when we press the button and the XBee is powered, the software at the computer intercepts the incoming data and opens the door. We call our remote Big Button of Doom

Clone this wiki locally