In this video we show you how we control two different types of relays, wirelessly, using Xbees (m4v & iTunes). If you’re on the wireless fence and want to jump over to the Xbee side, we have adapter kits, modules and more…
Parts used (all from digikey, but available elsewhere as well): Standard relay, latching relay, 1N4001 (standard), PN2222 (or any NPN transistor), hex inverter 74HC04 (any inverter or buffer will do, suggest HC family)
Parts used from adafruit: 2 XBee series 1, 2 XBee adapters.
To configure, see “Configuring radios to pass Digital I/O”
The receiver schematic is here but note that its pretty ‘basic’ in that you’ll probably want to tweak it for your design anyways.

The transmitter is just an XBee adapter with two buttons on DIO1 and DIO2 to ground (it has internal pullups by default)

Printable catalog (PDF)
FEED
can you post schematics and part numbers for items used in this demonstration?
Comment by scienkoptic — April 22, 2009 @ 6:31 am
Oh, is there any way to monitor status on the control side of this setup?
Comment by scienkoptic — April 22, 2009 @ 6:32 am
Nice demo! I second the request for the circuit and parts.
To monitor status you could introduce a micro and use the Remote AT capability of XBees. Or for even better performance/reliability, put a micro on each XBee and you can get ACK of your on/off commands and query. But now you’ve lost what was so nice about this solution — simplicity.
Comment by andrew — April 22, 2009 @ 7:57 am
I have an application where I’d like to know the state of the device once I’ve sent a relay command to it. eg: gate open/ gate closed?
I assume that I should RTFM.
Comment by scienkoptic — April 22, 2009 @ 8:06 am
Can you make the schematic bigger than a thumbnail? Thanks.
Comment by alcurb — April 22, 2009 @ 11:52 am
@alcurb – click the thumbnail… for the folks who requested the schematic, it’s up now — please build it, post photos – many times folks demand a lot of documentation, even for a quick a video like this but rarely actually build something, so please go make something cool and share it
Comment by adafruit — April 22, 2009 @ 11:58 am
Can you explain the buffering concept, and why the transistor and hex buffer are required between the XBee and the relays? Thanks!
Comment by GDR — April 22, 2009 @ 3:08 pm
@GDR the xbee I/O’s can only supply ~2mA. Relays need 10 – 100 mA. Thus a buffer is required. Much like how a microcontroller cant power a motor, you need a motor control chip which is essentially a big buffer.
Comment by ladyada — April 22, 2009 @ 3:17 pm
Thanks for posting this. I like videos and blog posts like this that explain something in wide enough terms that it can be applied to a number of different applications. Gets people thinking about how they could use this in their projects.
Comment by Jack — April 22, 2009 @ 4:38 pm
Thanks for posting the details!
Got some ideas brewing already!
Does anyone know of a serial port analyzer that would allow me to determine baud and bit format? I’ve got a product that appears to communicte in the 300 baud range, but I’m not sure.
If it does, is there simple way to upconvert to a baud rate that the Xbee can talk in?
Comment by Scienkoptic — April 22, 2009 @ 4:42 pm
Another neat demo. Not related to the circuit, but audio…
If the camcorder you are using to film has an extra audio in, you should put a mic on ladyada. Throughout most of the demo videos I have watched, there is a noticeable volume jump as the camera pulls in to show close-ups. It is also kind of hard to hear when the camera is far away. B&H Photo has relatively inexpensive wireless lavalier mics that will work well enough. They are only about 4 miles away from you guys I think…
Comment by Robert Boerner — April 23, 2009 @ 1:44 pm
I put my money where my keyboard is and bought some Xbee adapter boards. I don’t think I would have if you hadn’t posted this demo.
Keep up the good work. The updates have yeilded all sorts of cool stuff I’ve enjoyed looking at.
Comment by Scienkoptic — April 23, 2009 @ 2:52 pm
hi robert – we have a few different mics and have visited b&h many times
sometimes the videos are short and quick, other times we spend a lot of time on mic’ing up, lighting, etc – since the volume is always at a level that’s audible we think for these quickies, it’s ok – for other videos we’ll spend more time – thanks for the feedback, we’ll try and see what else we can do.
Comment by adafruit — April 23, 2009 @ 3:02 pm
@Scienkoptic – thank you so much!
Comment by adafruit — April 23, 2009 @ 3:05 pm
Someone needs to sell short RP-SMA M-F patch cables!
I’d pay more not to have to buy from china. It’s nice to get stuff within a week or two of when you ordered.
Comment by scienkoptic — April 23, 2009 @ 7:14 pm
Slightly off topic, but, what software are you using to create the schematics you published? As the saying goes, the devil is in the details, and documentation is all about the details.
Comment by Jim — April 24, 2009 @ 10:54 am
I had been looking over the various features on the Xbees previous to this video. Do the analog ports work in the same way? It would be nice to have a remote standalone Xbee do data collection for an Arduino project I’m working on. I just hadn’t got around to experimentation yet.
The Adafruit Xbee adapter boards work very well. If you are using the Xbee Pro boards, I would recommend substituting a shorter, fatter electrolytic capacitor. The Xbee Pro boards are about 1/4″ longer and interfere with the 100uF electrolytic and voltage regulator. Or simply make soldering in the electrolytic capacitor opposite the voltage regulator the very last thing you do after installing the Xbee Pro so you can get it angled right. The voltage regulator bends over just fine.
Comment by Sean — April 26, 2009 @ 7:05 pm
I need to use XBeePRO for my Unmanned Ground Vehicle Project. Can i use it with the XBee Adapter Kit. Also i need Serial Data ?? Please help.
Regards.
Comment by Messum — April 27, 2009 @ 9:33 am
Is there a way to do this without the hex inverter? Say directly off the digital outputs of an arduino. I have an xbee shield talking happily to the arduino, and just want to switch the latch without additional components, if possible. Arduino should source 40ma which is what the latch relay needs…
Comment by mcolacino — May 17, 2009 @ 4:23 pm
sure but then you’d need to add a $30 arduino
Comment by ladyada — May 17, 2009 @ 11:21 pm
BTW, I might be a retard, but the pointer to “latching relay” on digikey above directs you to a part which is labeled DK1a-L-5V-F, which is somewhat different from the DK1a-L2-5V-F. Your circuit seems to use a double coil latching part with each of your inverter segments connected to a different coil on pins 3 and 5..which seems to be pins 5 and 6 on the Panasonic datasheet. The “L-only” one has only four pins and seems to latch through reverse polarity in some way that I can’t quite figure out.
Comment by mcolacino — May 18, 2009 @ 6:50 am
Hey, i dont know how to connect the push buttons to xbee module(what pins are used?), and the same at the receiver(where do i connect the pins?), i’m using the xbee starter kit.
Thanks
Comment by Julio — May 19, 2009 @ 1:40 pm
Can a funnel IO board with xbee radio send commands to read and write to an xbee radio attached to a relay? If so, how does arduino code send AT commands to the remote relay with xbee radio?
Comment by Jose — July 19, 2009 @ 5:46 pm
Where is the code to do this ? I would like to be abe to send the commands from my computer instead of from the buttons… thanks Randy
Comment by Randy Karr — March 1, 2010 @ 10:34 pm
To Jose and Randy, I hope y’all found the info you needed. If not, I know a little about sending remote commands (send over RF) to the XBee chips from Digi. Pretty simple but requires API mode on the sending chip. If you need more information email me.
Comment by kbecvar — July 22, 2010 @ 3:04 pm
Hi that’s a really cool project, I’m in my way to xBee I just have a quick question:
I was checking your schematic and I saw one relay powered by the transistor, I think that I can use the transistor instead of a bunch of buffers right, or I’m missing something?
thanks a lot for your help I appreciate it.
Comment by Jesus Carrillo — July 23, 2010 @ 12:58 am
Testing out the catcha
Comment by krytpik — September 6, 2010 @ 6:06 pm