RF Module (Transmitter & Receiver)

  • The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation is known as Amplitude Shift Keying (ASK).
  • Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources.
  • This RF modulecomprises of an RF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps – 10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter.
  • The RF module is often used along with a pair of encoder/decoder. The encoder is used for encoding parallel data for transmission feed while reception is decoded by a decoder. HT12EHT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair ICs

Features:

  • Input Power supply – 5 Volts
  • Compatible for Both RF 433/ 315 Mhz
  • Renesas controller Based
  • Rdy to Interface upto 8 Bit Data
  • UART TTL o/p – Baud Rate – 4800
  • Package Includes with RF Tx Rx

 

Transmitter Circuit

Wire the transmitter module to the Arduino by following the next schematic diagram.

 

Important: always check the pinout for the transmitter module you’re using. Usually, there are labels next to the pins. Alternatively, you can also take a look at your module’s datasheet.

Transmitter Sketch

Upload the following code to the Arduino board that will act as a transmitter.

#include <RH_ASK.h>#include <SPI.h> // Not actually used but needed to compile 

RH_ASK driver; 

void setup()

{    Serial.begin(9600);          // Debugging only   

if (!driver.init())   

      Serial.println(“init failed”);

} 

void loop()

{    const char *msg = “Hello World!”; 

   driver.send((uint8_t *)msg, strlen(msg)); 

   driver.waitPacketSent(); 

   delay(1000);}

Receiver Circuit

Wire the receiver module to another Arduino by following the next schematic diagram.

Important: always check the pinout for the transmitter module you’re using. Usually, there are labels next to the pins. Alternatively, you can also take a look at your module’s datasheet.

Receiver Sketch

Upload the code below to the Arduino connected to the receiver.

#include <RH_ASK.h>

#include <SPI.h> // Not actualy used but needed to compile 

RH_ASK driver; 

void setup()

{ 

   Serial.begin(9600);        // Debugging only   

if (!driver.init()) 

        Serial.println(“init failed”);

}

 void loop()

{    uint8_t buf[12];   

uint8_t buflen = sizeof(buf);

    if (driver.recv(buf, &buflen)) // Non-blocking   

{      int i;      // Message with a good checksum received, dump it.     

Serial.print(“Message: “); 

     Serial.println((char*)buf);             }

}

Demonstration

In this project the transmitter is sending a message “Hello World!” to the receiver via RF. Those messages are being displayed in receiver’s serial monitor. The following figure shows what you should see in your Arduino IDE serial monitor.

WhatsApp us whatsapp