Hi everyone,
just to begin with: I know there are probably hundreds of threads about this problem. Still I cannot find the error in my build. I have now spent several days of trying to fix it and by now I dont see any other solution than asking about it again.
The Problem is, that the nrf24 module does not communicate with the arduino board. I keep getting false values returned when calling the radio.begin() function.
My components:
- Arduino Nano (https://www.amazon.de/dp/B01LWSJBTD?psc=1&ref=ppx_yo2ov_dt_b_product_details)
- NRF24 Module(s) (https://www.amazon.de/dp/B07PQPFTWZ?psc=1&ref=ppx_yo2ov_dt_b_product_details)
- NRF24 Module Adapter (https://www.amazon.de/dp/B086V1YTTJ?ref=ppx_yo2ov_dt_b_product_details&th=1)
Wiring (using jumper cables and a bread board):
Adapter Arduino
CE PIN 8
CSN PIN 10
MISO PIN 12
MOSI PIN 11
SCK PIN 13
As requested a picture of the wiring:
My Code:
#include <RF24.h>
#include <RF24_config.h>
#include <nRF24L01.h>
#include <printf.h>
// #include "Wire.h"
RF24 radio(8, 10); // CE, CSN
const byte address[6] = "1RF24"; // address/ identifier
void setup() {
Serial.begin(9600);
while(!Serial){
;
}
delay(5000);
if(!radio.begin()){
Serial.println("Module not connected!");
while(1){}
}
radio.openWritingPipe(address);
radio.stopListening(); // set as transmitter
}
void loop() {
const char text[] = "Hi Receiver"; // max 32 bytes
radio.write(&text, sizeof(text));
Serial.println("Message sent!");
delay(2000);
}
In the end I wont get to know if the sending/ receiving works using only this code, but I wanted to get past the barrier of the arduino and the Module not communicating with each other. I put in some delay to give the Module some time to get working properly (I dont know, whether this is needed, but hey...)
Power supply:
- VCC of the NRF24 Adapter on 5V output of the Arduino Nano (powered by USB)
- NRF24 Adapter powered by 9V Block + Arduino Nano powered by USB
I know the 9V Block is not the best choice but in this case I just tried to get a stable power supply to the Transceiver-Module, as I read, this could cause some problems otherwise.
The Adapters do have capacitors on them to help stable the power supply. As I read on the article`s amazon page, these capacitors are not soldered the right way. So I soldered them to ground.
My last thought is now, that the SPI settings are not correct for the NRF24 Modules, but as the NRF24 library is changing these settings itself and the fact, that I dont really know what the different modes do, I did not yet try anything on that matter.
I hope I got everything in here that you need to help me or at least give me a nudge in the right direction.
Thanks a million in advance guys ![]()
