Hi,
I can't get my nrf24l01 to work. I am aware that many other people have the same problem and many solutions have been found. I think I have tried all of them:
- I have banned long jumper wires and soldered the circuit on perfboard (checked for continuity).
- I have added a 100uf capacitor between 3.3v and ground.
- I have used a different power source than the Arduino 3.3v pin.
- I have tried different nrf24l01 module combinations.
- I have tried different codes that seem to work with other people.
I don't know what to try next. One of the codes I tried is this one:
//transmitter
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// Instantiate RF24 class with CE and CSN values
RF24 radio(7, 8);
// Address to devices comunicate each other (same in both)
const uint64_t pipe = 0xE8E8F0F0E1LL;
// A variable to hold some info
boolean info = false;
void setup() {
// Setup serial output
Serial.begin(9600);
// Start RF
radio.begin();
// Setup the channel to work within, number 100
radio.setChannel(100);
// Open wite pipe
radio.openWritingPipe(pipe);
}
void loop() {
// it changes every interval
info = !info;
if (info) {
Serial.print("Sending positive... ");
} else {
Serial.print("Sending negative... ");
}
// Send info over RF
bool success = radio.write(&info, sizeof(boolean));
if (success) {
Serial.println("sent!");
} else {
Serial.println("fail!");
}
// Wait 2 seconds and repeat
delay(2000);
}
//receiver
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// Instantiate RF24 class with CE and CSN values
RF24 radio(8, 7);
// Address to devices comunicate each other (same in both)
const uint64_t pipe = 0xE8E8F0F0E1LL;
// A variable to hold some info
boolean info = false;
void setup() {
// Setup serial output
Serial.begin(9600);
// Start RF
radio.begin();
// Setup the channel to work within, number 100
radio.setChannel(100);
// Open recept pipe
radio.openReadingPipe(1, pipe);
// Start to listen
radio.startListening();
}
void loop() {
// Wait until some data
if (radio.available()) {
// Read payload, and check if it finished
radio.read(&info, sizeof(info));
// Manage info
if (info) {
Serial.println("We received positive!");
} else {
Serial.println("We received negative!");
}
}
// Wait a bit
delay(50);
}
The transmitter keeps posting sent. The receiver keeps posting received positive. Same thing when I don't connect a module at all. When I connect a different module to the receiver side, it posts nothing.
What should I try next?
Kind regards

