Skip to content

NRF24L01+ 2.4GHz Radio TinyShield

Do you need to communicate over a long distance with something? Perhaps a drone, an RC car, or RC goose decoy. Well, lucky for you, the NRF24L01+ radio is great for these applications!

Learn more about the TinyDuino Platform


Description

This radio TinyShield is based around the very popular Nordic NRF24L01+ radio transceiver. The TinyShield is set to operate at 2.4GHz, can transmit at up to 2Mbps, and is very easy to use. This transceiver allows for long range communication between radios and is designed for an open field range of up to 100 meters, which makes this great for outdoor sensors or RC control of drones and vehicles.

An U.FL antenna connection is included on the board, along with a 2.4GHz whip antenna. The TinyShield incorporates a voltage regulator to ensure proper and safe operation over the entire TinyDuino operating voltage range up to 5V.

To see what other TinyShields are compatible with this TinyShield, see the TinyShield Compatibility Matrix

Technical Details nRF24 Transceiver Specs
  • Frequency: 2.4GHz
  • Sensitivity: –82 dBm at 2Mbps, -95 dBm at 250kbps
  • Data Rate: 250kbps, 1Mbps, 2 Mbps
  • Ultra low power operation
TinyDuino Power Requirements
  • Voltage: 3.0V - 5.5V
  • Receive current: 13.5mA
  • Transmit current (0 dBm): 11.3mA
  • Transmit current (-18 dBm): 7.0mA
  • Standby current: 22uA
Pins Used

SPI Interface used:

  • 2 - SPI_IRQ: This signal is the interrupt output from the radio transceiver and into the TinyDuino.
  • 7 - SPI_CS: This signal is the SPI chip select for the radio transceiver.
  • 9 - CE: This is the chip enable signal
  • 11 - MOSI: This signal is the serial SPI data out of the TinyDuino and into the radio transceiver.
  • 12 - MISO: This signal is the serial SPI data out of the radio transceiver and into the TinyDuino.
  • 13 - SCLK: This signal is the serial SPI clock out of the TinyDuino and into the radio transceiver.
Dimensions
  • Board: 20mm x 20mm (.787 inches x .787 inches)
  • Board: Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
  • Antenna Length: 150mm (5.9 inches)
  • Board Weight:1.03 grams (.04 ounces)
  • Antenna Weight: 0.47 grams (0.02 ounces)

Moving forward, you could transmit arrays of data rather than text in order to provide control inputs or remote feedback to your devices. This concept is used in our Tiny Jeep and Tiny Jeep Controller which makes use of some additional materials (1 Motor Driver TinyShield, 1 Joystick TinyShield, 2 Motors, and some housing). With this, the radio TinyShields can be used to control an RC car.

Notes

  • For best range, the antenna should not be close to metal or coiled up. Lower data rates and smaller packets will increase range! 
  • You can use different antennas with this board! They must be 2.4Ghz with a U.FL connector on them.

Materials

Hardware materials

Hardware

NOTE: For this tutorial you will need two processor boards of any type, and two NRF24L01+ 2.4GHz Radio TinyShields.

Software

NOTE: There is not really a transmitter and receiver in this case. Both radios act as both a transmitter and a receiver. These names were assigned in order to simplify distinguishing which board is which.


Hardware Assembly

For both stacks, simply place the NRF24L01 Radio TinyShield on top of your processor of choice.

Assembled TinyDuino stack


Software setup

Be sure to unzip the RadioHead Arduino Library and place it in either your sketch folder or in your Arduino/libraries directory.


Upload Program

The following code will work with any of our processor boards as long as two of the same type of radio are used, one on either processor. Upload the first sketch to one stack and the second sketch to the other.

"Transmitter" Radio Code
/*
  TinyDuino Radio Transmitter TinyShield Example Sketch

  This example is to establish communications with another
  radio of the same type. The other processor and radio TinyDuino
  stack should have the RadioRX_example.ino Radio Receiver
  TinyShield Example Sketch.

  If using the 433MHz radio: set use433 to a 1 in line 24
  If using the NRF24L01 radio: set use433 to a 0 in line 24

  Written 04 June 2019
  By Hunter Hykes
  Modified 
  By 

  https://TinyCircuits.com
*/

#include <SPI.h>
#include <RH_RF22.h>
#include <RH_NRF24.h>

#define use433 0  //1 if using 433MHz radio, 0 if using NRF24L01

#if(use433)
RH_RF22 nrf24(7, 3);
#else
RH_NRF24 nrf24(9, 7);
#endif

#if defined(ARDUINO_ARCH_AVR)
#define SerialMonitorInterface Serial
#elif defined(ARDUINO_ARCH_SAMD)
#define SerialMonitorInterface SerialUSB
#endif

