Skip to content
My Account

Electronics

Arduino nRF24L01 Wireless Remote with Two Nanos

Two Arduino Nanos with nRF24L01 radio modules as a wireless remote, tested with the RF24 library.

  • Arduino
  • 2 min read
No ratings yet, be the first.

The nRF24L01+ is a small 2.4 GHz radio module that talks to an Arduino over SPI. This project connects two Arduino Nanos with one module each and uses them as a wireless remote: press a button on the transmitter and a led lights up on the receiver.

It is a test of the module with the RF24 library. The sketch is the led_remote example of that library, so the code itself is not repeated here.

The module

The module has eight pins. The supply pin is marked 3.3 V, so power it from the 3.3 V pin of the Nano and not from 5 V.

Module pinFunction
GNDGround
3.3VSupply
CEChip enable, from the Arduino
CSNSPI chip select, from the Arduino
SCKSPI clock
MOSISPI data from the Arduino
MISOSPI data to the Arduino
IRQInterrupt, not used in this sketch
The nRF24L01 module with its eight pins named: GND, 3.3V, CE, CSN, SCK, MOSI, MISO and IRQ

The diagram puts a capacitor on the supply of each module. See the Arduino Nano pinout for the pins of the board.

Wiring

The sketch sets up the radio on the SPI bus with pins 9 and 10 for CE and CSN. On a Nano the SPI pins are fixed: D13 is SCK, D12 is MISO and D11 is MOSI.

Module pinArduino Nano pin
CED9
CSND10
SCKD13
MOSID11
MISOD12
3.3V3V3
GNDGND

How the sketch works

The same sketch runs on both boards. Pin A4 decides the role: leave it open and the board is the remote, connect it to GND and it is the led board.

SettingValue
Radio channel100
Data rate250 kbps
Transmit powerThe lowest level, RF24_PA_MIN
Buttons on the remoteSix, on pins 2 to 7
Leds on the led boardSix, on pins 2 to 7
Serial monitor115200 baud

The remote reads its six buttons and sends their state when one of them changes. The led board receives the six states and switches a led when the matching button is pressed. Both boards print what they do to the serial monitor. The diagram shows the smallest version of this, with one button and one led.

Good to know

  • The RF24 library is installed from the Library Manager of the Arduino IDE.
  • The repository holds the sketch and two images and is under the MIT licence.

The project is in the Arduino—nRF24L01-Interfacing repository on GitHub.

Advertisement
All projects

More projects

Keep building.

Electronics, 3D printing and CNC builds, documented from the first idea to the last screw.

All projects