Invalid syntax for [github owner="..." repo="..." latest]

Radio Support

Similar to IR, radio frequency (RF) is used in common devices for wireless communications. Basically, RF are electromagnetic waves that were radiated off into space by a conductor. In order to receive RF signals, an antenna must be used to catch those electromagnetic waves and a radio tuner to isolate a specific frequency out of those signals.
Usually one can buy RF sender/receiver that are already assembled with a conductor and an antenna using a tuned circuit to amplify the radio waves of a specified frequency. Especially amplitude modulated (AM) radio waves around 433Mhz are widely used in devices such as remote power outlet sockets or event wireless smoke detectors.

Remote Power Outlet Socket

433 MHZ RF Receiver and Sender

Software

We found an Arudino library rc-switch that can be used to send and receive RF codes using a 315/433Mhz AM transmitter or receiver as described. To receive and decode radio signals, the receiver must be connected to an Arudino PIN supporting interrupts. The library will attach a software interrupt handler that will measure the duration of consecutive high and low pulses in order to finally decoded them into an appropriate bit string. Furthermore the pulse length can be determined from the so called raw timings by assuming a fixed bit length i.e. 32bit. Sending a radio signal via a RF transmitter is done by setting the digital output of the connected PIN to high and low within the correct time intervals and pulse length. Similar to the IR signals, we don’t want to use protocols for radio but use the said raw timings in order to support a wider range of devices.

Hardware

We used an already assembled and ready to use 433Mhz RF receiver and emitter. As mentioned, the receive must be added to an appropriate PIN supporting interrupts. Since we listen to interrupt (IRQ) 0, we have to use PIN 2 which is attached to IRQ 0 for the Arduino Ethernet Board we used in this project. Both, the receiver and the emitter can be run using the standard 5V power input. Optionally, a status LED light can be attached to PIN 6 which indicates the sending and receiving of RF signals and might be very useful for debugging.

The default PIN and IRQ configuration is defined in server.h and can be adapted to your needs in main.cpp as follows:

HomeControlServer hcs;

// PIN connected to DIN of sender.
hcs.enableRFOut(RF_SEND_PIN /* 7 */);

// IRQ attached to PIN connected to DOUT of receiver.
// See http://arduino.cc/en/Reference/AttachInterrupt for details.
hcs.enableRFIn(RF_RECV_IRQ /* 0 */);

// PIN connected to the positive (long) leg of the status LED.
hcs.enableRFStatus(RF_STAT_PIN /* 6 */);