Unable to get reliable connections with NRF24l01 wireless modules.

Thank you in advance for helping me out here, I am at my wits end trying to get these buggers working.

In essence, the project is a remote control which sends data to two nodes which run stepper motors/servos/leds etc. I am using the RF24Network library for this project and all of the nodes on this network are connected via sockets with built in capacitors and voltage regulators. The sockets are powered via the Arduino Nano’s 5V pin for all 3 nodes, however the power source for the arduinos vary.

All code is at the end of the post.
All microcontrollers are Arduino Nanos.

Node 0 is the remote control,
Node 1 is the receiver that primarily controls a stepper motor,
Node 2 is the receiver that primarily controls servos.

Right now I am currently trouble shooting the connection between node 0 and node 2. Currently the servo motor on node 2 is powered by the 5v along with the NRF however, my connection issues persist even when the servo is disconnected from the 5v rail and the NRF is the only device being powered from it.

The modules seem to work at random. Sometimes I will reset them and they will work for 5 minutes, sometimes for 10 seconds, and other times I am getting no connection under the same conditions. I understand these modules are quite sensitive in regards to how they are powered. The connection seems to work better when both node 0 and node 1 are powered via USB from my computer however the issues still occur. When I power the remote via battery pack, the issues seem to get worse. When testing the connection between node 0 and node 1, I was able to get the connection working reasonably well with the controller on battery power. Ultimately the controller will be powered via battery.

The issue with power is even more confusing based on what happened when I was getting node 0 and node 1 working. I had them working on usb, but when I switched the controller to battery it failed. I read in some thread that the devices will sometimes not work if they are too close together and so I backed farther away and this is how I was able to get node 0 and node 1 connected reliably with the controller on battery. This trick did not work with node 0 and node 2, I didn’t get any better results from backing up.

This leads me to believe that the issue may also lie with the setPALevel() method. Throughout my testing with node 0 and node 1, I left it as default but while troubleshooting node 0 and node 2, I tried changing it to low to see if the connection improved without consistent results. The final project needs to work when the nodes are separated by 1-5m.

I have also considered that using different channel might help, I am currently using 90. I have a 2.4GHz WIFI network at my house so that could maybe be adding noise into the system?

I ran out of characters so I have attached the code for all 3 nodes to this post.

To be clear, I am diagnosing connections from the serial prints inside the while(network.available()) loop which is present in each of the receivers (Node 1 and Node 2).

Sorry if this post was confusing, I am very confused myself. I admitadley don’t understand these modules very well so any insights could be useful.

This is also my first post in the forum so if I didn’t use any common conventions please let me know.

Remote_v2.1 - Node 0.ino (1.83 KB)

Stepper_Receiver_v2 - Node 1.ino (1.69 KB)

Servo_Receiver_v2.1 - Node 2.ino (2.55 KB)

DO you have some special version of the NRF24 that operate on 5 volts?

... and have you tried the example sketches that come with the RF24Network library?

If the examples provided by the author don't work reliably then there's no point chasing suspected bugs in your code.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.