Fork me on GitHub

Project Notes

#187 nRF24/PingPong

Two Arduino’s entertaining themselves with a game of “ping pong” over nRF24L01+ 2.4GHz RF.

Here’s a quick video of a “game” in action:

nRF24/PingPong

Notes

This is a quick first test of Arudino 2.4GHz RF communications using nRF24L01+ modules.

I’m using the maniacbug/RF24 library and the code is based on examples provided.

The PingPong.ino script runs on both the “ping” and “pong” node. A ground link on pin 8 tells that aRduino to play “pong”. Here are the rules of the game:

  • “ping” serves: sends a packet and flashes its LED if successful, and waits for reply
  • “pong” receives the message, flashes its LED and sends the message back
  • if/when “ping” gets the reply, it waits a bit and starts again (else logs an error before restarting).

This is not really stressing the communications, but a nice way to prove the basics are working.

NB: I’m using these nRF24Breakout modules to make it easy to breadboard the circuit.

Connections

See the schematic for details. Here’s the summary of pin connections to the nRF24L01+ module:

Line Arduino
GND GND
3V3 3V3
CE 9
CSN 10
SCK 13
MOSI 11
MISO 12

Power

According to the datasheet:

  • 1.9 to 3.6V supply range
  • 5V tolerant inputs (5.25V max)
  • 60mA maximum power dissipation; 13.5mA RX at 2Mbps air data rate

That’s almost perfect for driving with an Arduino Uno, with the exception of the maximum current draw:

  • 5V GPIO pins are acceptable
  • 3.3V pin is within the voltage supply range
  • the Arduino specifications state a 50mA limit for 3.3V Pin

But I’m going to chance it for a quick demo, as many others seem to have done quite succesfully. For a fixed installation, I think I would provide a stiffer external 3.3V supply to avoid overloading the Arduino’s onboard regulators.

In practice, I’m seeing no more than 14.8mA drawn by the nRF24L01+ module (send or receive).

Construction

Breadboard

The Schematic

The Build

Credits and References

About LEAP#187 nRF24Arduino

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader