Will many nrf24L01 radio modules running at the same time cause interference?

I am working on a battle bot type of project where their will be 4 transmitters communicating with 4 receivers attached to the robots in the 4 foot x 4 foot playing field. Are their any complications that will arise when trying to run many radio modules at the same time? Like relating to interference or noise? If so, what solutions or work-arounds exist for this problem?

Please read and follow this link if You want serious answers: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

Sorry was this the wrong category or something?

Project Guidance is fine, but you forgot to provide useful information about your project.

Interference is ALWAYS a problem with radio communications, but you can avoid producing it by reducing the amount of time transmitting, using different frequencies, etc.

If 4 bots use distinct frequencies/channels, can they listen to 4 channels at the same time?

No. But I suppose that one could scan several predefined channels.

One can use "pipes" as channels (4 or 6, I forgot the actual number) which effectively time share a single frequency. That would be useful for one transmitter talking to one or more receivers.

If the OP would take a few moments to describe the actual project, others might be willing to chip in.

I missed the "battle bots" which are controlled individually by RF and do not communicate amongst each other.

Sorry for the lack of details earlier. Basically there will be 4 arduinos, each with a nrf24L01 module and a joystick attached. These 4 systems will act as the transmitters. Each transmitter will talk to 1 robot which is the receiver. There are 4 transmitters and 4 robots. Each transmitter and receiver pair will send packets of data through a different address. There is no communication between the robots.

My main question I wanted to ask was if there is a fundamental issue with multiple nrf24L01 modules transmitting and receiving data in a small space. Something to do with running on the same 2.4 Ghz frequency?

  1. Yes.

  2. Use four different frequencies, one for each bot.

Can the frequency that the nrf24L01 module runs on be changed? I thought it was set to run at the standard 2.4 Ghz frequency. Also what exactly is the issue with them all running on the same frequency? Is it just inteference?

Rather than repeating the same questions, and getting the same answers over and over again, I strongly recommend that you take a few minutes and use your favorite search engine to learn something about Arduino and NRF24L01 modules.

There are hundreds of tutorials, where you will very quickly find answers to such questions, and much, much more.

After doing some research through other forums and documentation, I've gathered some information and tips that I would like to clarify.

What I've learned is that:

  1. The NRF24L01 has a bunch of different channels. You can set a different channel for each RX/TX pair. Therefore if each pair runs on a different channel/frequency, interference will be reduced. I also read that the channel numbers range from 0 to 176 but due to some legalities you cannot exceed 80?

  2. In the same post I read that you can also have several devices operating separately on the same channel if they use different addresses. Is this out of context for my application? Cause if this is true then it would be a simple code change of the 5 digit address:
    const byte address[6] = "00001";

  3. Assuming I must change the channel, I read that the channel can be set by passing an 8-bit integer parameter to the RF24::setChannel() method. An example of this code might be radio.setChannel(10) ;

I also found that this is the code for the set channel function: void setChannel(uint8_t channel);.

If this is the right track, I was wondering how I can implement these pieces into my existing code?
This is what I have on the transmitter side:


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


RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
  Serial.println("TEST nRF24L01+ transmitter");
}
void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}

and the receiver side:

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


RF24 radio(9, 10); // 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);
  }
}


Actually, it is anything but that simple.

WiFi uses "spread spectrum" technology, not sure to what extent the NRF devices use the same technology. So the "channel" is not the same as a distinct frequency; they are shared to a degree. And in close proximity, you will get desensitisation due to a closer transmitter.

So are there any solutions to this problem? To what extent will this occur, like will it impede the actual functionality of the robots or will it be something minor?

I would guess all the robots could easily work on the same frequency,
it depends on the packet rate/size that is used.

If you encounter congestion of some sort (monitor fails and retries),
you can switch to different frequencies.

Okay that's good to hear. Do you know how I can integrate the set channel function into my code?

Here is an example setup function from one of my rf24 programs using the setChannel() function.

void setup()
{

   Serial.begin(115200);
   Serial.println("SimpleTx Starting");
      
   radio.begin();
   radio.setChannel(76);  // channel 76 library default
   //RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH and RF24_PA_MAX
   radio.setPALevel(RF24_PA_HIGH);
   radio.setDataRate( RF24_250KBPS );
   radio.setRetries(3, 5); // delay, count
   radio.openWritingPipe(slaveAddress);
}

Great thanks so much! So the radio.setChannel function is a built-in function from the RF24 library? Meaning I don't need to run this line?
void setChannel(uint8_t channel);

That is a function prototype. Arduino automatically generates the function prototypes (usually) so you do not need to include them. But you do need to call the function as shown in the posted setup() code.

Another method to minimize air time, is to use enableDynamicPayloads.