FS1000A Wireless RF433 Transmit and Receive Module Pair

I like experimenting with wireless devices, as you can tell from the many posts about them here! 😎 I am trying out an FS1000A Wireless RF433 Transmit and Receive Module pair this time.

They use use the RF 433Mhz  frequency with ASK modulation. (You can also get these with the 315Mz frequency instead.)  I got mine from Elecrow.com.  They look like this:

FS1000A Wireless RF433 Transmit and Receive Module Pair

 

FS1000A RF433 Transmit and Receive Module PairHere is a graphic on how they work together:

FS1000A Wireless RF433 Transmit and Receive Module PairBasically you can use one Arduino to control the Transmitter and one Arduino to control the Receiver. An Arduino RF library comes in handy for that. In the past, you’d use the VirtualWire library for controlling these modules, now however, there is a better library called RadioHead which supersedes it. Download it from HERE. Once you install it from the Arduino IDE (Sketch -> Include Library -> Add .ZIP Library) there will be a number of examples to choose from. You can use the File -> Examples -> RadioHead -> Ask -> ask_receiver and ask_transmitter sketches.

I modified them a bit as shown below.

Here is the sketch for the Arduino Receiver:

#include <RH_ASK.h>
#include <SPI.h>

// Arduino                     Receiver
//  GND--------------------------GND
//  D11--------------------------Data
//  5V---------------------------VCC

RH_ASK driver(2000, 11, 12);

void setup() {
  Serial.begin(9600);
  if (!driver.init()) Serial.println("init failed");
}

void loop() {
  uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
  uint8_t buflen = sizeof(buf);

  if (driver.recv(buf, &buflen)) {
    driver.printBuffer("Received:", buf, buflen);
  }
}

Here is the sketch for the Arduino Transmitter:

#include <RH_ASK.h>
#include <SPI.h> 

// Arduino                     Transmitter
//  GND--------------------------GND
//  D12--------------------------Data
//  5V---------------------------VCC

RH_ASK driver(2000, 11, 12);

void setup() {
  Serial.begin(9600);   
  if (!driver.init()) Serial.println("init failed");
}

void loop() {
  const char *msg = "hello";
  driver.send((uint8_t *)msg, strlen(msg));
  driver.waitPacketSent();
  delay(200);
}

As you can tell from the comments in the code, they are very easy to hook up. Both use only three pins (VCC, GND and DATA). Here is the Fritzing Diagram showing how they are connected:

FS1000A RF433 Transmit and Receive ModulesYou can download the custom fritzing parts from here. If you want my fritzing diagram, download it from here.

Updated Note (6/21/2018): In the receiver code, the printBuffer function ‘dumps’ the buffer in HEX (probably for better diagnostics). Here is the code for the receiver, if you want a normal print of the received characters:

#include <RH_ASK.h>
#include <SPI.h>

// Arduino                     Receiver
//  GND--------------------------GND
//  D11--------------------------Data
//  5V---------------------------VCC

RH_ASK driver(2000, 11, 12);

void setup() {
  Serial.begin(9600);
  if (!driver.init()) Serial.println("init failed");
}

void loop() {
  uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
  uint8_t buflen = sizeof(buf);
  uint8_t i;
  if (driver.recv(buf, &buflen)) {
//    driver.printBuffer("Received:", buf, buflen);
    Serial.print("Received:");
    for (i = 0; i < buflen; i++) Serial.print(buf[i]);
    Serial.println("");
  }
}

9 comments

Skip to comment form

    • johan tobar on July 26, 2017 at 2:22 pm
    • Reply

    si se pueden cambiar los pines que usted esta utilizando (11,12) por otros.

    1. Yes, you can change the pins. The documentation for the RH_ASK is here http://www.airspayce.com/mikem/arduino/RadioHead/classRH__ASK.html.
      11 is the default receive pin and 12 is the default transmit pin.

    • Bianfa on September 24, 2017 at 4:49 pm
    • Reply

    how i can programmer two buttons whit fs1000a?

      • earl on September 25, 2017 at 5:45 am
        Author
      • Reply

      Hi! There is plenty of code around for controlling ‘buttons’ with an arduino. For example: https://www.arduino.cc/en/Tutorial/Button
      (Note: It would be the arduino connected to the button or buttons, not the FS1000A.)

    • ruel on October 2, 2017 at 1:30 pm
    • Reply

    Thanks, but I am not receiving the word “Hello”….I think those are hexadecimal. Please assist.

      • earl on October 3, 2017 at 4:48 am
        Author
      • Reply

      It is not hexadecimal.. If everything is set up properly you should see “Received: Hello” on the serial console for the Arduino Receiver.

        • sdr on June 20, 2018 at 11:41 pm
        • Reply

        Perhaps the RH library has been updated since you published? I too am getting a hex dump of hello 68 65 6C 6C 6F, rather than characters. I copy/pasted your code. The only thing changed is the driver definition as I’m using different pins.

        • sdr on June 20, 2018 at 11:43 pm
        • Reply

        From the RH documentation, printBuffer() “Prints a data buffer in HEX. For diagnostic use”

        1. Thanks! You guys are correct, the printBuffer() function does print in HEX. I added a note in the post on changing that if you want to.

Leave a Reply

Your email address will not be published.