NRF24 Problem

Hello,

So I am trying to upgrade my project from there modules 3Pcs NRF24L01+ SI24R1 2.4G Wireless Power Enhanced Communication Receiver Module Sale - Banggood USA-arrival notice-arrival notice to these modules Geekcreit® 1100 Meter Long Distance NRF24L01+PA+LNA Wireless Module With Antenn Sale - Banggood USA . My program with the first modules works. But as soon as I connect the other modules, the new modules only recieve data, not transmit. Here is the code for the Transmeter:

#include <SPI.h>
#include <RF24.h>

RF24 myRadio (7, 8);

char ttt = 'e';
byte addresses[][6] = {"0", "1"};
char stat;

struct package
{

  int id = 1;
  int feed = 0;
  float temperature = 18.3;
  char text[100] = "ttut";

};


typedef struct package Package;
Package data;

void setup()
{
  Serial.begin(115200);

  myRadio.begin();
  myRadio.setChannel(108);
  myRadio.setPALevel(RF24_PA_MIN); //SET MAX
  myRadio.setDataRate(RF24_250KBPS) ;
  myRadio.openWritingPipe(addresses[0]);
  myRadio.openReadingPipe(1, addresses[1]);
}

void loop()
{
  myRadio.stopListening();

  myRadio.write(&data, sizeof(data));

  Serial.print("\nPackage:");
  Serial.print(data.id);
  Serial.print("\n");
  Serial.println(data.temperature);
  Serial.println(data.text);
  Serial.println(data.feed);
  Serial.println(ttt);

  data.id = data.id + 1;
  data.temperature = data.temperature + 0.1;


  myRadio.startListening();
  if (myRadio.available()) {
    while (myRadio.available())
    {
      myRadio.read(&ttt, sizeof(ttt));

    }
  }





  if (ttt != stat) {
    data.feed = 1;
  } else {
    data.feed = 0;
  }

  stat = ttt;


  delay(200);
}

And the reciever:

#include <SPI.h>
#include <RF24.h>

RF24 myRadio (9, 10);

char ttt = 'p';
byte addresses[][6] = {"0", "1"};

struct package
{

  int id = 0;
  int feed = 0;
  float temperature = 0.0;
  char text[100] = "empty";

};


typedef struct package Package;
Package data;

void setup()
{
  Serial.begin(115200);

  myRadio.begin();
  myRadio.setChannel(108);
  myRadio.setPALevel(RF24_PA_MIN); //SET MAX
  myRadio.setDataRate(RF24_250KBPS) ;
  myRadio.openWritingPipe(addresses[1]);
  myRadio.openReadingPipe(1, addresses[0]);
  myRadio.startListening();
  pinMode(3, INPUT);
  pinMode(4, INPUT);
}

void loop()
{

  while (myRadio.available())
  {
    myRadio.read(&data, sizeof(data));

    Serial.print("\nPackage:");
    Serial.print(data.id);
    Serial.print("\n");
    Serial.println(data.temperature);

    if (data.feed == 0) {
      Serial.println("Stable!");
    } else {
      Serial.println("Recieved!");
    }


    Serial.println(data.text);
    Serial.println(ttt);

    myRadio.stopListening();
    myRadio.write(&ttt, sizeof(ttt));
    myRadio.startListening();
  }

  if (digitalRead(3) == HIGH) {
    ttt = 'I';
  }

  if (digitalRead(4) == HIGH) {
    ttt = 'T';
  }





}

Any idea why this happens? I made sure to add an extra power supply for them. Thank you in advance!

clickable links:

Alexan:
But as soon as I connect the other modules, the new modules only recieve data, not transmit. Here is the code for the Transmeter:

I have a problem with that ... How can anything be received if nothing is transmitted?

Post a diagram showing how everything is connected.

What is the distance between transmitter and receiver?

...R
Simple nRF24L01+ Tutorial

All right so,

I will name the nRF modules without external antenna -> old modules
and the nRF modules with external antenna -> new modules.

The code is working perfectly with the old modules. Even tho it's not needed here whats the code does:

