Arduino - NRF24L01 2.4Ghz Wireless Relay Switch

About: Hello world! I make simple & Advanced projects for people who want to learn programming and electronics. Most of my Instructables are about arduino and the wide range of sensors you can use with it. I ma...

Hello world! Today i made a Wireless switch with the NRF25L01 - 2.4ghz Wireless Module. I used a nano in the video for the transmitter but you can change it to a uno if you don't have a nano. Check out the next step for the Schematics, Code's & parts list. Also complete fritzing files included!

Step 1: Schematic, Code & Parts List.

Wire it up like the above schematics, The Schematic with the NANO is for the TRANSMITTER and the Schematic with the UNO is for the RECEIVER.

MAKE SURE that you have installed the following libraries. Download RF24.hHere

  • SPI.h
  • nRF24L01.h
  • RF24.h

Parts list!

  • Arduino UNO for receiver
  • Arduino Nano for transmitter ( You can use 2 nano's, or 2 Uno's to if prefered.. i just used a nano cuz its nice and small)
  • NRF24L01 2.4 Ghz Wireless Module.
  • KY-019 1 Channel relay
  • Jumper Wires Set MM/FF/MF
  • Perfboard / prototype board for buttons (or just a Solderless BreadBoard)

Good luck!

Buy sensors here: http://arduinosensors.nl

See more projects on my blog! http://blog.arduinosensors.nl/

Share

    Recommendations

    • Paper Contest

      Paper Contest
    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest
    • Remix Contest

      Remix Contest

    4 Discussions

    0
    None
    SeanF114

    Question 5 months ago on Step 1

    Arduino: 1.8.6 (Windows 8.1), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Sean\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10806 -build-path C:\Users\Sean\AppData\Local\Temp\arduino_build_337003 -warnings=none -build-cache C:\Users\Sean\AppData\Local\Temp\arduino_cache_909506 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Sean\Desktop\Receiver\Receiver.ino

    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Sean\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10806 -build-path C:\Users\Sean\AppData\Local\Temp\arduino_build_337003 -warnings=none -build-cache C:\Users\Sean\AppData\Local\Temp\arduino_cache_909506 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Sean\Desktop\Receiver\Receiver.ino

    Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

    Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

    Detecting libraries used...

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp" -o nul

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp" -o nul

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp" -o nul

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24" "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src\\SPI.cpp" -o nul

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24\\utility" "C:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24\\RF24.cpp" -o nul

    Generating function prototypes...

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp" -o "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\preproc\\ctags_target_for_gcc_minus_e.cpp"

    "C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\preproc\\ctags_target_for_gcc_minus_e.cpp"

    Compiling sketch...

    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10806 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Sean\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp" -o "C:\\Users\\Sean\\AppData\\Local\\Temp\\arduino_build_337003\\sketch\\Receiver.ino.cpp.o"

    C:\Users\Sean\Desktop\Receiver\Receiver.ino: In function 'void loop()':

    Receiver:27:12: error: void value not ignored as it ought to be

    done = radio.read(DataMgs, 1);

    ^

    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI

    Using library RF24 at version 1.3.1 in folder: C:\Users\Sean\Documents\Arduino\libraries\RF24

    exit status 1

    void value not ignored as it ought to be

    2
    None
    VicençJ

    7 months ago

    Thank you very much for your help in advance, but when I compile the reciver it says:

    C:\Users\HP\Downloads\receiver_13072018\receiver_13072018.ino: In function 'void loop()':

    receiver_13072018:27: error: void value not ignored as it ought to be

    done = radio.read(DataMgs, 1);

    0
    None
    Dzintars

    1 year ago

    Do you check working distance for you Wireless Relay Switch?

    How far its work?