ASK RF Link
Created 12/1/11 by Glyn Hudson
Xbees are great but they are expensive, if all you require is a one simplex one-way link between two Arduino's low cost RF transmission is the way to go.
There are several types of RF transmitters and receivers
I have been using the MO-SAWR-A transmitter module and the MO-RX3400-A receiver module. These are available in 434Mhz and 315Mhz from coolcomponents at a very reasonable £8.80 for a pair (12/1/11). They are also available from sparkfun.
The modules use ASK (amplitude shift keying), they have a maximum transfer rate of 4800bps and a very impressive range of about 150m in open air.
The modules are wired up as follows:
The antenna should be 30cm long, don't be tempted to coil the antenna as it creates interference.
The VirtualWire Arduino library is used to package the data to be transmitted into a data frame, a protocol of packets of wrapped around the data; synchronization preamble at the beginning and and check-sum error checking at the end. The library was written by Mike McCauley.
VirtualWire library - I used version 1.3
The library contains a simple string transmitting example.
Further example code:
Range Tester - by Suneil Tagore
The range tester transmitter code transmits the integers 1-9 in order repeatedly. The receiver code check to see if the integers are received in order. If a transmission is dropped it is flagged up. The number of dropped transmissions can be counted over a period of time to determine the transmission reliability rate.
Multiple value transmission (four values) - by Trystan Lea
It is often useful to transmit multiple values such as power, temperature ect. I have used this code to make a wireless home energy monitor display. The code works by adding a letter such as 'A', 'B', 'C' or 'D' before each value. The transmission can then be separated into the individual values at the receiver.
A more advanced library is being developed by Miles Burton here
|RF Range Tester.zip||2.17 KB|
|RF Multiple value transmission.zip||2.2 KB|