Complete Guide for RF 433MHz Transmitter/Receiver Module With Arduino

This post is a guide for the popular RF 433MHz Transmitter/Receiver modules with Arduino. We’ll explain how they work and share an Arduino project example that you can apply to use in your own projects.

We have other tutorials about the 433MHz transmitter/receiver that you may found useful:

Description

Throughout this tutorial we’ll be using the FS1000A transmitter and corresponding receiver, but the instructions provided also work with other 433MHz transmitter/receiver modules that work in a similar fashion. These RF modules are very popular among the Arduino tinkerers and are used on a wide variety of applications that require wireless control.

These modules are very cheap and you can use them with any microcontroller, whether it’s an Arduino, ESP8266, or ESP32.

Specifications RF 433MHz Receiver

Specifications RF 433MHz Transmitter

Where to buy?

You can purchase these modules for just a few dollars. Click here to compare the RF 433MHz transmitter/receiver on several stores and find the best price.

Arduino with RF 433MHz Transmitter/Receiver Modules

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.

Parts Required

You need the following components for this example:

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Installing the RadioHead Library

The RadioHead library provides an easy way to work with the 433 MHz transmitter/receiver with the Arduino. Follow the next steps to install that library in the Arduino IDE:

  1. Click here to download the RadioHead library. You should have a .zip folder in your Downloads folder.
  2. Unzip the RadioHead library.
  3. Move the RadioHead library folder to the Arduino IDE installation libraries folder.
  4. Restart your Arduino IDE

The RadioHead library is great and it works with almost all RF modules in the market. You can read more about the RadioHead library here.

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. This is based on one of the examples provided by the RadioHead library.

#include #include // 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()

How the transmitter sketch works

First, include the RadioHead ASK library.

#include

This library needs the SPI library to work. So, you also need to include the SPI library.

#include

After that, create a RH_ASK object called driver .

In the setup(), initialize the RH_ASK object by using the init() method.

Serial.begin(9600); // Debugging only if (!driver.init()) Serial.println("init failed");

In the loop() , we write and send our message. The message is saved on the msg variable. Please note that the message needs to be of type char.

const char *msg = "Hello World!";

This message contains the “Hello World!” message, but you can send anything you want as long as it is in char format.

Finally, we send our message as follows:

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

The message is being sent every second, but you can adjust this delay time.

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. This is based on one of the examples provided by the RadioHead library.

#include #include // 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); >> 

How the receiver sketch works

Similarly to the previous sketch, you start by including the necessary libraries:

#include #include

You create a RH_ASK object called driver :

RH_ASK driver;

In the setup() , initialize the RH_ASK object.

void setup()< Serial.begin(9600); // Debugging only if (!driver.init()) Serial.println("init failed"); >

In the loop() , we need to set a buffer that matches the size of the message we’ll receive. “Hello World!” has 12 characters. You should adjust the buffer size accordingly to the message you’ll receive (spaces and punctuation also count).

uint8_t buf[12]; uint8_t buflen = sizeof(buf);

Then, check if you’ve received a valid message. If you receive a valid message, print it in the serial monitor.

if (driver.recv(buf, &buflen)) < 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.

receiver serial monitor

Wrapping Up

You need to have some realistic expectations when using this module. They work very well when the receiver and transmitter are close to each other. If you separate them too far apart you’ll lose the communication. The communication range will vary. It depends on how much voltage you’re supplying to your transmitter module, RF noise in your environment, and if you’re using an external antenna.

If you want to use 433 MHz remote controls to communicate with your Arduino, follow this tutorial: Decode and Send 433 MHz RF Signals with Arduino.

If you are an Arduino beginner, we recommend following our Arduino Mini Course. It will help you quickly getting started with this amazing board (and it is free!).

You may also like the following resources:

Share this post with a friend that also likes electronics!

If you like this post probably you might like my next ones, so please support me by subscribing our blog.

Thanks for reading.

January 19, 2019



SMART HOME with Raspberry Pi, ESP32, ESP8266 [eBook]

Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…

ESP32 PWM with Arduino IDE Analog Output LED

ESP32 PWM with Arduino IDE (Analog Output)

ESP8266 NodeMCU with Firebase Creating a Web App Arduino IDE

ESP8266 NodeMCU with Firebase – Creating a Web App

MicroPython BH1750 Ambient Light Sensor with ESP32 ESP8266 NodeMCU

