Arduino - NRF24L01 2.4Ghz Wireless Relay Switch

Introduction: 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!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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/

IoT Builders Contest

Participated in the
IoT Builders Contest

Be the First to Share

    Recommendations

    • Finish It Already Speed Challenge

      Finish It Already Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020
    • First Time Author Contest

      First Time Author Contest

    5 Discussions

    0
    billwhite0847
    billwhite0847

    Question 8 months ago on Step 1

    Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"
    C:\Users\BILL\Documents\Arduino\sketch_wirless_relay_recver_aug27b\sketch_wirless_relay_recver_aug27b.ino: In function 'void loop()':
    sketch_wirless_relay_recver_aug27b:27:12: error: void value not ignored as it ought to be
    done = radio.read(DataMgs, 1);
    ^
    exit status 1
    void value not ignored as it ought to be
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    Hi this the error that will not allow this sketch to compile on arduino uno r3 from Arduino - NRF24L01 2.4Ghz Wireless Relay Switch
    please help me
    Regards BILL White
    photo.png
    0
    SeanF114
    SeanF114

    Question 1 year 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

    3
    VicençJ
    VicençJ

    1 year 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
    Dzintars
    Dzintars

    3 years ago

    Do you check working distance for you Wireless Relay Switch?

    How far its work?