Hi, I need your help! I have 2 NRF24L01 modules: 1st is connected to the Arduino Nano Every board and works as a transmitter. Here is the wiring:
GND -> GND
3.3V -> VCC
D9 -> CE
D10 -> CSN
D13 -> SCK
D11 -> MOSI
D12 -> MISO
100 uF capacitor -> VCC and GND pins on NRF24 module
Here is the code for the transmitter:
#include "SPI.h"
#include "RF24.h"
#include "nRF24L01.h"
#define CE_PIN 9
#define CSN_PIN 10
#define INTERVAL_MS_TRANSMISSION 250
RF24 radio(CE_PIN, CSN_PIN);
const uint64_t my_radio_pipe = 0xE8E8F0F0E1LL;
//NRF24L01 buffer limit is 32 bytes (max struct size)
struct Data_to_be_sent {
byte xVal;
};
Data_to_be_sent sent_data;
void setup()
{
Serial.begin(115200);
radio.begin();
//Append ACK packet from the receiving radio back to the transmitting radio
radio.setAutoAck(false); //(true|false)
//Set the transmission datarate
radio.setDataRate(RF24_250KBPS); //(RF24_250KBPS|RF24_1MBPS|RF24_2MBPS)
sent_data.xVal = 0101;
radio.openWritingPipe(my_radio_pipe);
}
void loop()
{
radio.write(&sent_data, sizeof(Data_to_be_sent));
delay(INTERVAL_MS_TRANSMISSION);
}
2nd module is connected to the Arduino UNO R3 and works as a receiver. Wiring is identical to the 1st module. 100uF capacitor is also present. Here is the code:
#include "SPI.h"
#include "RF24.h"
#include "nRF24L01.h"
#define CE_PIN 9
#define CSN_PIN 10
RF24 radio(CE_PIN, CSN_PIN);
const uint64_t pipeIn = 0xE8E8F0F0E1LL;
//NRF24L01 buffer limit is 32 bytes (max struct size)
struct Received_data {
byte xVal;
};
Received_data received_data;
void setup()
{
Serial.begin(115200);
radio.begin();
//Append ACK packet from the receiving radio back to the transmitting radio
radio.setAutoAck(false); //(true|false)
//Set the transmission datarate
radio.setDataRate(RF24_250KBPS); //(RF24_250KBPS|RF24_1MBPS|RF24_2MBPS)
radio.openReadingPipe(1, pipeIn);
radio.startListening();
}
void loop()
{
if(radio.available()){
radio.read(&received_data, sizeof(Received_data));
Serial.println(received_data.xVal);
}
else{
Serial.println("no");
}
}
I assume both modules are working, because I ran this code on both of them:
#include <SPI.h>
#include <RF24.h>
#include <printf.h>
RF24 radio(9, 10);
byte addresses[][6] = {"1Node", "2Node"};
void setup(){
radio.begin();
radio.setPALevel(RF24_PA_LOW);
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1, addresses[1]);
radio.startListening();
Serial.begin(9600);
printf_begin();
radio.printDetails();
}
void loop(){
}
And got this output:
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0f
Also the isChipConnected() function returns 1 on both of the modules.
The problem is that when I upload my sketches and trying to receive some data, the if(radio.available()) method returns false and I don't see needed data in the Serial monitor. I don't really know what's the problem, I tried different NRF24 modules and checked my wiring several times. Here is the picture of wiring:

