I have been asked to build a remote-controlled on/off function for an air rade siren. My knowledge of RF communication is very limited. I do understand Arduino somewhat so the control of the DC motors on the sirens is not part of the problem. I have an "RX480-E" 4 channel 433MHZ receiver and a "GV706-G" 2 channel 433MHZ transmitter key fob type remote that use to control a relay driven garage door opener. When I try to pair the transmitter to the receiver. The receiver indicates it was successful, after that I'm not sure where to go.
Parts available:
Arduino-UNO
Receiver
Transmitter
Varius electronic components
I'll attach some photos and the section of code for the RF stuff
#include <RH_ASK.h> //I'm using the Radio Head library
#include <SPI.h> //I notest that when I use the SPI library the serial monitor won't work.
//object
RH_ASK rf_driver;
//input from receiver
int data_0 = 11;
int data_1 = 10;
int led_0 = 13; //if I can get the BUILTIN led to respond I can go from there.
void setup() {
// initalize object
rf_driver.init();
//serial setup
Serial.begin(9600);
pinMode(data_0, INPUT);
pinMode(data_1, INPUT);
pinMode(led_1, OUTPUT);
}
void loop() {
if (data_0 == HIGH)
{
digitalWrite(led_0, HIGH);
delay(1000);
}
else
{
digitalWrite(led_0, LOW);
delay(1000);
}
}