Go Down

Topic: Rf Communication with VirtualWire/Uno (Read 417 times) previous topic - next topic


Mar 31, 2015, 12:23 am Last Edit: Mar 31, 2015, 12:27 am by andehlu
Hi all,

I am trying to get two Arduino UNO to talk using 315Mhz Rf transmitter/receivers. I am using VirtualWire lib and everything almost seems to be working. My transmitter says that messages are getting sent but I cant seem to receive them.

Code and pics of the setup below. Anyone have any thoughts?


Code: [Select]

#include <VirtualWire.h>

const int transmit_pin = 12;

void setup(){

void loop(){
  send("hello world");

void send (char *msg){
  vw_send((uint8_t *)msg, strlen(msg));


Code: [Select]

#include <VirtualWire.h>

const int receive_pin = 11;

void setup(){
//    /vw_set_rx_pin(receive_pin);

void loop(){
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    Serial.println("Got: ");

    if (vw_get_message(buf, &buflen)){

 for (int i = 0; i < buflen; i++){
    Serial.print(buf[i], HEX);
    Serial.print(' ');


And pics of the setup....


I would triple check your connections, I cant really tell based on the pictures... but I was having an impossible time getting a 433mhz radio to work, and it turned out I had the positive and negative wires swapped.

if you have a meter, check for continuity between the 5v pins, ground pins, and data pins.


Mar 31, 2015, 04:52 am Last Edit: Mar 31, 2015, 04:53 am by jremington
The first thing to do is to get VirtualWire working without the radios. For that you need a "transmitter" Arduino, a "receiver" Arduino and a wire running from the TX pin on the transmitter Arduino to the RX pin on the receiver Arduino. Also connect the two Arduino grounds together.

Make sure that you know which pins are which and that they are correctly assigned in the software.

When that works, remove the wire and replace with the radio modules.


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131