Go Down

Topic: Newbie question about NRF24L01 (Read 1 time) previous topic - next topic

Roque Campos

Dear Friends,

I request apologizes about my not very good English.

I'm playing with two Arduinos and two NRF24L01 transceptors. I'm using an Arduino YUN as a master node, and an Arduino Leonardo as a child node.

The leonardo has an DS18b20 temperature sensor, measures the temperature every 10 seconds, and sends it to the Arduino YUN using the NRF24.

I'm using the ManiacBug library for the radio: http://maniacbug.github.io/RF24/

The most of the time, all works very well: the temperature is measured, sended to the YUN, and the yun receives it and saves the temperature in a sqlite database.

But sometimes, the yun does not receive the temperature during a variable time period. The function

Code: [Select]
if ( radio.available(&pipe_num) )

returns false. This can last a few minutes, or many hours. Then, suddenly, the temperatures are received again.

Looking at the serial console on the child side, I can see that when this happens, the return of

Code: [Select]
bool done =  radio.write( s, sizeof(s));

is always 0 or false.

the leonardo sends the temperature every 10 seconds. And the Yun receives the temperature every two seconds (more or less), because the yun does a lot of things and is more busy than the leonardo.

And my newbie question is, why I'm loosing temperatures?

Any help would be apreciated.

Best regards

R. Campos.


What's the distance between the two NRF24, are they in line of sight (no obstacles between them)?

You're using a radio connection and radio is never completely reliable, especially not if you're using the quite crowded 2.4GHz band. So outages in the radio connection is something that you have to be able to handle. If you cannot, use a wired connection.

Roque Campos

The arduino YUN is in my living room, and the arduino leonardo is outside my home. They are not in line of sight, and they have two walls between them.

The distance between the arduinos maybe be 15 meters in straight line (crossing throug the walls).

After reading your answer, I did a couple of tests. There are three doors between. With one door closed, the data arrives at the master. With two doors closed, the data is lost...


.. and these walls are made of what? Concrete? Wood? How crowded is your 2.4GHz frequency band (how many networks does the WiFi scan on your notebook show)? Do you have the possibility to move one or both devices? Even minimal displacements may have a great impact on the communication quality.

Roque Campos

Thank you for your attention:

the walls are made of bricks, and they have a width of more or less 30cm. My notebook shows 6 wifi networks in my neighborhood. I don't know if it is much or not.

I will try to relocate the device and see what happens. Thank you very much for your help.


the walls are made of bricks, and they have a width of more or less 30cm. My notebook shows 6 wifi networks in my neighborhood. I don't know if it is much or not.

6 networks is not really much (my notebook sees about 20 networks at home) but is enough to fill almost the whole frequency band with some content. And if you or one of your neighbors have DECT phones (wireless telephones), that adds to the sum too as well as mobile phones with Bluetooth activated. With walls and electromagnetic noise around the possible distance of radio devices like the nRF24 is much less than they're advertised for.

Go Up