433MHz Radio module
Assignment of radio modules
The XD-RF-5V receiver and FS1000A/XD-FST transmitter for 433MHz radio are used to transfer data between two devices. They are very often used to connect several Arduino devices.

Picture 1. XD-RF-5V Receiver and FS1000A/XD-FST Transmitter
Transmitting signals to control the LED
Connect the LED to pin 3, and the DATA pins of the receiver and transmitter to the pins of 2 different Arduino.
Connection diagram
![Radio module connection diagram]
Picture 2. Connection diagram of the radio module
Transmitter program
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
mySwitch.enableTransmit(2);
}
void loop() {
mySwitch.send(B0100, 4);
delay(1000);
mySwitch.send(B1000, 4);
delay(1000);
}
Receiver program
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
pinMode( 3, OUTPUT );
mySwitch.enableReceive(0);
}
void loop() {
if( mySwitch.available() ){
int value = mySwitch.getReceivedValue();
if( value == B1000 )
digitalWrite( 3, HIGH );
else if( value == B0100 )
digitalWrite( 3, LOW );
mySwitch.resetAvailable();
}
}