Skip to content

nRF24L01+ library with AVR 2 pin support, requiring very little code along with YouTube videos showing all available features.

License

Notifications You must be signed in to change notification settings

dparson55/NRFLite

Repository files navigation

Receiver Example

See Basic_RX.ino for a more complete example.

#include "SPI.h"
#include "NRFLite.h"

NRFLite _radio;
uint8_t _data;

void setup()
{
    Serial.begin(115200);
    _radio.init(0, 9, 10); // Set radio to Id = 0, along with its CE and CSN pins
}

void loop()
{
    while (_radio.hasData())
    {
        _radio.readData(&_data);
        Serial.println(_data);
    }
}

Transmitter Example

See Basic_TX.ino for a more complete example.

#include "SPI.h"
#include "NRFLite.h"

NRFLite _radio;
uint8_t _data;

void setup()
{
    _radio.init(1, 9, 10); // Set radio to Id = 1, along with the CE and CSN pins
}

void loop()
{
    _data++;
    _radio.send(0, &_data, sizeof(_data)); // Send data to the radio with Id = 0
    delay(1000);
}

PA+LNA nRF24L01 Limitation

  • Issues 44, 56, 63, 66, 77 have been raised about PA+LNA nRF24L01+ modules not working correctly when using the automatic acknowledgement (ACK) feature of the radio. The nRF24L01+ chip itself does not provide settings to solve this incompatibiity so a work around is to implement ACK manually in software. The TwoWayCom_SoftwareBased examples can be used as a starting point.
  • Consider using RFM69 modules rather than PA+LNA nRF24L01+ modules when needing a long range, low power solution. The nRF24L01+ chip is well suited for short range, high bitrate projects while the RFM69 excels in longer range, lower bitrate applications.

Video Tutorials

  • Tutorial 1 Introduction and all basic features
  • Tutorial 2 2-pin Operation and ATtiny sensor walkthrough

Installation

  • Start the Arduino IDE.
  • Open the Library Manager by selecting the menu item Sketch > Include library > Manage Libraries.
  • Search for 'nrflite'.
  • Select the latest version and click the Install button.
  • View examples in the menu File > Examples > NRFLite.

Features

nRF24L01+ Pin Reference

nRF24L01 Pinout

2-Pin Hookup Guide

  • This mode is much slower than the other hookup options which take advantage of the SPI and USI peripherals of the supported microcontrollers. The big limitation is needing to wait for the capacitor to charge and discharge, so only use this mode when speed is not a priority.
  • The GPIO pins you select on the microcontroller should not share any additional components, e.g. a Digispark board contains an LED on PB1 and USB connections on PB3 and PB4, so do not use these pins.
  • The R2 resistor does not need to be exactly 5K, anything between 4K and 6K is good.

2-Pin

ATmega328 SPI Hookup Guide

Radio MISO -> Arduino 12 MISO
Radio MOSI -> Arduino 11 MOSI
Radio SCK  -> Arduino 13 SCK
Radio CE   -> Any GPIO Pin (can be same as CSN)
Radio CSN  -> Any GPIO Pin (pin 10 recommended)
Radio IRQ  -> Any GPIO Pin (optional)

Arduino Pin 10 is the SPI Slave Select (SS) pin and must stay as an OUTPUT.

ATmega328 Pinout

ATtiny84 USI Hookup Guide

Radio MISO -> Physical Pin 7
Radio MOSI -> Physical Pin 8
Radio SCK  -> Physical Pin 9
Radio CE   -> Any GPIO Pin (can be same as CSN)
Radio CSN  -> Any GPIO Pin
Radio IRQ  -> Any GPIO Pin (optional)

Arduino pin names (pictured in brown) using the MIT High-Low Tech library https://github.com/damellis/attiny.

ATtiny84 Pinout

ATtiny85 USI Hookup Guide

Radio MISO -> Physical Pin 5
Radio MOSI -> Physical Pin 6
Radio SCK  -> Physical Pin 7
Radio CE   -> Any GPIO Pin (can be same as CSN)
Radio CSN  -> Any GPIO Pin
Radio IRQ  -> Any GPIO Pin (optional)

Arduino pin names (pictured in brown) using the MIT High-Low Tech library https://github.com/damellis/attiny.

ATtiny85 Pinout

About

nRF24L01+ library with AVR 2 pin support, requiring very little code along with YouTube videos showing all available features.

Resources

License

Stars

Watchers

Forks

Packages

No packages published