RF: Sending Signals + Arduino
Setting Up Circuit
After you obtain the parts, the first step to using radio frequency is to make sure your circuitry is correct. Here are images of the Pin Assignments for the Transmitter and the Receiver:
Radio Transmitter: Attach the 'Data In' of the transmitter to pin 12 on the arduino and an LED powered by pin 11.
Radio Receiver: Attach the linear out to pin 11 on the arduin and an LED powered by pin 13. Note that digital output is ignored in this example and can be utilized in further applications of radio frequency.
Implementing Radio Frequency
For both the receiver and the transmitter, the ANT pin (antenna) can be a wire about 13 cm long to help the two communicate over a longer distance. Once you have the two wired correctly, it’s time to use them in code to send the signal you want. For this tutorial, a simple example using Arduino will suffice to help.
1.Download the VirtualWire library. Go to http://www.airspayce.com/mikem/arduino/VirtualWire/index.html and download the library into your Arduino IDE. To install, unzip the library into the libraries sub-directory of your Arduino application directory. Then launch the Arduino environment; you should see the library in the Sketch->Import Library menu, and example code in File->Sketchbook->Examples->VirtualWire menu.
2.Once you’ve downloaded the library, you can follow the given examples using the 'receiver' and 'transmitter' code.