So... I am making my final project for this year in school.
I've decided to do something using two NRF24L01 modules, but I am having a big problem with the communication between the two of them, it just won't work!
Here's what I am trying to do for now, make a led turn on when a push button is pressed, the schematic for the circuits I am using, are those:
I've tested the push button with the serial monitor, it's working and the led is turning on.
But when I try to turn on the led with the button, it just doesn't work, nothing happens... what could it possibly be?
if (buttonState1 == 1)
{
buttonState1 = 1;
}
else if (buttonState1 == 0)
{
buttonState1 = 0;
}
This is completely useless. If buttonState1 is 1 you set it to 1? It
You may be transmitting so quickly the receiver gets overwhelmed. You should only be transmitting when you detect a change in the button. Look at the State Change Detection example in the IDE (File->examples-02.Digital->State Change Detection) and then only send a signal when something is different.
To test this theory out, you could simply introduce a delay() into your transmit code such that is only sends something every second or two.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
If you are using the high-power nRF24s (with the external antenna) make sure there is sufficient distance between the two nRF24s so that the signal does not overwhelm the receiver - try 3 metres separation. If you are new to nRF24s it may be better to start with a pair of low power modules with the pcb antenna.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
If you are using the high-power nRF24s (with the external antenna) make sure there is sufficient distance between the two nRF24s so that the signal does not overwhelm the receiver - try 3 metres separation. If you are new to nRF24s it may be better to start with a pair of low power modules with the pcb antenna.
...R
Been trying everything from your post, nothing is working...
Here is what I got from the test of communication between the Arduino (I am using two Arduino UNO for the tests) and the NRF24L01:
I want to mention one thing also, I think that I've connected the NR14L01 modules to the 5V pin on the Arduino Nano once, could that possibly made the modules faulty?
Your second connection test seems to be working properly but the first one is not. The usual problem is incorrect connections or loose connections.
What happens if you use the nRF24 from the second test with the Uno from the first test?
If you are still having problems please make two pencil drawings showing how YOU have everything connected and post photos of the drawings. The business of making the drawing can often show up errors.