Why are my NRF24L01+PA+LNA modules not connecting? For Sprinting Timer

Hello, I am creating a Sprinting Timer and am very new to all things Arduino related. This will consist of two towers that each have an Ultra-Sonic Sensor, an nRF module (specifically an NRF24L01+PA+LNA), an Arduino, and a 9v battery pack. The second tower has a 2x16 digital screen to display the time. It will work by detecting when a person (or object) passes by the first Ultra-Sonic sensor on Tower 1 (Transmitter), and a signal is sent to Tower 2 (Receiver). When Tower 2 receives the signal, it will start a timer and end it when the runner passes the second Ultra-Sonic Sensor, then it will display the time out on the 2x16 digital screen. To reset it you will need to click a button and then it will be ready for another run.

The Problem:
I have run into a problem while working on the connection between the two Arduinos for each tower, however. When testing them I had it print certain things when the Receiver got the signal from the Transmitter. The transmitter works fine (or at least the sensor part), sending out a signal and printing that it did so. But the Receiver very rarely is able to pick up the transmitter's signal. It works very randomly; after waving my hand in front of the transmitter's sensor for around 5 minutes (while not focused on the Serial Monitor from the receiver, I was on a different window from the Arduino IDE), I checked the IDE and noticed that it had picked up the transmitted signal for a few seconds and caught the signal around 5 or 6 times but then did not work again.

I am sure that if I were to test again and watch the Serial Monitor from the Receiver Device, then after 20 minutes of waving my hand in front of the sensor, then the Receiver could pick up a few signals, but it would be so inconsistent that it would practically be useless. I am not sure what is causing these problems, but they are probably the last big hurdle I will have to get over.

Although I do not know exactly what the cause is, I have some theories.

- Power Supply Issues: Many of my other sources (web posts, YouTube, ChatGPT) have suggested that the module is starving for power. I currently have it hooked up to 3.3v and I am pretty sure that is enough (I read more will fry the module), and I have a 100UF capacitor between the VCC and Ground as I think I am supposed to. I do not have a multimeter to see if it is receiving the correct amount of energy.

- Wiring Problems: Another issue that I have commonly come across is that it may be the wires are making too much physical "noise", which is cutting off electrical supply? I am not sure about this one, and it confuses me a bit more than the other possibility. Maybe it is a mix of both.

Transmitter Device (Tower 1)

Receiver Device (Tower 2)

Device Side View

Finally, I will give you the code I am using. Because I am new to this whole thing, I used ChatGPT to help me code the project.

Transmitter Script

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

RF24 radio(7, 8);
const byte address[6] = "00001";

const int trigPin = 2;
const int echoPin = 3;

unsigned long lastTriggerTime = 0;
const unsigned long cooldown = 3000; // 3 seconds cooldown

void setup() {
  Serial.begin(9600);
 
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  if (!radio.begin()) {
    Serial.println("RF module hardware not detected!");
    while (1);
  }
 
  radio.setPALevel(RF24_PA_MAX);     
  radio.setDataRate(RF24_250KBPS);   
  radio.setChannel(115);             
  radio.setAutoAck(false);         
  radio.openWritingPipe(address); 
  radio.stopListening();           

  Serial.println("TRANSMITTER ONLINE!");
}

