3

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.

enter image description here

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?

0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.