Description
These 433MHz RF module is consisted of transmitter and receiver, popularly used for remote control. are very popular among the Arduino tinkerers. The 433MHz is used on a wide variety of applications that require wireless control.
Specifications RF 433MHz Receiver
- Frequency Range: 433.92 MHz
- Modulation: ASK
- Input Voltage: 5v
Specifications RF 433MHz Transmitter
- Frequency Range: 433.92MHz
- Input Voltage: 3-12V
How to get started with 433Mhz RF transmitter and receiver link kit for Arduino
In this section, we’ll build a simple example that sends a message from an Arduino to another Arduino board using 433 MHz. An Arduino board will be connected to a 433 MHz transmitter and will send the “Hello World!” message. The other Arduino board will be connected to a 433 MHz receiver to receive the messages.
Step1: Hardware required
1) 2 Arduino Board
2) 433MHz transmitter-receiver module .
3) jumper wire .
4) 2 Breadboard
5)External Power supply
Step2: Connecting the Hardware
The wiring for the transmitter is fairly simple. It has only three connections. Connect the VCC pin to 5V pin and GND to ground on the Arduino. The Data-In pin should be connected to Arduino’s digital pin #12. You should try and use pin 12 as by default the library we’ll be using in our sketch uses this pin for data input.
Once you have the transmitter wired you can move on to the receiver. The wiring for the receiver is just as easy as the transmitter was.
Once again there are only three connections to make. Connect the VCC pin to 5V pin and GND to ground on the Arduino. Any of the middle two Data-Out pins should be connected to digital pin #11 on the Arduino.
Now that both the transmitter and receiver are wired up we will need to write some code and send it to the respective Arduino boards. Since you probably have only one PC, we will start with the transmitter. Once the code has been loaded there, we’ll move on to the receiver. The Arduino to which transmitter is connected can then be powered using a power supply or battery.
Step3: Setting up the library
Before we start coding, there is a library called RadioHead we will need to install into our Arduino IDE that will make writing the code a lot simpler.
RadioHead 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 library, just click this RadioHead.Zip to download the zip: RadioHead.Zip
To install it, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library, and then select the RadioHead file that you just downloaded.
Step4: Upload the sample sketch
In our experiment we will just send a simple text message from the transmitter to the receiver. It will be helpful to understand how to use the modules and can serve as the basis for more practical experiments and projects.
Here is the sketch we will be using for our transmitter:
// Include RadioHead Amplitude Shift Keying Library
#include <RH_ASK.h>
// Include dependant SPI Library
#include <SPI.h>
// Create Amplitude Shift Keying Object
RH_ASK rf_driver;
void setup()
{
// Initialize ASK Object
rf_driver.init();
}
void loop()
{
const char *msg = “Hello World”;
rf_driver.send((uint8_t *)msg, strlen(msg));
rf_driver.waitPacketSent();
delay(1000);
}
NOTE: If you get stray in program the problem is with your “and” characters .Replace them with ordinary quotes “. And you should be fine.
Connect the receiver Arduino to the computer and load the following code:
// Include RadioHead Amplitude Shift Keying Library
#include <RH_ASK.h>
// Include dependant SPI Library
#include <SPI.h>
// Create Amplitude Shift Keying Object
RH_ASK rf_driver;
void setup()
{
// Initialize ASK Object
rf_driver.init();
// Setup Serial Monitor
Serial.begin(9600);
}
void loop()
{
// Set buffer to size of expected message
uint8_t buf[11];
uint8_t buflen = sizeof(buf);
// Check if received packet is correct size
if (rf_driver.recv(buf, &buflen))
{
// Message received with valid checksum
Serial.print(“Message Received: “);
Serial.println((char*)buf);
}
}
NOTE: If you get stray in program the problem is with your “and” characters .Replace them with ordinary quotes “. And you should be fine.
Step5: Testing the circuit
After loading the sketch open your serial monitor. If all is OK you should see your message.