Table of Contents
- Introduction
- Assemble the Parts
- Configure the Radio
- Wire up the Circuit
- Use it!
1) Introduction
Making an LED illuminate is one of the first things many people do when they start learning electronics. We're putting a wireless spin on that achievement by hooking up an LED to one of the XBee's outputs.
XBee radios can be configured for up to 8 digital output pins that can be directly controlled by input pins on a second radio. In this tutorial, we'll walk you through how to program the radio and wire up an LED to an XBee so that you can use it to blink an LED wirelessly.
2) Assemble the Parts
To hook up an LED to an XBee for digital output, you'll need:
- XBee 802.15.4 Radio
- LED
- Breadboard
- Jumper cables
- XBee Breakout Board - for your circuit.
- XBee Explorer USB - for programming your radio.
- A DC power source, 2.8 - 3.3V - We'll be using two C batteries in a battery holder from Radio Shack.
4) Wire up the Circuit
- Place the XBee adapter into the breadboard and wire up the power buses to each other.
- Connect the VCC terminal of the XBee adapter to the positive rail and the ground terminal to the negative rail.
- Connect the anode lead of the LED (the longer wire) to I/O pin 0, which is physical pin 20, on the top right side of the XBee. The cathode lead (the shorter wire) gets connected to the ground bus.
- Insert the XBee into the adapter.
- And finally, connect the battery pack. Since we set the I/O mode of the pin to be HIGH on start up with the command "ATD0 5", the LED will illuminate as long as there's no radio configured to transmit a low signal to our receiving radio. If you'd like the LED to be off on startup, you can use the command "ATD0 4".
- Below is a diagram of the circuit. In the photos, we used C batteries. A pair of AA batteries, as shown in this diagram, will work fine.
5) Use it!
Now that you know how to connect an LED to the digital output of an XBee radio, take a look at our input tutorials for what can control the LED. Just be sure that the the transmitter's address is set as the receiver's I/O input address setting (ATIA). The video above shows a button connected to a wireless LED.