How to change NRF24l01 frequency channel

I am using 2 UNO & NRF for establishing connection between 2 UNO.
Here is my code!
TRANSMITTER:-

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(7,8);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int SW1 = 7;

void setup(void){
 Serial.begin(9600);
 radio.begin();
 radio.openWritingPipe(pipe);}

void loop(void){
 if (digitalRead(SW1) == HIGH){
 msg[0] = 111;
 radio.write(msg, 1);}}

And at receiver:-

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(7,8);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;

void setup(void){
 Serial.begin(9600);
 radio.begin();
 radio.openReadingPipe(1,pipe);
 radio.startListening();
 pinMode(LED1, OUTPUT);}

void loop(void){
 if (radio.available()){
   bool done = false;    
   while (!done){
     done = radio.read(msg, 1);      
     Serial.println(msg[0]);
     if (msg[0] == 111){delay(10);digitalWrite(LED1, HIGH);}
     else {digitalWrite(LED1, LOW);}
     delay(10);}}
 else{Serial.println("No radio available");}}

But I am getting only ‘NO RADIO AVAILABLE’
So I dont understand my mistakes.
I also read that we need to put 10u+ cap on boared so I put 10uelectrolytic cap between NRF vcc and ground.
But still no success.
I am curently powering my UNO and NRF with USB from comp is that a issue? do i need seperate adapter supply?
Can i use serial monitor even after using adapter?

for my knowing there is no problem with your connection (i'm using 10uF cap from my UNO that conect to the PC and it's work fine). do you try the getting started example?

@yatin, why are you also asking questions about this project in another Thread. That just wastes everyone’s time. Keep all of the discussion here.

This is the answer I already gave in the other Thread

Quote from: yatin on Today at 10:05:14

Guys I am trying to establish communication with 2 UNO using NRF24L01, with code mentioned be thread creator!

You need to be more specific. Post the code YOU are actually using.
And please use the code button </>
Code: [Select]

so your code looks like this

and is easy to copy to a text editor

Quote

I am powering my UNO using a USB which is connected to my comp. so is that the issue?
Do i need to power it up separately or power my UNO with 1A adapter?
Or i can do this with increasing my capacitor and if I use adapter can I steel check my serial monitor?

I have had my nRF24’s working fine with an Uno and Mega powered from USB and (as I said in Reply #30) without any capacitors. However capacitors won’t hurt.

Have you tried the tutorlial linked in Reply #23 ?

…R

Ok I got it, with your suggested tutorial ROBIN2,
Now switching to next step I want to make multiple 1to1 links of rf communication in 50 meter range nearely 10 of such link which could communicate with there soecified transmitter/receiver only means 10pair, and it should be able to send receive simultaniously!
SO How can I do this, could it possible to select channel as I read that RF_CH register can select specific channel and then can I put my pair on one channel and keeping 2/3 channel band between two?
How to use that is directly putting it in code can make it?
Or do i need other libraries?

How to change channel in this or any other library?
Like radio head or any popular is directly making RF_CH Register = 0X07 will make selection of 7th channel or do i have to do something for it?

yatin:
Now switching to next step I want to make multiple 1to1 links of rf communication in 50 meter range nearely 10 of such link which could communicate with there soecified transmitter/receiver only means 10pair, and it should be able to send receive simultaniously!

Do you mean you want 10 pairs to work at the same time indepently of the other pairs, or do you mean that you want one (the Master) to communicate one-by-one with each of the others?

In either case I think it can simply be achieved by assigning different IDs (pipe numbers). I think they don't need to use different channels. I have successfully tested both ways using different IDs - however just with 2 pairs.

I discovered yesterday that this tmr20h Library works better than the original ManiacBug library that I had been using

...R

Thanks Robin for your valuable time,
Yes I want 10 separate pairs not 1 tx and 10 rx.
We can only use 6 pipeline and I will get 20 devices plus taking them in mesh or otherstyle of network will increase time and complexity also need more power but if I could able to use different bands directly it will give me separation also and even will need less power and complexity!
Yatin

yatin:
We can only use 6 pipeline

That's not what I was referring to, and I can understand the reason for the confusion. It is very unfortunate that pipe has been used as the name for the variable in this line

const uint64_t pipe = 0xE8E8F0F0E1LL;

It would be much better if it was called deviceID. The number is quite unrelated to the concept of the 6 pipelines.

What I have in mind is that each device gets a different deviceID and in each case this line

radio.openWritingPipe(pipe);}

would be

radio.openWritingPipe(deviceID);}

and the receiver would have a corresponding line

radio.openReadingPipe(1,deviceID);

meaning that it was using Pipe1 to listen for messages addressed to deviceID

You could use the other readingPipes to listen for several messages at the same time - but you don't need that.

As far as I can see you can have literally millions of different deviceIDs - though the airwaves might get a bit crowded :slight_smile:

I hope this makes it clearer.

...R

Ok Robin,
I have little confusion on this make me correct where I am wrong!
1.As I was working on 433Mhz simple RF modules before this If I make device ID and transmit and check
ID before reception it confirms that it will only receive the data from that device ID.
2.But even in that if I transmit two separate signal with different ID (AS ID is just a burst of prefix pulses in packet) it still conflicts at RX terminal as both uses exact same frequency and modulation is ask they got overlap.
3. Is there is any other provision in NRF24l01? about deviceID? Or it just eliminated by retry count as it has feedback topology!
4. If this race around condition is sorted out by feedback topology then what happens if both re-transmit on same retry interval again?
5.Is there no way we can use that RF_CH register as I remember 315MHZ signal of my remote didnt interfare with 433! And if with one instruction I could able to change the channel itself then there will be no need to make that retries and all!

Also right now I am only getting 2meter range, Why is it so?
Is thats maximum range of these http://www.amazon.in/gp/product/0070923507?redirect=true&ref_=s9_simh_gw_p23_d4_i1
Or is that is because that resister of output power selection, How to configure RF_SETUP REGISTER?
And it is in default at 0db so what should i do to increase its strength i need 8 meter range.

Can I assume that the comparison with the 433MHz system in Reply #8 is now irrelevant. (I have no experience of 433MHz)

The nRF24s that I have look the same as in your link. I have done nothing about the power setting and they have worked perfectly at 15 metres range. I think they should have a bigger range than that, but I have not needed it.

Maybe you are in the unfortunate position of having interference from other systems. Try using a different channel (i.e. a different wireless frequency). Obviously make sure you use the same channel for Tx and Rx.

...R

But again how to change channel remains same?
I didnt founf exact area where i should/ I can change value of channel!

yatin:
But again how to change channel remains same?
I didnt founf exact area where i should/ I can change value of channel!

You must not have read the documentation

...R

Yes got it also got my expected result, just needed to add few commands as follows!

radio.setCRCLength(RF24_CRC_16);
radio.setDataRate(RF24_250KBPS);
radio.setChannel(35);
radio.setPALevel(RF24_PA_MAX);

I am creating a project thread now as I will need different type of support over this but thanks a lot for this support!

Hello guys thanks for your support for me oer different links!
I am using 2 NRF24l01 with 2 UNO where one is used for transmitting and other for RX!
My basic objective is I want to transmit signal (same signal) to receiver side when a single button is pressed ( this will happen when screw get tighten and it will be pressed for 20ms on approx)
My receiver will be at wall so will be powered using mains but my transmitter will be handheld so I have to power it with battery!
Now to increase battery life I want to put my TX arduino and NRF in power down mode and i will wake up my arduino with interrupt over pin change.
Now my problem is How I could wake up NRF module I saw few example of it but they used watchdog as there need was periodic but in my project I cant predict intervals so watchdog will be of no use!
So any body know how to make NRF wake up with micro controller, or is any command arrive from uC will wake it up?
If there is any good link by reading it I could get better approach or inputs then please tell me!

I can't see any reason why you are starting a separate Thread about the same project

There is a lot of background info in your other Thread that should be available to everyone. Please ask the Moderator to merge this with your other Thread.

but in my project I cant predict intervals so watchdog will be of no use!

That does not make any sense for me.

The important design feature is that the Tx should send a complete message during the interval that the Rx is awake. You could achieve that by having the Tx send messages regularly in the hope that some will be detected. Or you could have the Rx initiate a conversation when it wakes up (which rather raises the question which is the Rx and which is the Tx).

How often do you need the Rx to check for new messages?
You can set the WDT to operate after as little as 16 millisecs

...R

it's the TX that's sleeping...

123Splat:
it's the TX that's sleeping...

Yes, I see that I got things mixed up.

But if the Tx is sleeping I can't see what the problem is?

...R

me either...
the rx just sits there waiting for sig input.
the tx wakes up, or gets turned on, and tells the nrf2400 to shout to the rx.
sounds like a waste of a 2400, when one of those 315MHz to 433MHz ASK modules would do the trick (to the limit described) and you might even get away without a arduino on the xmit side.

123Splat I tried this with 433 and 315 but my problem is I want such 10 pair which could able to work simultaniously without conflicting other so I am using NRF I know that NRF is much more capable to do!
My problem is I saw pingpair sleepy ecample but they use watchdog on nrf to wake him us from slip, I want to make sleep by uC comand and I again want to wake him up with uC comand is it possible? Which command can wake him up? My RX will watching it all time that is not my problem but my tx means the onr handheld unit I have to opperate with battery need to sleep and wake up on every digital pin 3 change on my UNO, My button (pin 3) will be close for 20ms and can be get closed 3 times in a min.
I didnt got any example or document on waking up NRF other than by using watchdog so I am asking for some link which will guide me through it!