MicroPython: BH1750 Ambient Light Sensor with ESP32/ESP8266

Enjoyed this project? Stay updated by subscribing our newsletter!

147 thoughts on “Complete Guide for RF 433MHz Transmitter/Receiver Module With Arduino”

Robert L. Pendergast, N5JYW Thanks. Useful guides. Reply You’re welcome Robert! Reply wey kokorobert Reply

This really needs some actual range capability data: line of sight, through one interior wall (drywall with wood studs), same with metal studs, through one concrete block wall, etc. Reply

Yes you are right. Thamks for the comment John! Reply

Hi! Nice and simple tutorial! I was looking for different options for Wireless COMM, and 433 MHz is the frequency I am most interested in. I have two questions: – On the serial communication with the transmitter/receiver, does it work with different data rates other than 9600? (Up to 115200 , for example). – Does each module work as both transmitter and receiver? By the pictures it seems that they only perform transmitting or receiving but not both. Thank you very much!
Javi Reply

You’re welcome Javier.
1) Yes, you can use any baudrate
2) No, they only perform one task. If you’re looking for a module that offers both Transmit and receive, you should search for this module nrf24l01. (You can use that module with he RadioHead library)
It’s a great module for wireless communication too. I’ll be posting a guide for that module in a couple of weeks. Reply

Awesome Work! Reply

I picked up a couple of these on eBay a few months ago with a vague idea of testing their functionality, so this rather useful little guide is quite timely. Thank you. Reply

I’m glad you found it useful! Let me know how this tutorial works out for you.
Have a great day,
-Rui Reply

Then what if another project is using the exact same module? Will it have interference? Reply

Yes, that’s true. All modules communicate at the same radio frequency 433MHz. So they’ll interfere with each other. but you can add if statements and verify if that message makes sense or not. I hope this helps! Reply

Good tute but I would have preferred one on cloning a garage remote…. Thanks anyway. 🙂 Reply

Hi Louis, I have something similar here: https://randomnerdtutorials.com/arduino-control-220v-lamps-from-anywhere-in-the-world/
That’s where I clone a remote control. I hope this helps.
-Rui Reply

Hello Luis,
I was playing with some modules today, they work great as soon as you equip them with antennas… Then I found this: instructables.com/id/Decoding-and-sending-433MHz-RF-codes-with-Arduino-/ Reply

Useful guide, thanks a lot Rui Reply You’re welcome Trung. Reply Does it support other than arduino platform? Reply

Yes, you can use with any microcontroller, but you have to write your own code or find a library for this module. Reply

Sanyaade Adekoya

Cool project, I have some RF 433MHz Modules lying around. May be I should give a short during the weekend 🙂 Reply

Awesome! Let me know how it works out for you Sanyaade! Reply

Hi dear Rui,
Really u r doing great job for those r new to arduino.
And am preparing second arduino by myself on the bredboard , I think it should work well, send some gsm based project using arduino.
Thanks,
Ramesh, india Reply

Awesome! Can’t wait to get home and try it. Thanks for your work
Charley Reply Let me know how it works out for you Charley. Reply Sneha pawar Thanks sir, It’s help whom new for arduino for how to handle and deal with it Reply nice,
can we on off home appliances with IR transmiter. Have any project? Reply Yes you can, but I don’t have any project on that subject… Reply Thanks.Relay Useful guides. Reply You’re welcome! Reply

Many thanks Rui,
This is my first foray into RF transmition and found this instructable very useful.
I made up my own prototype boards for the NANO and had this running inside an hour (after spending two days making the proto boards). I now have a basic understanding of RF data transfer and am now looking at working out how to send command instructions via RF. I am currently testing different length antenae for these units and shall see if there is a marked difference in length and cable type. Lance. Reply

Hi Lance,
Awesome! I’m glad you found this guide useful.
It’s a great addition to those modules. Adding an antenna can increase greatly the distance that these modules can talk. Reply

Hi,
Thanks for sharing these excellent tutorials.
My experience with the receiver is to power it from 3.3 Volts , got better range. Maybe less noise ?
Do you have any plans for a tutorial based on Arduino and GSM module ? Like SIM900 ? Reply

Hi Nils,
Thanks for sharing your results. Right now I have to finish other projects first, but that module is definitely on my to-do list! Reply

Hi again, forgot to mention that these modules need an antenna. A 17 cm thin wire will do. Reply What is evrage range ? Reply It will vary depending on RF noise in your work environment, antenna and power supply… Reply Sebastian L

