Sending and receiving nRF24+, Nextion, dht22 ,mq135

Hello. I have problem sending and receiving data. The receiver has(nano):

  • DHT22 temperature sensor connected under D2
  • radio module nRF24L01 + with capacitor connected under CSN D9, CE D8 and MOSI D11 and so on …
  • display nextion nx4832T035 power supply normally and RX to TX and TX to TX1
#include <SPI.h> 
#include "DHT.h"

DHT dht(2, DHT22);
#include "RF24.h"
RF24 radio (8, 9);
const byte pipe[6] = "00001";
float data[4], temperatura, wilgotnosc;


void setup() 
{
   dht.begin();
  radio.begin();
  radio.openWritingPipe(pipe);
 radio.setPALevel(RF24_PA_MAX);
 radio.startListening();

Serial.begin(9600);
}

void loop() 
{
  if (radio.available())
  {
    radio.read(&data, sizeof(data));
  }
 Serial.println(data[0]);
 Serial.println(data[1]);
 Serial.println(data[2]);
 Serial.println(data[3]);
 Serial.println("");
  
  }

The transmitter has(Uno):

  • DHT22 temperature sensor connected to D10
  • MQ135 air quality sensor connected to D2 and A2
  • radio module nRF24L01 + with capacitor connected to SPI, CSN D9, CE D8
#include <SPI.h> 
#include "DHT.h"

#include "RF24.h"
#include "nRF24L01.h"

#define DHTPIN 10  

#define DHTTYPE DHT22 

DHT dht(DHTPIN, DHTTYPE);
RF24 radio (8, 9);

const byte pipe[6] = "00001";
float data[4], temperatura,wilgotnosc;


void setup() 
{
  Serial.begin(9600);
   dht.begin();
  radio.begin();
  radio.openWritingPipe(pipe);
 radio.setPALevel(RF24_PA_MAX);
 

}

void loop() 
{
 
 data[0] = dht.readTemperature();
 data[1] = dht.readHumidity();
 data[2] = digitalRead(2);
 data[3] = analogRead(A2);
 
  radio.write(&data, sizeof(data));

The transmitter will send temperature, humidity and air quality data
The receiver will receive data from the transmitter and show the temperature of its sensor.

The serial port shows at receiver me the same zeros

0.00
0.00
0.00
0.00

0.00
0.00
0.00
0.00

Have you managed to get a simple program working to send data using the nRF24 modules?

If not I suggest you start with one of the examples from this Simple nRF24L01+ Tutorial

...R

oskare89:
capacitor connected under CSN D9, CE D8 and MOSI D11 and so on ...

That's a interesting setup, I've never seen anyone try capacitors on the signal lines before.