The Transmitter sends data. The Reciever receives them and displays them. Also, the Reciever with the push of a button sends some data/action. And the Transmitter sends a feedback signal to "say" that it received the signal.

But the code, as I said, works perfectly with the old modules. Any idea why it's not working with the new ones?

Also, after some experiments, I found out that the new modules can receive data, but they seem not to transmit data.

I wired up everything using this diagram https://cdn.instructables.com/F5L/QBIL/IEY3GQ46/F5LQBILIEY3GQ46.LARGE.jpg

Is it a hardware problem? A library one? Thank you for your help!

Alexan:
But the code, as I said, works perfectly with the old modules. Any idea why it's not working with the new ones?

Also, after some experiments, I found out that the new modules can receive data, but they seem not to transmit data.

Does that mean that the new (high-power) modules can receive data sent by the old (low-power) modules?

You did not say what is the distance between Tx and Rx. The high-power modules may overwhelm the receiver at close range.

Also the high-power modules need more power. You have not provided a diagram showing how YOU have things connected. The picture in your link does not show anything connected to the nRF24.

To the best of my knowledge the programming of the low-power and high-power modules is identical.

...R

Thank you for your reply. I am sorry that I forgot to tell about the range. The range was pretty close. Like 40cm-50cm. But I also tried at 3m. Here's what's happening with the modules.

  • When I have at the Tx an old module and at the Rx an old module, everything works great.

  • When I have at the Tx an old module and at the Rx a new module, the Rx Receives data but it does not transmit.

  • When I have at the Tx a new module and at the Rx an old module, nothing happens (the Tx does not transmit at all).

  • When I have at the Tx a new module and at the Rx a new module, nothing happens.

Seems like the new modules can not transmit?!? I attached the schematic as well.

Image from Reply #5 so we don't have to download it. See this Simple Image Guide

...R

You have the 3.3v connections floating in thin air. What are they connected to?

...R

So for the 3.3V supply I am using a DIY one which uses the LM317T3. Diagram here:
Imgur

Input Voltage: 12V 2A

Is this wrong? Tried with a buck converter as well, without luck.

I can't make any sense of the spidery picture in the image link. Make a proper schematic drawing (paper and pencil is fine) with the power supply and the Arduinos and everything all together.

An LM317 should be fine if it is connected properly.

...R

PS... Make it easy for people to help you - post the images in this Forum so we don't have to waste time going to see them.

I am sorry for not having that photo attached. For some reason the image was not being shown even if I added the link. Anyways, here's the schematic:

I also tried from the same power source and with seperate power sources, one using the LM317 and the other one using a buck converter, without luck as well.

I don't see any capacitors in either schematic. There should be capacitors.

I am assuming that the left-hand diagram with the LM317 is the one that has the high-power nRF24? And the other diagram has the low-power nRF24?

If you change NOTHING in the left diagram but substitute a low-power nRF24 does it work properly?

...R

So, I added 2 capacitors: tried with both values 10uF and 100uF. The left-hand diagram uses the high-power module and the right-hand diagram is for the low-power module. Also, yes with the schematic at the reply #10 (without changing anything), using the low power module (in the left-hand diagram), it works properly!

This is the new schematic:

Alexan:
The left-hand diagram uses the high-power module and the left-hand diagram is for the low-power module.

I suspect that needs to be edited for clarity.

Is it possible your high-power nRF24 is faulty? Have you more than one of them?

...R

Oops, missed that I am sorry. I fixed it. I have 2 of them, which came in the same package. I tried both without luck.

I can't think of anything else. It is not easy to debug wireless from this distance.

...R

Anyways, I want to thank you very much for your help. I will try to find out what's the problem and I will post it here, if anyone else had the same problem!

You could try without the nrf24 library, like this:

The transmitter sketch is a couple of "Nexts" further on.

kayel:
You could try without the nrf24 library, like this:

The nRF24 library is not the problem. It works well for other Forum users.

...R

?

Robin2:
The nRF24 library is not the problem. It works well for other Forum users.

...R

With the new modules?