RF 433MHz Rx/Tx: Not Communicating

Hello everyone! I am working on my project where I can send data from using wireless. I am using RF 433MHz Rx/Tx. I have used a lot of examples using RadioHead library and VirtualWire library, however, I can't seem to communicate the Rx and Tx.

For my Transmitter I am using Arduino Nano, and for my receiver I am using Arduino Mega2560.
Apparently I am using this code but still not working:

For Receiver:

Serial.begin(9600);
Serial.println("Device is ready");
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver
}
void loop()
{
if (vw_get_message(message, &messageLength)) // Non-blocking
{
Serial.print("Received: ");
for (int i = 0; i < messageLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}
}

For Transmitter:

// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);	  // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);	 // Bits per sec
}

void loop()
{
    const char *msg = "hello";

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(200);
}

I need your help! Thanks!

Did you attach antennas to the modules?

Show your wiring diagram. Did you solder connections to the modules?

jremington:
Show your wiring diagram. Did you solder connections to the modules?

For transmitter my connections are:
Tx - Nano
Vcc - 5v
Gnd - Gnd
ATAD- D12 (I also tried D11)

For receiver my connections are:
Rx - Mega
Vcc- 5v
Gnd - Gnd
Data - D11 (I also tried D12)

I've watched tutorials where they did not put an antenna(wire) but they seems to work, so I didn't attached antenna(wire).

I am using this RF Rx/Tx

Hi,
OPs picture.

Tom... :slight_smile:

Hi,
In your code you are missing a lot of statements needed in void setup().

Such as statements to declare your data in and out pins.

Check the code here;

Tom... :slight_smile:

I have the same problem !
Arduino Mega2560+Arduino Nano+rf 433Mhz
for two days I'm working on this and I can't make a connection.
none of the libraries seem to work . tested Radiohead , virtual wire and etc.
how should I know if the sender or receiver are ok?
does anyone have any suggestion about how I can send and receive data using these items?

Kuzou:
Hello everyone! I am working on my project where I can send data from using wireless. I am using RF 433MHz Rx/Tx. I have used a lot of examples using RadioHead library and VirtualWire library, however, I can't seem to communicate the Rx and Tx.

For my Transmitter I am using Arduino Nano, and for my receiver I am using Arduino Mega2560.
Apparently I am using this code but still not working:

For Receiver:

Serial.begin(9600);

Serial.println("Device is ready");
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver
}
void loop()
{
if (vw_get_message(message, &messageLength)) // Non-blocking
{
Serial.print("Received: ");
for (int i = 0; i < messageLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}
}




For Transmitter:


// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);   // Debugging only
    Serial.println("setup");

// Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000); // Bits per sec
}

void loop()
{
    const char *msg = "hello";

digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(200);
}




I need your help! Thanks!

TomGeorge:
Hi,
In your code you are missing a lot of statements needed in void setup().

Such as statements to declare your data in and out pins.

Check the code here;

https://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/

Tom... :slight_smile:

I tried this , and many other codes existing on the internet. It didn't work out.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile: