RF Rx/Tx Set

Overview

The RF Receiver Transmitter Set [Product Link] is useful in applications such as remote control switch, home security products, remote control electric doors, remote control curtains, etc.

Features

RF Receiver Transmitter
RF Receiver Transmitter

Receiver XY-MK-5V Module (4 pin)

  • Idle current: 4mA
  • Working voltage: 5V
  • Receiving frequency: 315, 330, 433.92MHZ
  • Receiver sensitivity: 105DB
  • Modulation: OOK (ASK)
  • Working temperature: -10°Cto +70°C
  • External antenna: Single core wire wound into a spiral

Transmitter FS1000A XY-FST Module (3 pin)

  • Transmission Distance: 20-200 meters (higher voltage, longer range)
  • Idle current: 0 mA
  • Working current: 20-28 mA
  • Working voltage: 3-12 V
  • Transfer rate: 0-10 Kbps (ideally 2400bps)
  • Transmit Power: 10-40 mW
  • Transmitting frequency: 315, 330, 433.92 MHz
  • Modulation: OOK (ASK)
  • Working temperature: -10°C to +70°C
  • External antenna: Ordinary single-core wire

Description

This small sized RF module set can be used in robots and home automation applications. The RF Rx-Tx pair allows wireless control of robots at a range of more than 200 meters.

The external antenna for Receiver and Transmitter are not included. There are holes on both the modules, where an external antenna can be connected. It is possible to send and receive some data without antennae, but this limits the range. Putting an antenna on either the RX or/and TX will further extend the range. The tiny copper wire (spiral) on the unit is an inductor, not an antenna.

To calculate the antennae length for both the modules, first calculate the wavelength by dividing the speed of light (in m/s) by the frequency (in Hz). Then divide the calculated wavelength by 4.

Length of wire in cm = (3 x 100000000) x 100 / (Frequency in Hz x 4)

The value obtained is the lengths of wire (50 ohm single conductor) needed for the external antenna for both the modules. For 433MHz, the length of wires needed is about 17.3cm each (= 30000000000/(433000000 x 4)). Solder these wires into the antenna holes on each module.

Receiving a lot of erroneous data is normal, because when the receiver doesn’t detect any data transmission, it starts increases the sensitivity until it picks up something. Therefore, if nothing is being transmitted, random noise will be received. To overcome this:
1. Transmit more than one bit at a time, in some pattern so the receiver can differentiate between actual data and noise.
2. Send a pre-header so the receiver can adjust sensitivity when it starts receiving actual data. OR
3. Use the VirtualWire library for Arduino that handles these issues.

Receiver

The receiver has 4 pins- Vcc, DATA, DATA, GND. There are 2 DATA pins, and any of them can be used to read the output of the module. When looking from the front side, there is a small hole on the bottom left corner of the module, which is where an external antenna can be connected, if needed.

Transmitter

The transmitter has 3 pins – ATAD (DATA), VCC, GND. Setting the transmitter’s DATA pin to HIGH results in a radio transmission that will set the receiver’s DATA PIN to HIGH and so a serial connection can be implemented, by defining a common baud rate. When looking from the front side, there is small hole on the top right corner of the module (right side of ‘ANT’), which is where an external antenna can be connected, if needed.

Using with AVR

Hook the transmitter to the AVR’s UART TX port, and the receiver to another AVR’s UART RX Port. Write code to initialize the UART ports using the same baud rate, and you are ready to exchange data. Note: If you push bits to the transmitter’s DATA Pin, assuming they are in the supported baud rate interval, the receiver will get the data sent over the radio along with some errors.

The transmitter module will not know if the transmission was successful or not because it is unidirectional and so, a lots of errors might be received. The simple code implementation is:

Transmitter Side C Code

uart0.Init(0,1200, false); // init uart0 for 1200bps baudrate, no RX callback
while(1)
{
i = (i+1) % 256;
uart0.Send(i);
_delay_ms(1000);
}

Receiver Side C Code

uint8_t v = 0;
ISR(USART_RXC_vect)
{
volatile char c = UDR; //Read the value out of the UART buffer
v = c;
}

main()
{
uart0.Init(0, 1200, true); // init uart0 for 1200bps, with RX callback
int i = 0;
while(1) {
i++;
_delay_ms(1000);
}
}

Using with Arduino

You will need 2 Arduino Uno or Chineduino Uno [Product Link], one for connecting the Transmitter module and the other for connecting the Receiver module. Download and install the VirtualWire library for Arduino IDE.

Connect the ATAD (DATA) Transmitter pin to any digital pin of the Arduino, connect Vcc of the Transmitter to +5V, and GND to one of the GND pins of Arduino.

Connect the GND pin of the Receiver to one of the GND pins of the 2nd Arduino, connect either of the DATA pins to any digital pin of the Arduino and leave the other DATA pin unconnected, and Vcc to +5V.

Once the following programs are uploaded and running, the Serial Monitor of the Receiver side will show the message sent from the Transmitter side.

Transmitter Side Code

#include <VirtualWire.h>

void setup()
{
vw_set_ptt_inverted(true); // Required by the RF module
vw_setup(2000); // Transfer rate in bps
vw_set_tx_pin(4); // Transmitter DATA pin connected to digital pin 4
}

void loop()
{
const char *msg = "Hello World"; //Message to send
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx(); // Wait for message to finish sending
delay(200);
}

Receiver Side Code

#include <VirtualWire.h>

void setup()
{
Serial.begin(9600);
vw_set_ptt_inverted(true); // Required by the RF module
vw_setup(2000); // Transfer rate in bps
vw_set_rx_pin(4); // Receiver DATA pin connected to 2nd Arduino's digital pin 4
vw_rx_start();
}

void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Check if data received
{
int i;
for (i = 0; i < buflen; i++)
{
Serial.write(buf[i]);
/*Received data stored in buffer and sent to computer through the serial port*/
}
Serial.println();
}
}

Downloads

VirtualWire Library [Link] [Documentation Link] [Download Link]

Reference 1 [Link]

Possible Application Areas

Some of the application areas of this module set are:
1. Remote Control Switch
2. Automobile Anti-Theft Alarm
3. Remote Door Control
4. Remote Controlled Robot Car [Link]

Did you create a project using this product? Leave details/links below!

Comments

This post currently has 4 responses

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar