Problem: NRF24L01 Mega as receiver, Nano as transmitter

Hi, I have some problem about NRF24L01( Mega 2560 as receiver, Nano as transmitter)

nRF24L01 – How It Works, Arduino Interface, Circuits, Codes (howtomechatronics.com)

I refer from this website. I don't have problem if I use Nano as receiver and Mega as transmitter .
I have problem if I use Mega as receiver, Nano as transmitter.

Arduino MEGA SCK 13 MISO 12 MOSI 11
Arduino NANO SCK 52 MISO 50 MOSI 51

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.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.startListening();
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

Could you help me for using Mega as receiver, Nano as transmitter ?

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Please post a complete wiring diagram of your actual Nano system including NRF and all power supplies. Post it here, do not link to it.

I post my picture as below

As I suspected, you are trying to power the NRF module from the weak 3.3V output of the Nano. It does not provide enough current. The NRF can run on 5V. Try connecting VCC to 5V.

Hi may21,

First off, I would not recommend you connect the NRF24L01 modules directly to +5v as suggested by aarg The maximum working voltage for the NRF24L01 modules is 3.6v If you connect the to +5v you will destroy your NRF24L01 modules!

If you look at the Troubleshooting section of the tutorial you are using. It recommends that you put a small capacitor acrross the supply rails to the NRF24L01 modules. I've used a small 47uf soldered across the Vcc & GND pins on the NRF24L01 modules in my applications.

I've also found adding the following settings below to the Setup of both the Transmitter & Receiver. This improved reliability considerably -

radio.setDataRate(RF24_2MBPS); // Set the speed of the transmission to the quickest available
radio.setChannel(124); // Use a channel unlikely to be used by Wifi, Microwave ovens etc
radio.setPALevel(RF24_PA_MAX); // Set radio Tx power to MAX

BTW I have an NRF24L01 module as a receiver together with an OLED display working OK on a Nano :slightly_smiling_face: :+1:

HTH?

Sorry, that is right, the maximum supply voltage for that module is 3.6V. I was thinking of the 5V tolerant I/O's. Sure a capacitor might help. But some Nano clones do not have a 3.3V regulator, instead they get 3.3V from the serial-USB IC, which can not produce the same current. So YMMV.

Thank you everyone. I will try if everything is OK, I will reply.
Now, I have problem about Mega as receiver, Nano as transmitter.

I don't have problem if I use Nano as receiver and Mega as transmitter

I already add this code. But I have problem if I use Mega as receiver, Nano as transmitter.

By the way, It is OK for Nano as receiver and Mega as transmitter.

It still have problem. I want Mega as receiver, Nano as transmitter.

Hi. I think I found problem. The problem is power supply.
Could you show me picture about "small 47uf soldered across the Vcc & GND pins on the NRF24L01 modules" ?

I don't know about wiring diagram of your actual Nano system.

Hi may21,

As requested a pic showing a small 47uf capacitor soldered across the Vcc & GND pins on the NRF24L01 module -

HTH?

Thank you very much.

Now I already solved problem. I connect capacitor 4.7 uF. It is work !

Thank you.

You have the high power NRF modules. You might find that the voltage regulator on the Nano is not functioning safely, even if it appears to work. It's better to find a robust source of 3.3V for the modules.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.