void setup()
{
  SerialMonitorInterface.begin(115200);

  #if(use433)
    if (!nrf24.init()) {
      SerialMonitorInterface.println("init failed");
    }

    nrf24.setTxPower(RH_RF22_TXPOW_20DBM);

    if(!nrf24.setModemConfig(RH_RF22::GFSK_Rb125Fd125)) { //GFSK_Rb4_8Fd45?
      SerialMonitorInterface.println("setModemConfig failed");
    }
  #else
    if (!nrf24.init()) {                        // For NRF24L01 radio
      SerialMonitorInterface.println("init failed");
    }
    if(!nrf24.setChannel(1)) {
      SerialMonitorInterface.println("setChannel failed");
    }
    if(!nrf24.setRF(RH_NRF24::DataRate250kbps, RH_NRF24::TransmitPower0dBm)) {
      SerialMonitorInterface.println("setRF failed");
    }
  #endif

  SPI.setClockDivider(4);
}

void loop()
{
  SerialMonitorInterface.println("Sending to receiver");
  //Send a message to receiver
  uint8_t data[] = "Hello World!";
  nrf24.send(data, sizeof(data));

  nrf24.waitPacketSent();
  //Wait for a reply from the receiver
  uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
  uint8_t len = sizeof(buf);

  if (nrf24.waitAvailableTimeout(500)) { 
    // Should be a reply message for us now   
    if (nrf24.recv(buf, &len)) {
      SerialMonitorInterface.print("Reply: ");
      SerialMonitorInterface.println((char*)buf);
    } else {
      SerialMonitorInterface.println("Receive Failed!");
    }
  } else {
    SerialMonitorInterface.println("No reply, is the receiver running?");
  }

  delay(400);
}
"Receiver" Radio Code
/*
  TinyDuino Radio Receiver TinyShield Example Sketch

  This example is to establish communications with another
  radio of the same type. The other processor and radio TinyDuino
  stack should have the RadioTX_example.ino Radio Transmitter
  TinyShield Example Sketch.

  If using the 433MHz radio: set use433 to a 1 in line 24
  If using the NRF24L01 radio: set use433 to a 0 in line 24

  Written 04 June 2019
  By Hunter Hykes
  Modified 
  By 

  https://TinyCircuits.com
*/

#include <SPI.h>
#include <RH_RF22.h>
#include <RH_NRF24.h>

#define use433 0  //1 if using 433MHz radio, 0 if using NRF24L01

#if(use433)
RH_RF22 nrf24(7, 3);
#else
RH_NRF24 nrf24(9, 7);
#endif

#if defined(ARDUINO_ARCH_AVR)
#define SerialMonitorInterface Serial
#elif defined(ARDUINO_ARCH_SAMD)
#define SerialMonitorInterface SerialUSB
#endif

void setup()
{
  SerialMonitorInterface.begin(115200);

  #if(use433)
    if (!nrf24.init()) {
      SerialMonitorInterface.println("init failed");
    }

    nrf24.setTxPower(RH_RF22_TXPOW_20DBM);

    if(!nrf24.setModemConfig(RH_RF22::GFSK_Rb125Fd125)) { //GFSK_Rb4_8Fd45?
      SerialMonitorInterface.println("setModemConfig failed");
    }
  #else
    if (!nrf24.init()) {                        // For NRF24L01 radio
      SerialMonitorInterface.println("init failed");
    }
    if(!nrf24.setChannel(1)) {
      SerialMonitorInterface.println("setChannel failed");
    }
    if(!nrf24.setRF(RH_NRF24::DataRate250kbps, RH_NRF24::TransmitPower0dBm)) {
      SerialMonitorInterface.println("setRF failed");
    }
  #endif

  SPI.setClockDivider(4);
}

void loop()
{
  if (nrf24.available()) {
    // Should be a message for us now   
    uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);

    if (nrf24.recv(buf, &len)) {
      // NRF24::printBuffer("request: ", buf, len);
      SerialMonitorInterface.print("Received: ");
      SerialMonitorInterface.println((char*)buf);

      // Send a reply
      uint8_t data[] = "and hello back to you.";
      nrf24.send(data, sizeof(data));
      nrf24.waitPacketSent();

      SerialMonitorInterface.println("Sent a reply");
    } else {
      SerialMonitorInterface.println("Receive Failed!");
    }
  }
}

Transmitter Output

Receiver Output

Moving forward, you could transmit arrays of data rather than text in order to provide control inputs or remote feedback to your devices. This concept is used in our Tiny Jeep and Tiny Jeep Controller which makes use of some additional materials (1 Motor Driver TinyShield, 1 Joystick TinyShield, 2 Motors, and some housing). With this, the radio TinyShields can be used to control an RC car.


Downloads


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!