This is the 3rd time I have typed this up because it keeps failing UGH! But hello, I am currently having problems with my first "wireless" Arduino project using an Arduino Uno (Receiver) and an Arduino Pro Mini (transmitter) both using NRF24L01 modules. The two arduinos cannot interact with simple code of setting a message from one side to the other. However, I know that it works because I have tested it with two Unos!
Transmitter Code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
Receiver Code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
Here is a picture of my Arduino Pro Mini Transmitter that I have made alongside a schematic.
These are the solutions that I have tried so far:
- Checked that both NRF24L01 modules are working
- Check the voltages of both NRF24L01 (3.3v) and Arduino (5V) is correct by using a multimeter
- Tested that both the pro mini and NRF24L01 worked before soldering by using basic jumper cables and the power pins off of an Arduino Uno
- Checked all cables and made sure they are in the correct spot