Simplest wireless switch

I want to activate a relay wirelessly. What is the simplest way to do this? I'm already using an arduino uno in the project so preferably something compatible. I have no need to send any data. Just switch

Well, on-off status is data...

How far apart? The NRF24L01’s radios are very inexpensive, easy to use and can reach 10 meters or so indoors. The high power version can reach significantly further.

The 433 MHz radios also work well for similar applications.

What kind of wireless connection do you have in mind?
How do you plan to provide the signal on the sender side?
What is the distance to cover, and the general environment the signal has to travel through?
(note: 433 MHz can be used legally only in certain localities, so that's yet another concern).

This Simple nRF24L01+ Tutorial may be of interest.

...R

What is the simplest way to do this?

This way. Arduino can imitate or replace either end using the RCSwitch library.

So I decided to go with the nRF24L01+ for the wireless communication. They arrived today and after using the tutorial, was able to get the two Unos to communicate. All I have tested at this point is the first example which is sufficient for my intended purpose. Now I need to understand the process.

To start with when you define the constant for the radio address can someone please explain the format?

A variable is being defined as a constant, making it read only
The data type is a byte. 8 bits of data.
Next the variable is named but what about the brackets [5]? The address is RxAAA and seems to be in an array format. Possibly for serial communication.

Thanks in advance for any help.

Sounds like an array, but why don't you post the relevant line of code itself? Or better even, the whole sketch with it.

It is just one of several ways of creating a 40 bit number - which is the node address of the NRF24 module. There is no really clean way to do this since there is no native 40 bit type in the GCC compiler. Since the station address is usually fixed for the life of the unit, it is declared as a constant.

I have seen some code use a 64 bit variable but then that’s confusing too since 24 bits of the variable are not used and you could duplicate addresses if you’re not aware of the byte order in memory. All things considered, the 5 byte array is a decent solution to the problem, especially when ascii characters are used, making it easy to read station addresses.

This is the line of code from my Tutorial that defines the address

const byte slaveAddress[5] = {'R','x','A','A','A'};

It creates an array of 5 bytes having the values 82, 120,65,65,65 (in decimal). It could also be written

const byte slaveAddress[5] = {8,120,65,65,65};

but using characters seems clearer to me.

If you want to use a different address just change the characters R, x, A, A, A or just use any value from 0 to 255 in each slot. IIRC the nRF24 datasheet recommends against addresses that are all binary 0s or binary 1s

...R

Thank you very much. I'm just trying to go through the tutorial myself and comment out every line to make sure I understand everything that is going on. I'll need something similar for a project. New to this so apologize for not posting relevant code. I thought I did.

Last question in this thread. If I am to continue commenting out the tutorial, and have any questions, where would I start that thread? Just so it's in the right place.

Thank you all again.

JerkStore:
Last question in this thread. If I am to continue commenting out the tutorial, and have any questions, where would I start that thread? Just so it's in the right place.

Thank you all again.

It will be easier to help if you just post your questions here as all the background info will be in one place.

...R