NRF24L01 connection issues

Hello I am having a hard time using two NRF24L01 chips with my arduino Nano's. I have verified the correct wiring and no matter when example sketch I use to verify the connection, my serial monitor always prints out random characters and lots of backwards question marks. I have tried adding a 10uf capacitor to the ground and 3.3V as well with the same erroneous result.
for example my current output on the serial monitor looks like this:

'⸮⸮C⸮Zx⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ڇ⸮⸮X⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

Any help is welcome, thank you

I was about to say "your serial is hooked up backwards" :slight_smile: but that would be a bad joke.

Seriously the first thing to check is the Serial speed. It looks like the NRF24 is at one speed and your Arduino IDE is at a different speed.

When I connect a 5V arduino to a 3.3V device, I run the arduino on 3.3V to avoid using a voltage converter. If that's what you're doing, try dividing by two the baud rate in the terminal window.

For instance, if you declare 9600 bauds in your sketch, try 4800 bauds in the terminal.

It works for me with Pro Minis.

kayel:
When I connect a 5V arduino to a 3.3V device, I run the arduino on 3.3V to avoid using a voltage converter. If that's what you're doing, try dividing by two the baud rate in the terminal window.

For instance, if you declare 9600 bauds in your sketch, try 4800 bauds in the terminal.

It works for me with Pro Minis.

This indicates you are running the board at 8 MHz, but compiling with F_CPU set to 16000000. If you use the board definition that matches your hardware, your timing wouldn't be thrown off. The Pro Mini's board definition has 8 MHz options under the Tools > Processor menu. In your case, I doubt you changed the resonator on your 5 V Pro Mini to 8 MHz, so perhaps you're using a custom board definition to switch the fuses to the internal oscillator? If so, you can still set the build.f_cpu correctly, or just use MiniCore:

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:

I am running 5V on the Nano and 3.3V thru the NRF24L01 so will I have any issues if I am trying to communicate between two devices without using the serial monitor? When I set the serial monitor to 115200 baud it seems to give me an intelligible output but I still cannot communicate between devices because when I run the getting started example code it just says failed response timed out

pert:
In your case, I doubt you changed the resonator on your 5 V Pro Mini to 8 MHz, so perhaps you're using a custom board definition to switch the fuses to the internal oscillator?

No, nothing that clever.
I ran a 5V, 16MHz pro mini on 3.3V because it was connected to a 3.3V tolerant device and I didn't have a 3.3V arduino. I don't remember if I left it as a 5V pro mini in the IDE menu or a 3.3V one.
The 5V pro mini dropped its speed to 8MHz as if it were a 3.3V pro mini. I thought that was its normal behaviour.
I just repeated the experiment with a 5V pro mini running on 3.3V and I had to double the baud-rate in the terminal (see below).

As JohnRob said, it looks like a speed problem, but feeding 5V into a 5.5V absolute maximum tolerant device is sailing a bit too close to the wind for my liking.

You should google "nrf24l01 5v tolerant" from my very quick look it seems the nrf24l01 pins might be 5v tolerant. I guess would still have to look at the Pro Mini input thresholds when receiving 3.2 v or so and being powered by 5V.

From the AT328P spec, the minimum "high" threshold is Vin * 0.6 = 3V (corrected was 0.7)

John

kayel:
I don't remember if I left it as a 5V pro mini in the IDE menu or a 3.3V one.

Look at your own screenshot. You have Tools > Processor > ATmega328P (3.3V, 8MHz) selected.

kayel:
The 5V pro mini dropped its speed to 8MHz as if it were a 3.3V pro mini. I thought that was its normal behaviour

It doesn't work that way. Your Pro Mini's 16 MHz resonator oscillates at 16 MHz. That's the only speed it can run at. Your Pro Mini is going to try to run at 16 MHz no matter what voltage you give it. 16 MHz at 3.3 V is out of spec, but close enough that it will work, but maybe not reliably.

As your screenshot shows, in this configuration you need to set the Serial Monitor's baud rate to 2X the baud rate set in the sketch. So with Serial.begin(9600), you need to set the Serial Monitor to 19200, not 4800 as you claimed. This is because you are compiling the sketch with F_CPU set to 8000000 but the board is really running at 16 MHz.

