Hello, I recently purchased several nrf24l01 modules. I wanted to make an rc car out of them. When I started testing them I noticed that they work on Arduino nano but not on Uno. They are connected correctly, according to the code. The modules are powered from separate 9V batteries through voltage stabilizers up to 3.3V. The Arduinos are powered via usb from the computer. I tested it on 2 different Uno's(one original and one clone) and it doesn't work on both.
I tested it with this code from youtube:
/*
If your serial output has these values same then Your nrf24l01 module is in working condition :
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0f
This code is under public domain
Last updated on 21/08/28
https://dhirajkushwaha.com/elekkrypt
*/
#include <SPI.h>
#include <RF24.h>
#include <printf.h>
RF24 radio(9, 8);
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() {
// empty
}
Are we talking about the Nano classic, or one of the newer ones?
The Uno and Nano classic use exactly the same processor chip so there will be no difference between the two, if they are wired up the same.
Consider what Grumpy_Mike said, the UNO should have the same Microcontroller, clock and pins as a Nano. So if a NRF24 works on the UNO, it should work on the Nano, assuming its wired the same.
If the NRF24 does not work on the Nano clone, then there is something different about it versus a geniune Nano.
Two unos was wired correctly and not wotking ONLY with nrf24l01. Thats wierd, because
except that they are 100% efficient and i never had any problem with them. I'd rather not buy a new uno, especially when I already have two working ones. Are you sure it's the arduino's fault? As I said, it would be strange if it didn't work only with this particular device. Maybe it's some other problem...
Are you making sure the Arduino Uno has a common ground with the NRFL01? I've had problems which I suspect were caused by the separate grounds causing problems with the operation of these devices.
We could really do with a proper schematic I can't work out what the stuff on the breadboard is doing.
Lots of people find this demo from @Robin2 helpful
I connected them to a common mass and in the youtube program (the one I sent at the beginning) the correct results were displayed. However, in the other test program Uno shows: Data Sent Message 0 Tx failed
This is the program:
// SimpleTx - the master or the transmitter
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 9
#define CSN_PIN 8
const byte slaveAddress[5] = {'R','x','A','A','A'};
RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
char dataToSend[10] = "Message 0";
char txNum = '0';
unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second
void setup() {
Serial.begin(9600);
Serial.println("SimpleTx Starting");
radio.begin();
radio.setDataRate( RF24_250KBPS );
radio.setRetries(3,5); // delay, count
radio.openWritingPipe(slaveAddress);
radio.setAutoAck(false);
}
//====================
void loop() {
currentMillis = millis();
if (currentMillis - prevMillis >= txIntervalMillis) {
send();
prevMillis = millis();
}
}
//====================
void send() {
bool rslt;
rslt = radio.write( &dataToSend, sizeof(dataToSend) );
// Always use sizeof() as it gives the size as the number of bytes.
// For example if dataToSend was an int sizeof() would correctly return 2
Serial.print("Data Sent ");
Serial.print(dataToSend);
if (rslt) {
Serial.println(" Acknowledge received");
updateMessage();
}
else {
Serial.println(" Tx failed");
}
}
//================
void updateMessage() {
// so you can see that new data is being sent
txNum += 1;
if (txNum > '9') {
txNum = '0';
}
dataToSend[8] = txNum;
}
I don't remember where I found it.
What exactly are you talking about, I don't quite understand.
From the pictures I can see that the voltage regulator has no decoupling capacitors on it. So it could be oscillating.
Is this a 3V3 regulator?
Is the nano set to work off 3v3 or 5V?
The Uno can only run off 5V. That would mean that the signals between it and the Nrf24l01 would be 5V which might make the Uno not run and the nano to run. Connecting 5V signals to a 3V3 module could / will damage the module.
Let's have a proper schematic to see exactly what you are doing in both cases.