Arduino Project #00005 - NRF24l01 4 Channel relay + manual buttons

Well, this project is a "continue" of the project #00004 NRF24l01 to Serial Port module. The idea is pretty simple as always, but the devil is on the details.

I hang a 4ch low trigger solid state relay to an Arduino Nano, 1 NRF24l01 to accept commands to turn on and off a given channel, and 2 push buttons to operate the "device" manually. As there is no display in it, I added 2 LED`s that helps the user to know the channel he is turning on/off. It`s all in a box with a 5v power supply.

Here is the Arduino sketch.


- NRF24l01 is connect in standard way to Arduino, like in here.

- The LED that indicates ON/OFF status of a given channel is on PIN 4. It has a 220ohms resistor on it.

- The LED that indicates the current channel (blinking 1x to ch1, 2x to ch2, 3x to ch4 and 4x to ch4) is on PIN 3. Also 220ohns resistor here.

- A push button to turn ON/OFF a given channel is on A2. There is a 2.2 KOhms on it as Arduino documentation says.

- Another push button to "walk" from CH1 to CH4 and back to CH1 is on PIN A1. Also 2.2KOhms resistor.

- The 5v power supply connects to Raw and GND.

- Relay Channels are on PINS 10,9,6 and 5.

A huge improvement in the transmission and receiving of  the commands was the add of a 10uF electrolytic capacitor on GND and VCC of the NRF module.

And, as I`m pretty nob in 3d designing and printing, I added pieces of PVC to secure the top of the box of the case.

Also, I`m dumping here an basic idea of flow in node-red, so basically now I can control this relay via NRF and on my regular wifi network via MQTT, it`s just write the "command" in the topic (this will enter on Serial Port, and transmitted via NRF).

For test reasons, during the development of it I created an "spanner" hat keeps "choosing" one channel and asking it to turn ONN/OFF. Also asks for "status". Here is the code (just and Arduino connected to an NRF module).

Things around the web that helped me:

- Interference from NRF on my Wifi, since both use 2.4ghz, and in my case, they are both about 30cm close to each other.

2018-09-22 23:24:00
Computers and science as a way to live

As you may know, I`m a programmer, I work most in web projects, but not only. This area is a mess! Each day you have to recycle what you know in many ways. The thing is, a knowledge that change so often can`t afford wait to be translated to Portuguese for instance, at that time, the known will be already deprecated. English to me is a functional requirement. I can`t imagine my daily life without it. I have been studding English for serious since 2009. In this section you can see what I`m working on. Have fun as I do.
RSS Feed
"A vida é curta demais para ser pequena / The live is so short to be small / Das leben zu kurz sind für kleine sein". (Benjamin Disraeli)