Greawork and thank you very much! Very useful! I have a question regarding the ports to be used. How does the arduino board know where you have connected the receiver or transmitter too? Thanks again!! Reply

You can go to your device manager (if you’re on windows) and plug one of your Arduino boards. It will tell you which COM port it is using.
Then connect the other Arduino board to also check its COM port Reply

Hi, I did everything in you guide but get nothing in serial. Did the exact same setup and copied and pasted the code and still nothing. What could be the issue? Ive spent over 1 week and im still stuck, please help Reply

Hi Andrew,
I know that it can be frustrating not finding the issue. I’m not sure what it is based on what you’ve said….
It can be a problem with your Arduino, wire connections, copying and pasting the code.
Or a problem with a component that is defective… Reply

Hi, great tutorial. But my RF module communication seems unreliable and slow. What can I do to increase the range of these buggers and also have reliable communication? (I’m using arduino uno and nano)
thnx Reply

Add an antenna to the modules and make sure you are powering them with the max voltage they can handle. That will increase their range Reply

is the frequency variable or is it fixed Reply These modules always operate at 433MHz Reply chevalier pierre

Hello I used a DS18B20 to sense the temperature with Arduino
I use a 433mhz transmitter to send the temperature on my raspberry
the raspberry I have the receiver, and then I store the temperature in a database
if Arduino and raspberry are close (20 cm), no problem, I get the temperature
if I remove the raspberry Arduino, I get nothing
the transmitter and receiver antenna
can you help me ?
best regards Reply

Hello,
Connect a 17 cm antenna to both transmitter and receiver. This will improve range. Remember the datarate is only about 2000 bits/sec Reply

Hi, How can i read the 315mhz 4 buttons remote control using radiohead into the arduino? Reply You’re welcome! Reply Carlos Rincon thanks Works at Once, 1 question, i want to make same but Attiny84 and 85 Reply I’m glad it worked, but I don’t have any tutorials on that exact subject. Rui Reply

Thanx alot for this great ‘to the point’ guide!
A question:
Will the receiver work for ‘any’ messages sent on this frequency? I installed a firealarm that sends messages between the detectors at this frequency and these messages are not read as I expected but maybe they are of a different type? Reply

It should receive any type of message, just be careful with the data types Reply

Hi, is it possible to check the signal strength by sending I.e. 100 packets and checking how many was received, thus 100% would be the effective strength. Reply

I think there’s already an example that shows the signal strength for these modules if you search for it, but I’m not 100% sure Reply

thanks. good example. can I use this transmitter receiver 433 MHz for continous signal like sine curve Reply

You should be able to use the transmitter to constantly send data, but I’m not sure what you mean by signal like sine curve Reply

thank for your collaboration. I need to send one signal like sine or cosine wave. and receive it on a separate arduino. can you help me on a program to apload on Arduino (transmiter and receiver) Reply

Bradley Walden

Hi. great tutorial. I have two questions:
1. Would this work if I used one arduino connected to the receiver and this usb to serial connector attached to the transmitter (arduino.cc/en/Main/USBSerial)
2. Is there someway that I could make it work by connecting the receiver/transmitter modules to the RX/TX pins (pins0&1) on the arduino? Reply

You’ll actually need an Arduino connected to the transmitter. If you use an Arduino nano it also has serial capabilities and it’s smaller than an Arduino UNO Reply

Bradley Walden

How would I be able to send signals from my computer through the serial monitor to the Arduino wirelessly Reply

Troy Schmidt

So I will of course try to figure it out,, but maybe I will struggle over a very common desire. I want to transmit joystick values over the 433 mhz unit, How to send various sensor data and decode it to various output?? Reply

I don’t have an example to that exact application. Thanks for asking,
Rui Reply

Hello Ruy thanks for great tutorial!
I have a question. I have two arduinos and I run the programs explained.
The output is “Hello World!” plus some garbage charactecters at the end (e.g. #).
I’ve tried to make the receiver buffer (uint8_t buf[12) smaller (or bigger), but the problem remains.
Any idea how to solve this?
Thanks Reply

Failure to null terminate the string. You can either send the null terminator over the rf channel (strlen(msg)+1), or add it on the receiver side as follows. void loop()
uint8_t buf[20];
uint8_t buflen = sizeof(buf)-1;
if (driver.recv(buf, &buflen)) // Non-blocking
buf[buflen] = 0; // null terminate string
// Message with a good checksum received, dump it.
Serial.print(“Message: “);
Serial.println((char*)buf);
>
> Reply

Campbell Stubbs

Hi
I’ve been trying to upload the receiver sketch and everytime it says “Stray /240 in program”
I copied it straight from your website. Please help Reply

I’ve never encountered that error, so I’m not sure what’s having problem. Regards,
Rui Reply

Dear Rui, My module works with 5V, so please ignore my first post. I have another question: why is the reciever module data on digital pin 11 of the arduino? I see no declaration of this pin as input in the code. Would it work on digital pin 9 as well? The reason is that I would like to write the data to an SD card so I need the pin 11 for that. thank you for your support Sebas Thank you Reply

You can change the pins, but you need to read the documentation to do that and configure the pins with the library configuration Reply

Otto Klaasen

Hello Sir, to change the pin change following in the code for the transmitter: // RH_ASK driver;
// 2000=speed,2 = RX,4 = TX, 5 push to talk
RH_ASK driver(2000,2,4,5); // Pin4 = TX Connect your pin 4 to the transmitter module. For the receiver same: // RH_ASK driver;
// 2000=speed,2 = RX,4 = TX, 5 push to talk
RH_ASK driver(2000,2,4,5); // Pin4 = TX Connect pin 2 to the receiver module. Code has been tested with Arduino Nano, with ATTINY it did not work, had to use some other code with the manchester library. Kind Regards
Otto Klaasen Reply

Lukáš Baťa

Hello, i recieve

Message: Hello World!
Ď

with D below, please could you help me where is problem? I have same code as u. Reply

I’m not sure… that shouldn’t happen Reply

That’s awesome work
and I have one question to ask you about “Can they sending data in ‘float’ ?”
Because I’m use RF 433 mhz module to sending voltage value from analog pin but
they can’t receive it Reply

Yes, you should be able to send floats (or convert them to string), but I don’t have any tutorial on that specific subject Reply

Thanks a lot … Reply

I read your Complete Guide for RF 433MHz Transmitter/Receiver Module With Arduino. In the Transmitter Circuit it advises to Then upload the code below. But I cannot see any code to upload. Please advise where to find this code. Thanks
Rob Reply

Sara Santos

Hi Rob.
The code is shown in the blog post.
However, if you’re having trouble seeing that, you can get the code in this link raw.githubusercontent.com/RuiSantosdotme/Random-Nerd-Tutorials/master/Projects/433MHz/transmitter.ino
I hope this helps 🙂 Reply

Hi, it is possible to change the Data pin on TX and RX? Reply Sara Santos

You can do that. But it is not recommended, since those pins are used by the Arduino when it uses serial communication (this means it uses those pins when you’re uploading code and when you use the serial monitor). If you really need to use those pins to receive data, you need to disconnect the connections on the TX and RX pins when you upload code.
Additionally, the library doesn’t use those pins by default. So, you also need to make some changes to the library code (which we don’t recommend). I hope this helps.
Regards,
Sara Reply

Hello Rui,
I couldn’t make it work. Receiver doesn’t get the messages. Do I need to do something
with pttPin pin? The doc says – “The pin that is connected to the transmitter controller. It will be set HIGH to enable the transmitter (unless pttInverted is true).” Do I need to set it to HIGH to enable transmission. What are the steps to debug the problem? How can I check if it is broken module, circuit or code? Reply

The modules are very inexpensive and sometimes they come broken. Can you grab another receiver and test to see if it’s working? Reply

Thank you for prompt reply. I will test it with another module. Is there way to check if it is receiver’s or transceiver’s issue? Or I have to try all permutations :)? Also what about this pttPin? Should I do something with it? Is there a way to test communication in one Arduino – for example connect Tx and Rx pins? Reply

thank you very much for this manual. helped a ton ! Reply Sara Santos You’re welcome! Reply

Thanks for a great tutorial. I am sending some binary code from the transmitter to the receiver and it is coming through fine and printing to the serial monitor. However, I am having trouble saving that binary code to a int variable so I can use it with a conditional statement like the if statement. What am I missing here. John Reply

Hi John, I don’t have any examples on that exact subject, but if you search something like “convert binary to int Arduino”, you should be able to find an example similar to what you’re trying to do. Sorry I couldn’t offer much help for your specific problem. Regards,
Rui Reply

Casey lawton

I’m getting a “No such directory found” error when verifying the code. It seems to be coming from the #include
#include libraries. I did add them like a usual… Any ideas where I messed up?? Thanks! Reply

Sara Santos

Hi Casey.
Many of our readers have several versions of the Arduino IDE installed. If that is your case, please verify that you have the libraries installed in the right Arduino IDE version.
Regards,
Sara 🙂 Reply

Me need to a program of Arduino Program is Arduino transmitter and receiver…
Please… Give me Reply Sara Santos

Hey I’m a noob in this… I’m using an arduino pro mini I wanna know what should be the connections for transmitter circuit in arduino pro mini Reply

Sara Santos

Hi Chinmoy.
You can use the same connections.
Connect the data pin of the transmitter to Pin 12, GND to GND, and the power pin to VCC. Here’s the pinout for the Arduino Pro Mini, it might help: cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/ProMini8MHzv1.pdf
Regards,
Sara Reply

hello sir
everything works fine but i am not receiving anything in my serial monitor
help me please
thanking you in advance Reply

Sara Santos

Hi.
Are both Arduino boards running at the same time?
They need to be close to each other so that the receiver can get the transmitter messages.
Also, make sure that you have just the receiver board with the serial monitor opened.
Regards,
Sara Reply

Umar Muhammad Thanks again. Can I connect the transmitter/the receiver to any pin of the arduino? Reply Sara Santos

Hi Umar.
The libray we use in this example, uses Pin 12 for the transceiver circuit and Pin 11 for the receiver circuit by default.
You can change that on the library file, if needed.
Regards,
Sara Reply

i follow tutorial and work well, but I don’t see where you configure the pin 12 in transmitter and where you configure pin 11 in recever. it is because is already configure in radiohead libraries or something else thanks Reply

Sara Santos Hi.
Those pins are already configured by default in the library.
Regards. Reply barney rigney

an absolute “green pea” question, I want to run a dc motor with a “hold to run” foot pedal switch, the motor stops when the foot pedal switch is released. the distance from the transmitter to the receiver is no more than 6′,; what do I need to do this? Reply

Sara Santos

Hi Barney.
Have you taken a look at the Arduino debounce sketch example?
I think it might help. The example turns on an LED while the button is pressed. Instead of turning the LED on, send a message to the RF transmitter. When the button is not being pressed send a different message to make the motor stop.
You can access the debounce sketch example in your Arduino IDE under File > Examples > 02.Digital > Debounce
Let me know if you need further help.
Regards,
Sara Reply

Hi,
I noticed that in the transmitter, port 12 was used for the signal output. But it does not appear in the codes. Was it the right code?
Appreciate your comments. Thank you. Reply

Sara Santos Hi Kman.
The pin is automatically set by the library.
Regards,
Sara Reply

Hey guys, Thank you very much for sharing
I have a question for you: I tried to create a similar project but using either a ESP32 or NODEMCU8266 instead of Arduino Uno or Nano. The problem is that none of the message transmitting libraries work with those processors (VirtualWire, Radiohead). Any idea on how can make the ESP32 talk to a Nano through 433Mhz Tx/Rx ? Thanks! Reply

Hi — GREAT tutorial. However, I have a problem. I want to use the Arduino 433MHz and 315MHz pair for a pair of walkie-talkies and want to power the receivers all the time. They work fine (actually hi-fi audio up to 10 kHz since I’m using PWM modulation, but change the Rx comparator to an LM393 for faster switching) but the Rx modules oscillate when powered but without a received signal. Can anything be done to remedy this? Thank you in advance. Reply

paulo lima Hi.
I cant find the library RH_ASK
Can uou help, thanks. Reply William McLean

Hi Paulo, If you do an online search for the Radiohead library, it’s in there.
When I use it I have to include radiohead then delete what I don’t need. Bill Reply

Paulo Lima Hi, thanks.
Later i solved i found and instal, but thanks dor the help. Reply Peter Tasker

Need to use Library RadioHead – 1.84
I spent many hours trying to debug this using the SparkFun RadioHead library and it doesn’t work with that library version. Reply

Absolutely no explanation whatsoever of why pins 11 and 12 are used nor any explanation on where to go for more information regarding pin choice. Your tutorials are incredible; this is sub-standard for your normal quality of work. Reply

Sara Santos

Hi Michael.
You are right.
This tutorial is a little bit outdated.
It uses those pins because those are the default pins used by the library.
Regards,
Sara Reply

ola, preciso trocar informações entre 2 esp32. Esse código esta dando erro ao compilar… Serve pro esp32? Reply

Sara Santos Este código é para Arduino.
Mas qual é o exatamente o erro?
Regards,
Sara Reply Bill Richards

I’m pretty in awe of the fact that you’ve literally taken the example code from RadioHead/examples/ask/ask_receiver/ask_receiver.pde, and
RadioHead/examples/ask/ask_transmitter/ask_transmitter.pde
and not cited these files at all. Sure you’ve added some explanation, but you did not write those examples, and it is very dishonest of you to not give credit to the library authors in this instance. Reply

Sara Santos

Hi Bill.
I’m really sorry about that.
This was one of our very first tutorials. Back from 2013.
We were still learning the best way to share content at the time.
That detail was missing. I’ve fixed that.
Thanks for pointing that out.
All our recent tutorials have links to their references.
Regards,
Sara Reply

Bill Richards

There are also plenty of people asking about how to change the designated pins and your response is about “modifying the library”, why on earth would you tell people to do that? RH_ASK(uint16_t speed = 2000, uint8_t rxPin = 11, uint8_t txPin = 12, uint8_t pttPin = 10, bool pttInverted = false);
The constructor for RH_ASK offers the correct way to configure input and output pins Reply

Sara Santos You’re right.
Thanks for sharing that.
Regards,
Sara Reply

Hi, how to invoke the constructor with my own speed and pins? Could you make an example please? Actually I was searching for a comment like yours but I still don’t get how to call with the constructor without modify the source code of the library Reply

can i use the receiver without an arduino? Reply

Do you need to use the digital pin shown as I am using this in conjunction with a TFT screen shield and the pins are already used. Reply

Hi, how to invoke the constructor with my own speed and pins? Could you make an example please? Actually I was searching for a comment like yours but I still don’t get how to call with the constructor without modify the source code of the library Reply

RAJA REDDY

Sir the aurdino board only transmits when it is connected to a computer or a laptop. What should we do if we want to transmit the signal from aurdino when it is connected to a power source like battery? Reply

Sara Santos

Hi.
Make sure you’re powering the Arduino properly.
After that, press the on-board RESET button to restart the board.
Regards,
Sara Reply

so you are missing something, for me it works without computer.
be sure to connect the battery to the correct place and supply the needed power to the board. Reply

Issac Peña

Really good tutorial, thanks If I understood right, the RH library by default prepare both pins (tx and rx pins), so, In the arduino which is transmitting, what happened if I connect something in the rx pin?
I mean, if I am transmitting I will use the tx pin only, it could be useful if I can tell the RH library to do not use the rx pin because I will not use in this arduino, just in the other one with receiver part
Is it possible to setup RH library to use only tx pin in transmitter and only rx pin in receiver in order to let free as much pins as possible?
Thanks Reply

Disculpa bro una pregunta
estas librerias tambien puedo utilizar para poder controlar un servo o me podria causar problemas de complilacion ? Reply

Stephen Fox

Grateful for your tutorial. Tried several others without success. Yours worked first time. Newbie question “int i” in void loop() – I can’t see where “i” is used? Reply

Sara Santos

Hi.
You can remove that variable declaration.
It’s not used in the code. It’s a bug. We’ll fix that.
Thanks for pointing that out.
Regards,
Sara Reply

Hi.
I have been trying to get this tutorial to work for weeks now with no success. I am on my third set of modules, the first two were cheapies from Ebay and when they did not work I purchased some better quality ones from Rapid Electronics and these came with a datasheet. I am using a QUASAR QAM-TX2-433 transmitter and a RF SOLUTIONS AM-RX9-433P receiver. The sketches I copied and pasted into the IDE from your example and made one alteration in the Void Setup. I have included the statement ‘ else Serial.println(” init passed “); ‘ so that I am not left with a blank serial monitor. It appears that the setup is completing okay in both cases. The connections are made as per the datasheet (my receiver module has eight pins and all have been connected. I have also re-installed the Radiohead library, 1.121 the only one I could find, and Arduino SPI library from the Include Library folder. I am using Arduino Uno 1.8.19. I don’t know what else I can do. Difficult question but do you have any suggestions please? Thank you in advance.
Bob May Reply

Sara Santos Hi.
What is exactly the issue that you’re facing with your modules?
Regards,
Sara Reply

Hi.
Thank you for getting back to me. The problem is that I don’t think the transmitters are transmitting or that the receivers are not receiving. I have included Bitmap images of the sketches and serial monitor outputs of the modules. I have 2 x RX470C-V01 pairs of modules from Ebay and a QUASAR UK QAM-TX2-433 miniature AM transmitter and a RF Solutions AM-RX9-433P Receiver Super Het AM 433MHz SIL 5V receiver from Rapid Electronics. They all give exactly the same output. I am using the 5V supply from 2 x Arduino Unos. I have used several different sketches from other websites and none were successful. Maybe you can come up with a solution.
Thank you again.
Bob May Reply

Sara Santos

Hi.
These things are very difficult to troubleshoot.
Are you sure you’re connecting your modules correctly?
Regards,
Sara Reply

Hi, thank you for your help. So much for the “Easy to use, ideal for hobbyists” claim that the manufactures are making. I have spent months off and on trying to get these things to work with no success.
Anyway, I have checked, double checked and triple checked the connections and they are correct.
The receiver output on the serial monitor is “Message: □”. I have also been using the Arduino oscillator and the output on the transmitter side is a saw-tooth wave starting at 0v rising to about 500mv, and on the receiver side more of a sine wave the bottom at about 500mv and the top at about 1.5v. These measurements are taken from the Arduino A0 to the data pins on the modules.
I hope this information can help.
Thank you again.
Bob May

I have connected both the transmitter and Receiver modules on to one Arduino UNO and upload this code. I doesn’t get anything on the Serial Monitor. Please Help. Where is the issue. // Include RadioHead ASK Library
#include
// Include dependant SPI Library
#include // Create Amplitude Shift Keying Object
RH_ASK driver; void setup()
// Setup Serial Monitor
Serial.begin(9600);
if (!driver.init())
Serial.println(“init failed”);
> void loop()
// Set buffer to size of expected message
uint8_t buf[5];
uint8_t buflen = sizeof(buf); // Send a message to receiver
const char *msg = “Hello”;
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(2000); // Check if received packet is correct size
if (driver.recv(buf, &buflen))
int i;
// Message with a good checksum received, dump it.
Serial.print(“Received: “);
Serial.println((char*)buf);
> >

Larry Fostano

Hello Rui ;
Is there anyway to read door contact status using a ring wireless door contact without using a ring hub? Reply

Hi all
Very good tutorial I tried to compile on arduino board after installed radiohead library
but i catched that message C:\Program Files (x86)\Arduino\libraries\RadioHead/RadioHead.h:618:12: fatal error: util/atomic.h: No such file or directory Please help Reply

In fact the Radiohead library seems to be supported only on Arduino uno and not on ESP32?
please confirm Reply

I had the same problem. I ended up switching to HardwareSerial Reply

Hi, I would like to know whether I can use this module for multiple tasks. I want to get data from multiple different sensors in the transiver and get different outputs according to those inputs in receiver side. I am using Arduino pro mini on both sides. For example If an MPU-6050 module tilted to right side a red led should light up and when tilted to left a yellow led should light up. Reply

If you give each data its own code, you can decode it in the receiver. For example up and down etc etc But a number works easier. Reply

Dave Cross

First of all, thanks for all the very well documented projects! I have set up the transmitter on a Nano and receiver on a Mega 1280. When transmitting the receiver serial monitor display the expected message but also continues to print mostliy “U” until the line fills then starts again. Message: Hello World! 2UUUUUUUUUUUUUUUUUUUUUUIUUUUUUUUUUUU…
Message: Hello World! 2UUUUUUUUUUUUUUUUUUUUUUULUUUUUUUUUU… The transmitter and receiver are a couple of TWS-434A and RWS-434 modules I have had for years. Any thoughts would be appreciated. Reply

I do receive the “Hello World!” message in the serial monitor but it is followed by a series of characters that continue for several seconds before the next HW message displays. Message: Hello World! 2UUUUUUUUUUUUUUUUUUUUUUUIUUUUUUUU…
Message: Hello World! 2UUUUUUUUUUUUUUUUUUUUUUUULUUUUUU….
Message: Hello World! 2UUUUUUUUUUUUUUFUUUUUUUUUUUUIUUUU… The transmitter is a TWS-434a on a Nano and a RWS-434 RF receiver on a 1208 Mega.
Any thoughts? Reply