nrf24l01 transmitter and receiver

so i’m trying out the NRF24l01 and i thought i would do a very basic push button activated led light, press the button on the transmitter and the led on the receiver comes on, release the button and the light goes out. however no matter how much i play with the code i can’t seen to get it to work again. i say again cause i used the 2 arduinos for another project but when i re-uploaded the same code to them it didn’t work. can anyone tell me what i’ve done wrong?

Wireless_Led_Control_Transmitter.txt (587 Bytes)

Wireless_Led_Control_Receiver.txt (535 Bytes)

Your transmitter is sending data every time through loop(). I doubt you need thousands of button states send every second. Try putting a delay in there so you only transmit a couple times a second.

How is your button wired up? You have it declared as an INPUT (vs. INTPUT_PULLUP) so you need an external pull-down resistor in your circuit. Do you have that?

this is how i have wired up my button

Capture.JPG

That button has 4 pins. Are you sure you have it oriented correctly? If it is rotated 90 degrees, then it won't work. A schematic is better than a picture (even a hand drawn one)

Have a look at this Simple nRF24L01+ Tutorial.

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

...R

You are missing an if (radio.available()) { clause in the receiver.

so i’ve updated the code and still no luck, i have and nrf24l01 adaptor on which is why i have 5v input voltage going to the nrf24

Wireless_Led_Control_Transmitter2.txt (489 Bytes)

Wireless_Led_Control_Receiver2.txt (586 Bytes)

Because you have no current limit resistor for the LED, you have probably destroyed the output transistor in your Nano.

Blue_aoi:
so i've updated the code and still no luck,

Have you tried the examples in the link I gave you?

...R

The high power versions you are using will only work stable with a decent 3.3V supply which a Nano can not provide.

Also, the high power versions may not work if they are too close together. Try placing them at least 3 metres apart.

...R

so i manged to get the led to work, turns out that if was an error with the receivers code. other thing i've learnt is that removing the arduino from the usb port and plug it back in made it work.

the output digital pins on the nano are 2.8v doesn't hurt the led which is 2.5v max when using it in short burst. range tested these nrf24l01 up to 110 meters and the delay is unnoticeable to the human eye. so now the basics works i'll more on to making 1 transmitter and 3 receiver nanos with an led connection indicator

thanks for your help guys

Blue_aoi:
the output digital pins on the nano are 2.8v doesn't hurt the led which is 2.5v max when using it in short burst.

Do not drive led without a current limiting resistor from an Arduino pin.
You can damage led and Arduino.

Blue_aoi:
other thing i’ve learnt is that removing the arduino from the usb port and plug it back in made it work.

That may be because the nRF24 does not reset when the Arduino resets - it only resets when the power is disconnected.

…R