I can't seem to get RF transmitter and receiver working

I'm trying to make a transmitter+receiver system using arduino. I'm using the 433Mhz Wireless transmitter and receiver, and the two boards that I'm using are Elegoo Uno, which is basically Arduino Uno. I followed Insight Into How 433MHz RF Tx-Rx Modules Work & Interface with Arduino this tutorial, and my goal is to send a message to the receiver. I downloaded the latest version of Radiohead and the code is exactly the same as that. The receiver and the transmitter have all been connected to the right places, like the data and VCC and Ground pins are all at the right places. I used the same port for uploading for both of them. After uploading the code into the transmitter, I put a battery into the transmitter, and so the code should keep on running. Then I imported the code into the receiver. But for some reason, the "hello world" just doesn't pop up on my serial monitor. For the pins, I have plugged into digital pin 12 for the transmitter, and 11 for receiver, because those are the default pins. I have looked into every possible problem, and I couldn't find a solution. Spent the last few days in frustration because of this problem. Any help would be appreciated. Thanks in advance

Hi @daniu13,

welcome to the arduino-Forum.

You have taken the effort to write down a pretty detailed description of what you have done and a link what source you used.

You are working on an informatic project and in an informatic project is most needed guess what?
Information.

Still much more information is needed for effectivly helping you.

It might well be that you added a single character that changed the code to be not working
and this is the reason why you should really post your code

If I would say "remove line 547 from your code"

Will this work? Surely not because without seeing this line of code this make really no sense.

post complete sketches

Post your complete sketches. From the very first to the very last line.
There is a shortcut with which this can be done with a few mouse-clicks and keypresses
It is described here

best regards Stefan

Additionally you should post a schematic of your wiring
do NOT post a fritzing picture!

A fritzing picture is NOT a schematic! fritzing pictures are annoying through:

  • too much details that are not relevant
  • do not follow rules how to draw schematics
  • take too much time to create them

Read this tutorial how to quickly create a schematic.

For posting pictures you have to do a few things that are easy to do
You have to reach trustlevel 1 through these activities:

Get to trust level 1 by…

  • clicking on 5 different threads
  • reading 30 postings (they must have been visible on the screen
  • beeing a minimum time of 10 minutes in the forum

best regards Stefan

You make an assumption. The code should be running.
There are mutliple reasons why your microcontroller might be not running:

  • broken Arduino
  • too weak battery
  • invisible broken wire
  • broken transmitter module (for what reason ever)
  • no antenna at all / no length matched antenna

And all these possible reasons must be checked to replace assumptions with real checking

does arduino still work?
load the basic blink-sketch that blinks the onboard led
After uploading the blink-sketch does the led really blink?

what voltage does the battery have?
To which input is the battery connected?
Post a picture of your real setup

Did you check if you have voltage between the 5V and the GND-pin?

Post a picture of your real wiring

What battery and where did you put it?

this is my code

#include <RH_ASK.h>
#include <SPI.h>
RH_ASK rf_driver;

void setup() {
// put your setup code here, to run once:

rf_driver.init();

}

void loop() {
// put your main code here, to run repeatedly:
const char msg="Hello World!";
rf_driver.send((uint8_t
)msg,strlen(msg));
rf_driver.waitPacketSent();

delay(1000);
}
#include <RH_ASK.h>
#include <SPI.h>
RH_ASK rf_driver;

void setup() {
// put your setup code here, to run once:

Serial.begin(9600);
rf_driver.init();
}

void loop() {
// put your main code here, to run repeatedly:
uint8_t buf[12];
uint8_t buflen=sizeof(buf);
if(rf_driver.recv(buf,&buflen))
{

Serial.print("Recieved");
Serial.println((char*)buf);

}
else {
Serial.println("No data received");
}
delay(1000);
}
Thanks for the reply, and sorry for the late reply. Anyways, my arduino works, battery is 9V and seems to work fine. However, I don’t have an antenna for my transmitter and receiver, would that by the issue? I have the transmitter and receiver right next to each other though. Also, how can I check if my transmitter and receiver is working? There doesn’t seem to be any tutorial on this. Thanks so much for the help by the way, I appreciate it a lot.


This seems to be contradictory to this

What dos this mean? Do you still have an issue that it is not working or does it work now?
Does it work reliably?

How close / how far do you have to place transmitter / receiver to each other to make it work reliably?

Without a length-matched antenna the RF-power that is sended out by the transmittor will be only 1% of the power that would be send out with a length-matched antenna.

And the receiver will only receive only 1% of the RF-power without a length-matched antenna.
This means transmitting the data will only work over a very short distance reliably.

You posted fritzing pictures as a "schematic".
I have a question: can you read the letters that indicate which pin has what function on the transmitter and the receiver?
image
image

If somebody would like to check your wiring she/he would be forced to lookup
datasheets of the transmitter / receiver
Without knowing which exact type of transmitter/receiver this is.

Making assumptions which one it might be which could be wrong.

If you look at the picture below
This receiver-boards

show the pin-order. Is your pin-order the same?

This is the reason why you should provide datasheets and pictures of your real hardware.

The real check of the transmitter working or not working
would be to use an expensive receiver

To check if the receiver is working could be done with a much simpler testcode that just prints the state of the IO-pin to the serial monitor

I haven't analysed deeply enough if this transmitter makes the receivers output-pin just "blink" HIGH/LOW if the transmitter has a HIGH/LOW on his input-pin.

This would be a basic test if they work at all.

If you can afford to buy two HC-12 modules in a set that includes a length-matched antenna I recommend them

This tranceivers enable send and receive in both directions hence the name tran-ceiver
and you simply use them with a serial connection.
They represented wireless wires

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.