Arduino nrf24

#ProjectDIVA: Arduino Mini Pro


This article extends the node tree of ProjectDiva to include an Arduino Pro Mini.

This article explains how to connect a Arduino Pro Mini to the nRF24Things application (Android Things). The code allows sending and receiving messages between the nodes. It uses the well-known nRF24 libraries to create a sensor mesh, where the node 0 (in this case a Raspberry Pi running the Android Things application) actuates as a "DHCP" server and assigns the node addresses in the mesh.

Preview

Requirements

Hardware & Software


Arduino Pro Mini Arduino Mini Pro (3.3V) x 1   
nrf24l01+ NRF24L01+ x1
ftdi1232 FTDI-1232 x1
Jumper Cables Jumper Cables x1
C++ rRF24
Arduino nrf24amini

Wiring

Please check that the Arduino Mini Pro is a 3.3V compatible version. The NRF24L01+ does not support 5V. If you use an Arduino 5V version, you need to not only supply the nrf24l01+ with 3.3V but also the signals (CE, CSN, MOSI, MISO) should be also 3.3V. The FTDI1232 board muss work with 3.3V too. The board that I linked in the section hardware has a jumper to set its voltage to 3.3V.

WiPy 3.0, MPU6055 & Micro Servo 9g
Fig. 1: FTDI-1232, Arduino Mini Pro (3.3V) & NRF24L01+

Instructions

  1. Connect the boards as described in the Connection section. Check voltage jumpers!
  2. Install the Arduino Ide and open it.
  3. Connect the FTDI1232 to your computer.
  4. Go to the menu "Tools" > "Programmer" and select "AVRISP mkII".
  5. Go to the menu "Board" and select "Arduino Pro or Pro Mini".
  6. Go to the menu "Processor" and select "ATMega328P (3.3V, 8MHz)".
  7. Go to the menu "Sketch" > "Include Library" and open "Manage Libraries"
    • Search for RF24 and install the following libraries:
      • RF24 by TMRh20 Version 1.3.1
      • RF24Network by TMRh20 Version 1.0.8
      • RF24Mesh by TMRh20 Version 1.0.51
  8. Go to the folder where the libraries were installed (on Windows - C:\Users\<user>\Documents\Arduino\libraries and edit the following files:
    • RF24Mesh\RF24Mesh_config.h [
      • #define MESH_DEFAULT_CHANNEL 76
    • RF24Network\RF24Network.cpp [
      • static uint8_t address_translation[] = { 0xc3,0x3c,0x33,0xce,0x3e,0xe3,0xec }
      • uint64_t result = 0xCCCCCCCCCCL;
  9. Upload the code with the Upload button, and have fun!

Credits

Libraries from TMRh20 and maniacbug:

Licenses

Licenses include, but are not limited to the following (check respective files):

  • GNU
  • Apache 2.0
  • etc...
{{ message }}

{{ 'Comments are closed.' | trans }}