I got a pair of these extremely cheap RF Link receiver and transmitter pairs for under $5 each. They operate at 434 MHz and supposedly can transmit at up to 2400bps. I was hoping to be able to build some nifty firmware which allowed these things to flawlessly communicate bidirectionally (well, one at a time), essentially making them into a cheap variant of the XBees. It turns out, these little devices are not quite as stable as I hoped they would be. But there’s still a lot of cool stuff that can be done with them.
434 MHz Transmitter
434 MHz Receiver
They can easily be hooked up to the Arduino data pins. If you want to boost the transmitter’s power, hook the third pin (Vcc) to more than 5V. It can take up to 12V and the more juice you give it the more power it has to transmit, the less dropped data.
Here is where all the fun started. Hooking it up was easy, using the Arduino software serial library to establish the communication is also a no-brainer. Yet if the receiver finds no signal for 10ms, it automatically turns itself into an auto-sensing mode in which is cranks up the antenna gain and starts just outputting noise. This is not only annoying, but also very counterproductive when trying to get a clean transmission. Also keep in mind that these modules are really bare-bones. They send and receive data. There’s no automatic receipt acknowledgement, no automatic resending of packets, nothing. That’s especially hard considering that these devices only provide a one-way communication path.
The easiest way to go around this is to just have the transmitter continuously transmit data, even if it’s just empty bytes. While I got this to work just fine, I didn’t think this was very practical.
My second attempt created an elaborate packet structure around the data and the receiver software parses the packets that come across the wire and rejects them if it can’t parse them. I also ended up having to prepend the packets with a number of unused initialization bytes just to get the receiver to listen again. And since there’s no way to know whether the package made it, I ended up re-sending them a bunch of times to actually get the receiver to acknowledge. From a software perspective that means you have to make sure the commands you send are idempotent.
With all this error correcting logic and re-sending I can easily transmit across the entire room, probably further than that.
I am getting pretty good results with this, but the main takeaway is really already written into the data sheets. The manufacturer outlines that the main application for these modules are remote controls. For anything more advanced which includes multiple transmitter/receiver endpoints and clean easy data communications, XBees are really the way to go (and they’re only around $20).
Feel free to grab the source code .
The Entire Thing in Action
Watch the top Arduino’s built-in LED go on and off and the bottom one follow (top – transmitter, bottom – receiver).