I am using this http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html to send a message over RF.
To get as high range as possible, I am powering the sender with 12V (Transmitor Input Voltage: 3-12V), but still it seems low and very unreliable.
Between the sender and receiver, there are two walls (made of wood and rockwool), and an airline of around 12 meters.
To improve the range I started trying to use wire as antennas for the sender, and came up with two wires with a length of 6cm was the best, but still it only completes less than 50% of the messages send.
For the receiver the picture says that an optional 10-15cm wire can be used, but there are already one on it (small rolled up), and it is glued to the board, so it will be a mess to replace it with another wire.
Managed to get a straight wire attached instead, improved the reception a bit, so now it is receiving around 50-60% of the messages.
Is the 12 meter range around what this set can do, or are there something that can be changed to improve it?
To send and receive the messages, I am using these:
Sending the messages through the Arduino's pin 3
Sender
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
void setup()
{
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for RF Link module
vw_set_tx_pin(3); // pin 3 is used as the transmit data out into the TX Link module, change this to suit your needs.
}
void loop()
{
rfSend("this is a test");
delay(5000);
}
void rfSend(String message)
{
char output[100];
message.toCharArray(output, 99);
vw_setup(2000);
vw_send((uint8_t *)output, strlen(output));
vw_wait_tx(); // Wait for message to finish
vw_setup(40);
}
Receiver is powered by the Arduino's 5V, and sending the received data to the Arduino's pin 2
Receiver
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
#define rxPin 2
const int ledPin = 13; // the number of the LED pin
int ledState = LOW; // ledState used to set the LED
long onMillis = 0; // will store last time LED was updated
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for RX Link Module
vw_setup(2000); // Bits per sec
vw_set_rx_pin(rxPin); // We will be receiving on pin 2 ie the RX pin from the module connects to this pin.
vw_rx_start(); // Start the receiver
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // check to see if anything has been received
{
int i;
// Message with a good checksum received.
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i]); // the received data is stored in buffer
}
Serial.println(" ");
digitalWrite(ledPin, HIGH);
onMillis = millis();
}
if (millis() - onMillis > 100 && onMillis > 0)
{
onMillis = 0;
digitalWrite(ledPin, LOW);
}
}