So all you're accomplishing is throwing all your F_CPU-based timings off.

This is not my thread and it's not my problem.

Seeing the back-to-front "?"s reminded me of something that caught me out a couple of years ago so I mentioned it here in case miewk1101 had decided to run his arduinos at 3.3V as I did.

JohnRob:
You should google "nrf24l01 5v tolerant" from my very quick look it seems the nrf24l01 pins might be 5v tolerant. I guess would still have to look at the Pro Mini input thresholds when receiving 3.2 v or so and being powered by 5V.

From the AT328P spec, the minimum "high" threshold is Vin * 0.7 = 3.5V

If you believe the 0.7 is conservative then perhaps it is 0.6 * Vin = 3 which the nrf24l01 might be able to provide.

John

nrf2401 input pins are 5.25V tolerant. That's an absolute maximum. The nrf2401 is 3.3V tolerant. I don't mix the two but I don't care if anyone else does.

If the minimum "high" threshold is Vin*0.7 then at 3.3V that's 2.31V.

pert:
Look at your own screenshot. You have Tools > Processor > ATmega328P (3.3V, 8MHz) selected.
I
As your screenshot shows, in this configuration you need to set the Serial Monitor's baud rate to 2X the baud rate set in the sketch. So with Serial.begin(9600), you need to set the Serial Monitor to 19200, not 4800 as you claimed. This is because you are compiling the sketch with F_CPU set to 8000000 but the board is really running at 16 MHz.

So all you're accomplishing is throwing all your F_CPU-based timings off.

I'm not claiming anything. I did the screenshot today, not a couple of years ago where that memory came from, and apparently I got it the wrong way round in my first post. If I'd selected 16MHz that wouldn't have made much of a screenshot, would it?

This is not helping miewk1101.

If the minimum "high" threshold is Vin*0.7 then at 3.3V that's 2.31V.

I might not have been clear, sorry. When I cited the input level of 0.6 * 5V I was referring to the configuration where:

The Pro mini is powered by 5V
The nrf24l01 is powered by 3.3V

So if the OP wants to run two supplies it will probably work and it definitely will not damage the nrf24l01 inputs.

(Corrected, 0.6 above was 0.7)

kayel:
This is not helping miewk1101.

Sure it is. I saved them from confusion and wasted time caused by thinking they might need to set the Serial Monitor to a different baud rate than that configured in their sketch.

mlewk1101:
I am running 5V on the Nano and 3.3V thru the NRF24L01 so will I have any issues if I am trying to communicate between two devices without using the serial monitor? When I set the serial monitor to 115200 baud it seems to give me an intelligible output but I still cannot communicate between devices because when I run the getting started example code it just says failed response timed out

Have you got a 10uF capacitor between the 3.3V and gnd AT the NRF device.
When they transmit the load current at 3.3V increases rapidly.
The 3.3V regulator on the Nano will have some regulation problems.
The capacitor acts as storage for the Tx load pulse, so the regulator is not seriously loaded down.
Tom... :slight_smile:

TomGeorge:
Have you got a 10uF capacitor between the 3.3V and gnd AT the NRF device.
When they transmit the load current at 3.3V increases rapidly.
The 3.3V regulator on the Nano will have some regulation problems.
The capacitor acts as storage for the Tx load pulse, so the regulator is not seriously loaded down.
Tom… :slight_smile:

I was thinking the same thing, the capacitor needs to be as close to the nrf as possible. I’ve soldered the capacitor to the pins of the nrf module when using batteries. With a consistent power supply, I had the same success when installing the capacitor into the breadboard. I use a 47uF capacitor, not sure if the slight difference in value would make any difference.

Another possibility would be to get the nrf adapter boards, which take 5V and drop the voltage to 3.3V. That way the same power supply could be used for the Nano and nrf. Just don’t forget a common ground.

JohnRob:
From the AT328P spec, the minimum "high" threshold is Vin * 0.7 = 3.5V

Powered at 5V the ATmega328 input high threshold is 0.6 Vcc for the digital pins, so its 3.3V compatible.

MarkT,

Thanks for the correction, I was in error.