Getting started with RF module - Interfacing 433 MHz RF Transmitter and Receiver Module with Arduino Uno

Getting started with RF module - Interfacing 433 MHz RF Transmitter and Receiver Module with Arduino Uno

0 comments / Posted on by Quartz Components

Getting started with RF module - Interfacing 433 MHz RF Transmitter and Receiver Module with Arduino Uno

Believe it or not, we all are living in a wireless world now. Everything from your mouse to headphones, from cameras to TVs has ripped of their wires and adopted wireless technology. 433mHz RF modules are inexpensive module to provide your projects wireless connectivity.

Required Parts:

1. 433 Mhz RF Module

2. Arduino Uno

3. Arduino Uno Programming Cable

4. Breadboard - 2

5. Jumper wires

 

Getting started: Introduction

433Mhz RF-Module

Want to make your RC projects wireless? And don’t even want to spend money? Well, you don’t need to. These RF modules can be bought for barely the cost of a cup of coffee. I bet these modules are the best value for money product ever. On top of that, it is so tiny that you can embed it into any of your project and give them wireless functionality.

It works on the technique of Amplitude Shift Keying (ASK). But as this is a getting started tutorial. I won’t be getting much deeper in it. Instead let me just give you an overview on ASK technique.

 

Amplitude Shift Keying (ASK):

In Amplitude Shift Modulation the amplitude (i.e. the level) of the carrier wave is changed in response to the incoming data signal.  This is sometimes called Binary Amplitude Shift Modulation as there really are only two levels to be concerned with:

  • Digital 1 – This drives the carrier at full strength.
  • Digital 0 – This cuts the carrier off completely.

 

Getting started: Understanding the modules

433 MHz RF Transmitter and Receiver Module

 

Transmitter:

The smaller one among the two is the transmitter module. It is as simple as it looks. The heart of the module is the SAW resonator which is tuned for operation under 433 MHz frequency. There is a switching transistor and a few passive components, that’s it. No headache of connecting dozens of wire, it only needs three. Two for power and one for data.

Pin-outs of the transmitter:

 

Receiver: 

The above module is the receiver. Yeah, it does look a bit complex from the transmitter but believe me it is s as simple as the transmitter. It consists of a RF tuned circuit and a couple of OP Amps to amplify the received carrier wave from the transmitter. The received signal also passes through a PPL which check the noise. Same as the transmitter, this also requires three connection only. Two for power and one for data.

Pin-outs of receiver:

 

For this project we will be using these modules with Arduino UNO. You can use it with any micro-controller of your choice. These modules can also be used without be used without any micro-controller and also with HT12E encoder and HT12D decoder ICs.

 

Getting started: Connection

As I already have mentioned the connection is way easy. It is as simple as connecting an LED.

 

Transmitter part:

You just need to connect,

VCC to 5v pin of Arduino

GND to GND  of Arduino

And, Data to D12.

 

Receiver part:

Here also the connections are the same. But, this time connect the data pin to D11.

Arduino RF Transmitter Receiver Circuit DiagramConnection Of Receiver Part

 

Getting started: Installing the Radio-Head Library

For making our coding task easy we are using the Radio-Head library. Radio-Head is a library that allows simple data transfer between Arduino boards. It’s so versatile that it can be used to drive all sorts of radio communications devices, including our 433MHz modules.

You can download the Radio-Head library from the button below.

{I have provided a zip file along with the article please link that to the download button.}

 

You’ll be getting a zip file. Just unzip it and place the Radio-Head file to the libraries folder of Arduino IDE. And then open your Arduino IDE and be prepared as now we are jumping to the coding part.

 

Getting started: Coding

 

Transmitter part:

For the transmitter part, we will be writing a simple sketch that’ll just send “Hello world” to the other module.

You can either use our code OR can go to Examples > Radio-Head > ask > TX. Both of the code will do the exact same task.

 

#include <RH_ASK.h>

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

 

RH_ASK QuartzRF;

 

void setup()

{

   Serial.begin(9600);    // Debugging only

    if (!QuartzRF.init())

        Serial.println("init failed");

}

void loop()

{

  const char *msg = "Hello World!";

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

  QuartzRF.waitPacketSent();

  delay(1000);

}

 

Receiver part:

Now as our transmitter is sending something you need to receive it too. No? So we will be writing an sketch to receive whatever is being sent by the transmitter and print that in the Serial Monitor.

Again,

You can either use our code OR can go to Examples > Radio-Head > ask > RX. Both of the code will do the exact same task.

 

#include <RH_ASK.h>

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

 

RH_ASK QuartzRF;

 

void setup()

{

   Serial.begin(9600);  // Debugging only

    if (!QuartzRF.init())

       Serial.println("init failed");

}

void loop()

{

   uint8_t buf[12];

   uint8_t buflen = sizeof(buf);

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

   {

     int i;

     // Message with a good checksum received, dump it.

     Serial.print("Message: ");

     Serial.println((char*)buf);        

    }

}

 

Getting started: Action Time!

That’s all we have to code. Just upload both the sketches to transmitter and receiver respectively. Power up the transmitting end and connect the receiver to PC and open Serial Monitor. You’ll see Hello World getting printed in the Serial monitor.

