Step #2: Connect the Relay in Line with the Light FixturePrevNext
- Solder one wire from the light fixture to the relay.
- Cut the lamp cord to about 10 inches from the plug, split and trim the wires.
- Connect one lamp cord wire to the relay and the other to the free lamp wire
Step #3: Set Up the XBee Internet GatewayPrevNext
- Download the XBee Internet Gateway software (https://code.google.com/p/xig/downloads/list).
- Use an Ethernet cable to conenct the ConnectPort X2 to your router. Determine its IP address by using the software on the CD included with the ConnectPort or by checking your router's log for the MAC address.
- The ConnectPort X2's MAC address is printed on the bottom of the unit.
- Enter the ConnectPort's IP address into your web browser's location bar.
- Under the Python menu, upload the two XBee Internet Gateway files: xig.py and _xig.zip.
- Click "Auto-start settings" and add xig.py and enable it. Apply those settings.
- Under the Reboot menu, click "Reboot."
Step #4: Configure the XBee RadioPrevNext
- Attach the XBee to the USB adapter and launch a terminal program such as CoolTerm (http://freeware.the-meiers.org/).
- Select the port that matches your USB adapter and select "Local echo" and click OK and then "Connect."
- In the terminal window, type "+++" to enter command mode. The modem will respond "OK"
- Command mode is active for 10 seconds after you type "+++" or hit enter after an AT command. If you take too long, type the plus signs again to go back into command mode.
- Type ATID AAAA to set the PAN ID to match your gateway. The modem will respond "OK".
- Type ATDL 0 to set the low byte of the destination address to the ConnectPort X2, which is the coordinator of the network. Zigbee Network Coordinators always have the low address of 0. The modem will respond "OK".
- Type ATDH 0 to set the high byte of the destination address to the ConnectPort X2, which is the coordinator of the network. Zigbee Network Coordinators always have the high address of 0 The modem will respond "OK".
Step #5: Configure the XBee Radio, ContinuedPrevNext
- Type ATBD 7 and hit Enter to set the baud rate to 115200. The modem will respond "OK".
- You can check any of the settings by typing the command without the parameter.
- When you've confirmed that the settings are correct, type ATWR to write the settings to the modem's flash memory.
- Disconnect and reconnect at 115200 baud.
- Type help. The response should be information about the XBee Internet Gateway. If not, verify the ConenctPort and XBee settings.
- Type in a web address such as http://www.google.com/ and hit Enter. If you see HTML, you've configured the XBee Internet Gateway correctly.
Step #6: Set up the ArduinoPrevNext
- Insert the XBee into the XBee shield and put the XBee shield on the Arduino.
- Upload the code (https://code.google.com/p/makezine/source/browse/trunk/arduino/on-air-light/on-air-light.pde).
- Connect the Arduino to the relay board.
- Using velcro, mount the components inside the panel.
Step #7: Connect the powerPrevNext
- Connect the lamp cord and your 5V power adapter to the extension cord
- Connect the power to your Arduino.
- Create a notch in the bottom of the wood panel for the extension cord so that the panel can sit flush against the wall.
Step #8: Finishing TouchesPrevNext
- Insert red light bulb, replace glass fixture cover.
- Use press-on letters to spell out "On Air" or whatever you want!
- Add a hook to the back to mount the light on the wall.