eddiebird.co.uk

arduino : html5 : css3

whoops

433MHz RF Transmitter and receiver pair.

uno image

433MHz receiver (on the left) and transmitter (on the right).

uno image

Underside of receiver and transmitter - note the antenna(wires) soldered in place.

uno image

Transmitter connected to Arduino Uno.

uno image

Receiver connected to Arduino Uno.

uno image

It works! - Received signal displayed on Serial Monitor.

Sketch / program for the transmitting Arduino UNO:-


/*
SimpleSend
This sketch transmits a short text message using the VirtualWire library
connect the Transmitter data pin to Arduino UNO pin 12.
*/

#include <VirtualWire.h>

void setup()
{
// Initialize the IO and ISR
// Begin using all settings and initialize the library. Similar to the "begin" function of other libraries.
vw_setup(2000);
Serial.begin(9600);
Serial.println("Ready  transmitter");
}

void loop()
{
send("Hello World! + Hello eddiebird.co.uk!");
Serial.println("transmitted");
delay(100);
}

void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx(); // Wait until the whole message is gone
}

Sketch / program for the receiving Arduino UNO:-


/*
SimpleReceive
This sketch  displays text strings received using VirtualWire
Connect the Receiver data pin to Arduino UNO pin 11.
*/

#include <VirtualWire.h>

byte message[VW_MAX_MESSAGE_LEN];    // a buffer to hold the incoming messages
byte msgLength = VW_MAX_MESSAGE_LEN; // the size of the message

void setup()
{
Serial.begin(9600);
Serial.println("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, &msgLength)) // Non-blocking
{
Serial.print("Got: ");
for (int i = 0; i < msgLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}
}