SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By drakescherer
#189842
Hey all,

I am trying to figure out how I can have 2 Arduino Nano's paired with 2 NRF24L01's and have one arduino have up to the maximum amount of inputs (for this case it'll be reed switches to start and likely motion sensors afterwards) which through the NRF24L01 will send commands to a remote arduino to write the corresponding pins high (like virtualwire, but I don't understand VW) which will control relays on the remote side.

I can't find any example code with more than 1 relay setup.

Here is an example of what I am looking for:
http://www.14core.com/wiring-the-nrf24l ... switching/

but with multiple inputs on the transmitting arduino and corresponding outputs on the receiving arduino.

As it stands right now, i have 5 arduino Nano's and 10 of the RF24L01 modules, so I am ready to try just about anything to make this work!
By drakescherer
#189850
I have made some changes to the code supplied on that website because when I was triggering an input on the transmitter, I could do it on basically any pin and it would transmit out. I switched that by making the message send if the pin was low rather than high.

The thing I'd really like to be able to do is have that code setup to only transmit when there is a change on the input (high->low or low->high) so we can save (eventually) battery power. This also means the receiver will have to respond the same way.

I've been trying to find code that people use for joysticks and modify that but due to the complexity of their code and the addition of analog signals (bit over my head at this point) I can't really make any real modifications. I also found some code for reed switches on the IOTplayground website:

http://iot-playground.com/blog/2-uncate ... dow-sensor

But it is highly integrated to their IOT server which I don't care for. Nor do I care for battery life reporting.

Again, any and all help is appreciated. I've been trying to put a ton of work into researching how to do this, but I'm like a month old into arduino, and about a week old into the nrf24l01 modules. I'm also willing to pay a couple bucks if someone can show me how to do this/write code that I can understand and modify.