For seeing the project in action. Watch the video linked below.

Believe it or not, we all are living in a wireless world now. Everything from your mouse to headphones, from cameras to TVs has ripped of their wires and adopted wireless technology. 433mHz RF modules are inexpensive module to provide your projects wireless connectivity.

Required Parts:

1. 433 Mhz RF Module

2. Arduino Uno

3. Arduino Uno Programming Cable

4. Breadboard - 2

5. Jumper wires

 

Getting started: Introduction

433Mhz RF-Module

Want to make your RC projects wireless? And don’t even want to spend money? Well, you don’t need to. These RF modules can be bought for barely the cost of a cup of coffee. I bet these modules are the best value for money product ever. On top of that, it is so tiny that you can embed it into any of your project and give them wireless functionality.

It works on the technique of Amplitude Shift Keying (ASK). But as this is a getting started tutorial. I won’t be getting much deeper in it. Instead let me just give you an overview on ASK technique.

 

Amplitude Shift Keying (ASK):

In Amplitude Shift Modulation the amplitude (i.e. the level) of the carrier wave is changed in response to the incoming data signal.  This is sometimes called Binary Amplitude Shift Modulation as there really are only two levels to be concerned with:

  • Digital 1 – This drives the carrier at full strength.
  • Digital 0 – This cuts the carrier off completely.

 

Getting started: Understanding the modules

433 MHz RF Transmitter and Receiver Module

 

Transmitter:

The smaller one among the two is the transmitter module. It is as simple as it looks. The heart of the module is the SAW resonator which is tuned for operation under 433 MHz frequency. There is a switching transistor and a few passive components, that’s it. No headache of connecting dozens of wire, it only needs three. Two for power and one for data.

Pin-outs of the transmitter:

 

Receiver: 

The above module is the receiver. Yeah, it does look a bit complex from the transmitter but believe me it is s as simple as the transmitter. It consists of a RF tuned circuit and a couple of OP Amps to amplify the received carrier wave from the transmitter. The received signal also passes through a PPL which check the noise. Same as the transmitter, this also requires three connection only. Two for power and one for data.

Pin-outs of receiver:

 

For this project we will be using these modules with Arduino UNO. You can use it with any micro-controller of your choice. These modules can also be used without be used without any micro-controller and also with HT12E encoder and HT12D decoder ICs.

 

Getting started: Connection

As I already have mentioned the connection is way easy. It is as simple as connecting an LED.

 

Transmitter part:

You just need to connect,

VCC to 5v pin of Arduino

GND to GND  of Arduino

And, Data to D12.

 

Receiver part:

Here also the connections are the same. But, this time connect the data pin to D11.

Arduino RF Transmitter Receiver Circuit DiagramConnection Of Receiver Part

 

Getting started: Installing the Radio-Head Library

For making our coding task easy we are using the Radio-Head library. Radio-Head is a library that allows simple data transfer between Arduino boards. It’s so versatile that it can be used to drive all sorts of radio communications devices, including our 433MHz modules.

You can download the Radio-Head library from the button below.

{I have provided a zip file along with the article please link that to the download button.}

 

You’ll be getting a zip file. Just unzip it and place the Radio-Head file to the libraries folder of Arduino IDE. And then open your Arduino IDE and be prepared as now we are jumping to the coding part.

 

Getting started: Coding

 

Transmitter part:

For the transmitter part, we will be writing a simple sketch that’ll just send “Hello world” to the other module.

You can either use our code OR can go to Examples > Radio-Head > ask > TX. Both of the code will do the exact same task.

 

#include <RH_ASK.h>

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

 

RH_ASK QuartzRF;

 

void setup()

{

   Serial.begin(9600);    // Debugging only

    if (!QuartzRF.init())

        Serial.println("init failed");

}

void loop()

{

  const char *msg = "Hello World!";

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

  QuartzRF.waitPacketSent();

  delay(1000);

}

 

Receiver part:

Now as our transmitter is sending something you need to receive it too. No? So we will be writing an sketch to receive whatever is being sent by the transmitter and print that in the Serial Monitor.

Again,

You can either use our code OR can go to Examples > Radio-Head > ask > RX. Both of the code will do the exact same task.

 

#include <RH_ASK.h>

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

 

RH_ASK QuartzRF;

 

void setup()

{

   Serial.begin(9600);  // Debugging only

    if (!QuartzRF.init())

       Serial.println("init failed");

}

void loop()

{

   uint8_t buf[12];

   uint8_t buflen = sizeof(buf);

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

   {

     int i;

     // Message with a good checksum received, dump it.

     Serial.print("Message: ");

     Serial.println((char*)buf);        

    }

}

 

Getting started: Action Time!

That’s all we have to code. Just upload both the sketches to transmitter and receiver respectively. Power up the transmitting end and connect the receiver to PC and open Serial Monitor. You’ll see Hello World getting printed in the Serial monitor.

For seeing the project in action. Watch the video linked below.

0 comments

Leave a comment

All blog comments are checked prior to publishing