Nrf24l01 arduino doesnt work

Hello, i try to send some data from one arduino to another.
But it doesnt work.

my configuration is,
vcc = 3,3V
gnd = gnd
ce = Pin 7
csn = Pin 8
sck = Pin 52
mosi = Pin 51
miso = Pin 50
IRQ = isnt connected

Here is my "send sketch"

#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>

RF24 radio(53,8); // CNS, CE
const byte adress[6] = "00001";

void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(adress);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();

}

void loop() {
const char text[] = "Es hat geklappt";
radio.startWrite(&text,sizeof(text),false);
radio.write(&text,sizeof(text));
delay(1000);

}

and here is my receive sketch

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(53,8); //CE, CSN
const byte adress[6] = "00001";

void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0,adress);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();

}

void loop() {

char text[32] = {0};

if(radio.available())
{

radio.read(&text,sizeof(text));
Serial.print(" ");
Serial.println(text);    

}
else
{
Serial.print("Fehler");
}
}

the wiring is identical on each arduino

thanks for help!

Suggest you follow this tutorial;

The 3.3V supply output on the Mega is unlikly to be able to supply enough current to run the nrf24l01 transmitters, you need to arrange a seperate 3.3V supply.

This looks odd for a start: RF24 radio(53,8); // CNS, CE

i searched for so long and used every difference i got from the internet. But in the skech i use i changed it to RF24 radio(7,8)

Best to post the actual sketch you used that failed.

this is the updated sketch to send

#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>

RF24 radio(7,8); // CNS, CE
const byte adress[6] = "00001";

void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(adress);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();

}

void loop() {
const char text[] = "Es hat geklappt";
radio.startWrite(&text,sizeof(text),false);
radio.write(&text,sizeof(text));
delay(1000);

}

and this to receive

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(7,8); //CE, CSN
const byte adress[6] = "00001";

void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0,adress);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();

}

void loop() {

char text[32] = {0};

if(radio.available())
{

radio.read(&text,sizeof(text));
Serial.print(" ");
Serial.println(text);    

}
else
{
Serial.print("Fehler");
}
}

That is a bad idea.
99.999999% of the time there will be no packet available,
combined with the 9600 baud, it will nearly halt your sketch blocking on Serial.

The 3.3V of a normal Mega is not sufficient for a NRF24L01+, I second that.
Making pin 53 an output, could help the SPI library play its master role.

but in my updated code in dont use the pin 53 :sweat_smile:

and i also tried to use a external voltage source to get a higher current but i dont think that was the solution

I see no "but" there, that could be the reason for a malfunctioning Mega.

If you knew the problem, there would be no reason to ask for help here, would it?

okay can you explain me how do you mean that with the pin 53? Because i´m new to this topic.
Would be great

Add
pinMode(53, OUTPUT);
to setup.

I'm really sorry that your Google is broken.

at which sketch? for the transmit or the recv.?
And why the pin 53? because from my first sketch to my actual sketch i changed the 53 to 7
:sweat_smile:

Any that uses a Mega and a NRF24L01.

Note about Slave Select (SS) pin on AVR based boards

All AVR based boards have an SS pin that is useful when they act as a slave controlled by an external master. Since this library supports only master mode, this pin should be set always as OUTPUT otherwise the SPI interface could be put automatically into slave mode by hardware, rendering the library inoperative.

It is, however, possible to use any pin as the Slave Select (SS) for the devices. For example, the Arduino Ethernet shield uses pin 4 to control the SPI connection to the on-board SD card, and pin 10 to control the connection to the Ethernet controller.

So I tried changing the skript and pins like u said. Unfortunately nothing happened.

But you failed to post the new sketches (and new connections?). :wink:

You did run the connection test sketch from Robin2's tutorial to make sure you can communicate?

If not, it's time to. (You will have to adapt it to match your hardware connections).

A small capacitor (1 to 10 uF) directly on the module power pins
sometimes helps the modules work in case of a marginal power supply.

here is the receive sketch

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(53,8); //CE, CSN
const byte adress[6] = "00001";

void setup() {
pinMode(53, OUTPUT);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0,adress);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();

}

void loop() {

char text[32] = {0};

if(radio.available())
{

radio.read(&text,sizeof(text));
Serial.print(" ");
Serial.println(text);    

}
else
{
Serial.print("Fehler");
}
}

and here the transmit

#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>

RF24 radio(53,8); // CNS, CE
const byte adress[6] = "00001";

void setup() {
pinMode(53, OUTPUT);
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(adress);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();

}

void loop() {

if(radio.available()){

const char text[] = "Es hat geklappt";
radio.startWrite(&text,sizeof(text),false);
radio.write(&text,sizeof(text));

}

}

Change that post, so the code is in code tags.

this is the output of the "checkconnection.ino"