void loop() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
 
  long duration = pulseIn(echoPin, HIGH, 20000); // 20ms timeout
  int distance = duration * 0.034 / 2;

  unsigned long currentTime = millis();

  if (distance > 0 && distance < 50 && (currentTime - lastTriggerTime > cooldown)) {
    Serial.println("!!! RUNNER DETECTED !!! Sending Signal...");
    
    char text[32] = "START";
    
    // Send 3 distinct attempts with small gaps to avoid memory buffer crashes
    for(int i = 0; i < 3; i++) {
      radio.write(&text, sizeof(text));
      delay(5);
    }
    
    lastTriggerTime = currentTime;
  }
}```

Receiver Script

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

RF24 radio(7, 8);
const byte address[6] = "00001";

const int trigPin = 2;
const int echoPin = 3;

unsigned long startTime = 0;
unsigned long finishTime = 0;
float elapsedTime = 0.0;
bool timerRunning = false;

const int triggerDistance = 30;

void setup() {
  Serial.begin(9600);
 
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  if (!radio.begin()) {
    Serial.println("RF module hardware not detected!");
    while (1);
  }
 
  radio.setPALevel(RF24_PA_LOW);     
  radio.setDataRate(RF24_250KBPS);   
  radio.setChannel(115);             
  radio.setAutoAck(false);           
 
  radio.openReadingPipe(0, address);
  radio.startListening();           
 
  Serial.println("Receiver Ready. Waiting for Start Line...");
}

void loop() {
  // 1. Listen for Start Signal
  if (!timerRunning) {
    if (radio.available()) {
      char text[32] = "";
      radio.read(&text, sizeof(text));
      
      if (strcmp(text, "START") == 0) {
        startTime = millis();
        timerRunning = true;
        Serial.println("\n---- TIMER STARTED! RUNNER IS SPRINTING! ----");
        
        // Clear out lingering redundant "START" packets from the RF buffer
        radio.flush_rx();
      }
    }
  }

  // 2. Read Finish Line Sensor
  if (timerRunning) {
    digitalWrite(trigPin, LOW);
    delayMicroseconds(2);
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(10);
    digitalWrite(trigPin, LOW);
    
    long duration = pulseIn(echoPin, HIGH, 20000); // Max 20ms wait
    int distance = duration * 0.034 / 2;
    
    if (distance > 0 && distance < triggerDistance) {
      finishTime = millis();
      
      // Prevent division/overflow errors
      if (finishTime >= startTime) {
        elapsedTime = (finishTime - startTime) / 1000.0;
        
        Serial.print("---- FINISH! Total Time: ");
        Serial.print(elapsedTime, 3);
        Serial.println(" seconds ----\n");
      }
      
      timerRunning = false;
      
      // Clear any RF signals received while the runner was sprinting
      radio.flush_rx();
      
      delay(3000); // 3 second reset delay
      Serial.println("Waiting for Start Line...");
    }
  }
}

Finally, here is the wiring. I know it is messy but that is because the program I was using (TinkerCad) did not have the nRF module in its library.

I pretty much use the nRF24 adapters on all of my nRF24 projects now:

The issue is very likely power supply related.

You may get better results (temporarily) using radio.setPALevel(RF24_PA_MIN, 0);

This sets the radio to minimal power usage and the 0 disables the LNA, using even less power.

Ok, I will try setting it to min power in the script, but what your saying is the problem will be fixed after I add that adapter?

Not 100%. From my experience running these modules, with a lot of the PA+LNA modules and a Nano or Uno, I can only run them using radio.setPALevel(HIGH,0); , otherwise they don't work well. On an official Uno it may work, but these devices transmit very quickly, causing a huge spike in power usage when they transmit.

My best recommendation is to use official E-Byte devices lke the ML01DP5 which will get you closer but you need a solid power supply, the adapters still won't run them at full power usually:

https://www.cdebyte.com/products/E01-ML01DP5/7

Oh, I have very limited resources currently, I think the last thing I can buy is the adapter? You don't think the ones I got will work? Its black.

I'm not sure what you asking exactly, but with the nRF modules you have that seem to be connected directly to the micro-controller, its not that likely to work at full power.

But I don’t see that in your photos, so are you actually using a more appropriate supply?

That is you number one problem!
The Uno 3.3V output cannot supply enough current for the nRF module.

If you are using a 9V battery, that is your number two problem.

oh wait how would I fix these problems? I thought the nRF module would be fried if i hooked it up to 5v, along with that the Ultra-Sonic sensor is already on 5v. Would i still use the adapter @TMRh20 suggested?

The adapter converts the 5V down to 3.3V for the radios.

oh I see, but what would I do for the Ultra-Sonic sensor? It needs 5v to run as well. Can they both be hooked up? Also what does that other guy mean I can't use 9v battery?

Welcome!

There are Power Stability Issues with RF24 Radio Modules

As described in the RF24 Common Issues Guide, radio modules, especially the PA+LNA versions, are highly dependent on a stable power source. The 3.3V output from an Arduino is often not stable enough for these modules in many applications. While they may appear to work with an inadequate power supply, you may experience lost packets or reduced reception compared to modules powered from a more stable source. The Nano/UNO 5V rail can also be a problem, as it may not supply enough current during transmit.

Symptoms of Power Issues:

Radio module performance may improve when touched, indicating power stability problems.

These issues are often caused by the absence of a local capacitor, a common cost-saving omission by some manufacturers.

Temporary Patch:

Add capacitors close to the VCC and GND pins of the radio module. A 10 uF capacitor is usually sufficient, but the exact value can depend on your circuit layout.

Use low ESR capacitors. Capacitors with low Equivalent Series Resistance (ESR) provide better power stability and improved performance.

Be sure the transmitter and receiver are at least one meter apart. More distance is better during testing.

Reference:

During TX (3.3V supply), worst case current depends on which module you have:

  1. Plain nRF24L01+ module (no PA/LNA, small PCB antenna)

TX current at 0 dBm (max power): typically about 11 to 12 mA.
Lower power levels are less, roughly 7 to 9 mA depending on setting.

Rule of thumb: budget at least 15 mA for the radio itself.

  1. nRF24L01+ PA+LNA long-range module (with external power amplifier, often SMA antenna)

TX current at max PA level: typically about 115 to 130 mA.
Current peaks can be higher. A safe design budget is 150 to 200 mA available at 3.3V.

Power notes:

Place local decoupling capacitors at the module: 0.1 uF ceramic plus 10 to 47 uF electrolytic or tantalum directly at VCC and GND.

For PA+LNA modules, do not rely on a weak 3.3V pin. Use a proper 3.3V regulator with adequate current capacity.

Using appropriate capacitors can greatly improve the reliability of your RF24 module by ensuring a stable power supply, minimizing packet loss, and improving overall performance. A separate regulated power supply for the radios is often the best long-term solution.

Adding an annotated schematic with links to technical information on each of the hardware devices will go a long way in getting you the help you need.

Hi! Welcome to the forum.

The question is: 9V PP3 batteries have a relatively low capacity (~500mAh, alkaline), which means they will not be able to provide enough current depending on the circuit, or will be drained as quickly as your hapiness. Moreover, the difference between the voltage provided (9V) and the 5V that Uno needs will be spent as heat in the onboard regulator. So, higher difference --> higher energy tossed out as heat --> lower current available.

PS: "That other guy" is a highly experienced member of this Forum, who has been helping a lot of people for a long time. :laughing:

ohh ok so does that mean i'd have to get a higher battery? or am I missing the point completely.

also sorry haha I appreciate the help from all of you guys

hmm I am still a tad bit confused on what I need to do? Would you mind explaining in a really simple way? Like the most basic of all? It is fine if you cannot!

No, actually it would be better if you could have a 5V power source and connect it to the 5V pin of the Uno, the HCSR04 and the adapter @TMRh20 suggested, which will then provide 3V3 for the NRF24L01. That way, you toss out just the difference from 5V to 3V3.

Since you cannot achieve 5V with batteries, you could use 6xAA for 9V or 5xAA for 7.5V, connected on the barrel jack or Vin pin of the Uno. It will give your project more time working. But the NRF24L01 will still bring you some trouble, because it works on 3V3. I've never tried one of these modules myself, but as a desperate measure, I would try feeding it on 2xAA batteries (3V) apart from the Uno.

Connect a power source to the 5v pin of the Arduino? Is that not the same as plugging it in with the Barrel Jack? Thats what I currently do.

Also I have very limited budget and supplies so I am not sure if I will be able to get another power source other than the 9Vs I have been using. Also can I connect multiple things to the 5v pin at once? By what you said I am thinking so but still am unsure. Sorry for taking so long to understand.

No. The barrel jack and the Vin pin send the energy to a regulator:

That's why it only works on 7-12V. The regulator then provides 5V to the rest of the board and to the 5V pin.

If your power source is 7-12V, you must connect it to the barrel jack or to Vin pin.

However, if you do have a 5V power source (like a power bank), you can connect it to the USB or the 5V pin.

Yes, if all those things use a couple hundred miliamps (some sensors for example). Motors, servos and relays need their own power source.

No problem at all. We all started from mark zero.

Well, time has come for me to go to bed...

You're doing a nice project! Why don't you try to find a partner/sponsor?

Ok, thank you for your help. I am going to bed soon as well. As for a partner, this is more of a personal project as I do track and field and no one else I know does track and field and also likes this sort of project. I have friends who like these projects, but they wouldn't want to work on this one specifically. My next project will be a vigilante armor suit that buzzes when an AI detects danger, probably using a Pi.