Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Using signal strength feature of nRF24L01

module
Ask Question

Asked 3 years, 7 months ago

Active 3 months ago

Viewed 4k times

This is a walkie-talkie project and this circuit really worked, voice can be transmitted from one
nRF module to another nRF. Additionally, I want to observe how well the signal strength is, by
lighting up an LED.

They talked about a test.RPD function here in order to do that. But it is said that we can't use this
with nRF24L01, but can use only with nRF24L01P (I don't know what is the difference).
Test whether a signal (carrier or otherwise) greater than or equal to -64dBm is present on the
channel. Valid only on nRF24L01P (+) hardware. On nRF24L01, use testCarrier(). Useful to
check for interference on the current channel and channel hopping strategies. @return true if
signal => -64dBm, false if not */

Can't we use it in nRF24L01 really?


If I cannot use this how can I use the testCarrier function to light up an LED (as Bright, Low and
Off) as mentioned in the quote?
If I can use this, what changes in the code should be done? (The member TmrhProjects talked
about it a little)

He also hints to this code.

bool rpd = radio.testRPD();

while (radio.available()) {
signalStrength = rpd + 1;
radio.read, etc...
}
Should we write the above code in the RF24.h file or should we write it directly into the
Arduino's main sketch?
arduino-uno nrf24l01+

Share

Improve this question

Follow
edited Dec 18 '17 at 4:56

dda

1,58911 gold badge1111 silver badges1717 bronze badges

asked Dec 16 '17 at 22:19

user175079

3111 silver badge33 bronze badges

Add a comment

1 Answer
Active OldestVotes

To get the signal strength just send 100 packets with no retries and see how many times the
packet arrives.

radio.begin();
radio.setRetries(0,0); // by default nrf tries 15 times. Change to no retries to measure strength

char buffer[32];
int counter = 0;

for(int i=0; i<100; i++)


{
int status = radio.send(buffer,32); // send 32 bytes of data. It does not matter what it is
if(status)
counter++;
delay(1); // try again in 1 millisecond
}

// if counter > 80 signal strength is great


{

// else if counter > 60 signal strength is good


{

// etc

radio.setRetries(5,15); change back to its default when done.


For this code to work the receiver must be listening for data. Just listen for data on the receiver
there is no need to validate the data.

You might also like