2

I've been trying to make work the NRF24l01 RF module with Raspberry and Arduino, but I can't.

This is the version of the module I have: NRF24l01 Module

I'm trying to send the data from the Arduino, I already tryed with two Arduinos and all works fine

The Arduino Conection is:

  • PIN NRF24L01 | Arduino UNO
  • 1 GND___________GND
  • 2 VCC___________3.3V
  • 3 CE____________digIO 9
  • 4 CSN__________digIO 10
  • 5 SCK__________digIO 13
  • 6 MOSI_________digIO 11
  • 7 MISO_________digIO 12
  • 8 IRQ –

For Raspberry Pi:

  • PIN NRF24L01 | RPi
  • 1 GND________RPi-GND(6)
  • 2 VCC________RPi-3.3V(1)
  • 3 CE_________RPi-GPIO25(22)
  • 4 CSN________RPi-GPIO8(24)
  • 5 SCK________RPi-SCKL(23)
  • 6 MOSI_______RPi-MOSI(19)
  • 7 MISO_______RPi-MISO(21)
  • 8 IRQ –

The library I'm using for Arduino and Raspberry is: RF24 Library

When I run the "GettingStarted" example It shows:

In Arduino

Arduino RF24 Configuration

In the Raspberry

enter image description here

I've a 10 µF capacitor between VCC and GND in both modules.

However I didn't get comunication between the two modules, does anyone knows what can be wrong? I'll apreciate any help.

2
  • Did you work out how to get your Pi to receive?
    – Paul Grime
    May 12, 2016 at 15:08
  • I did it, look my accepted answer below and a comment with a library in github, that library was the only one that worked that time.
    – GEPD
    May 14, 2016 at 17:31

3 Answers 3

1

I found a tutorial in youtube and now I can send and receive data between Arduino and the Pi.

One of the things is not detailed in most tutorial is the importance of have the same radio pipe addresses in both device, it seems like obvius but when you don't now the library isn't obvius.

so I changed the line:

const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

in both "GettingStarted" examples, after that I stated to receive information

the problem now is that, the library I'm currently using is writed in C++, but I have been working with python.

This other library: pynrf24 is write in python but when I try to run one of the examples I get an error

self.spidev.open(major, minor)
IOError: [Errno 2] No such file or directory

I have the spidev library in the same directory, I don't know how to solve that.

Anyone have any experience with pynrf24 library?

1
1

I faced the same problem when I tried to send data from an Arduino to a Raspberry Pi 2. I used this library https://github.com/TMRh20/RF24

I submitted a question on github https://github.com/TMRh20/RF24/issues/114 but in the meantime I found a way to make it work.

Basically what I did was to add these 2 lines before the while(1) loop

radio.stopListening();
radio.startListening();

And a small delay right after it enters the loop

delay(10); 

So in the end that part of my program looks like this:

//...    
radio.startListening();
radio.writeAckPayload(1,&counter,sizeof(counter));  

radio.stopListening();
radio.startListening();

// forever loop
while (1){  

    delay(10);
    uint8_t pipeNo; // Declare variables for the pipe
    //... 

This is my first answer, if it is not clear please let me know :)

-1

You have this connected to 3.3V on the rPi, but the device can use up to 115mA. The 3.3V pin on the rPi can provide a MAXIMUM of 50mA. You would need to power the device from the 5V Pin and build a voltage divider out of 2 appropriately sized resistors to bring the voltage down within range of the module to make it work reliably. It is likely that it just simply does not have enough power in your current setup to transmit/receive anything.

6
  • The 50mA maximum may have been true for early Pis. I'm not sure it is true for later Pis.
    – joan
    May 22, 2015 at 10:04
  • Correct. OP did not mention which Pi (s)he is using though ....
    – Phil B.
    May 22, 2015 at 11:00
  • Sorry about that I'm using Pi 2, I found a solution but I can't write because the site said it received much spam from my network, I don't undertand.
    – GEPD
    May 22, 2015 at 19:59
  • 1
    No, you cannot use a voltage divider to power a variable-demand load such as this, rather, you need a regulator. Nov 13, 2015 at 2:05
  • 2
    A voltage divider won't work with a variable demand load as that means the load resistance - effectively the lower half of the divider - is a moving target. A linear regulator is basically an actively controlled power resistor, which constantly adjusts to make a voltage divider with the load. Nov 14, 2015 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.