NRF24L01 Remote Control LED

by RonFrtek in Circuits > Arduino

996 Views, 2 Favorites, 0 Comments

NRF24L01 Remote Control LED

NRF24L01 Remote Control LED using Arduino

In this tutorial we will explore Wireless Communication and learn how to control an LED with a button the NRF24L01 modules and arduino.

Watch the video!

What You Will Need

nrf24l01.jpg
LED-RED.png
download (3).jpg
FZEK4WBK3XGYAP0.LARGE.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
breadboard.png
download (5).jpg
  • 2X Arduino UNO (or any other Arduino)
  • Button
  • 2X nrf24l01 module
  • LED
  • 1k ohm resistor
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino


Brought by PCBWay

2022-08-26_13-41-18.jpg

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

2022-11-05_12-50-27.jpg

For this project we are using a NRF24L01 module together with a voltage adapter.

Wiring the Sender Arduino:

  • Connect NRF24L01 Adapter pin [VCC] to Arduino pin [5V]
  • Connect NRF24L01 Adapter pin [GND] to Arduino pin [GND]
  • Connect NRF24L01 Adapter pin "Chip Enable" [CE] to Arduino Digital pin [9]
  • Connect NRF24L01 Adapter pin "Chip Select" [CSN] to Arduino Digital pin [10]
  • Connect NRF24L01 Adapter pin [SCK] to Arduino Digital pin [13]
  • Connect NRF24L01 Adapter pin [MO] to Arduino Digital pin [11]
  • Connect NRF24L01 Adapter pin [MI] to Arduino Digital pin [12]
  • Connect Arduino pin [5V] to breadboard positive pin [Red line]
  • Connect Arduino pin [GND] to breadboard negative pin [Black line]
  • Connect Arduino Digital pin [2] to the Resistor and button
  • Connect other side of the resistor to the breadboard pin [GND]
  • Connect Other pin of the button to the breadboard positive pin [5V]




Wiring the Receiver Arduino:

  • Connect NRF24L01 Adapter pin [VCC] to Arduino pin [5V]
  • Connect NRF24L01 Adapter pin [GND] to Arduino pin [GND]
  • Connect NRF24L01 Adapter pin "Chip Enable" [CE] to Arduino Digital pin [9]
  • Connect NRF24L01 Adapter pin "Chip Select" [CSN] to Arduino Digital pin [10]
  • Connect NRF24L01 Adapter pin [SCK] to Arduino Digital pin [13]
  • Connect NRF24L01 Adapter pin [MO] to Arduino Digital pin [11]
  • Connect NRF24L01 Adapter pin [MI] to Arduino Digital pin [12]
  • Connect Arduino board pin [GND] to LED negative pin [-]
  • Connect Arduino board pin [2] to 1k ohm resistor
  • Connect 1k ohm resistor second pin to LED positive pin [+]



Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

For Sender Arduino - in Visuino Add, Set & Connect Components

2022-10-20_17-59-08.jpg
2022-10-20_18-01-45.jpg
F3B4BZGL9R2TRL9.jpg
F4PYXYNL9R2TRL8.jpg
2022-11-05_12-38-29.jpg
2022-11-05_12-21-30.jpg
2022-11-05_12-16-46.jpg
ff.png
  • Add "Debounce Button" component
  • Add "Toggle(T) Flip-Flop" component
  • Add "Pulse Generator" component
  • Add "Make Structure" component
  • Add "NRF24L01 Wireless" component


Note: we are adding Pulse generator to prevent packets getting lost


  • Select "PulseGenerator1" and in the properties window set "Frequency" to 10
  • Double click on the "MakeStructure1" and in the "Elements" window drag 2X "Digital" to the Left side
  • Close the "Elements" window


  • Connect Arduino digital pin [2] to "Button1" pin [In]
  • Connect "Button1" pin [Out] to "TFlipFlop1" pin [Clock]
  • Connect "TFlipFlop1" pin [Out] to "MakeStructure1" > "Digital1" pin [In]
  • Connect "PulseGenerator1" pin [Out] to "MakeStructure1" > "Digital2" pin [In]
  • Connect "MakeStructure1" pin [Out] to "NRF24L011" pin [In]
  • Connect "NRF24L011" pin Interface [SPI] To Arduino board pin [SPI]
  • Connect "NRF24L011" pin [Chip Select] To Arduino board digital pin [10]
  • Connect "NRF24L011" pin [Chip Enable] To Arduino board digital pin [9]

Upload the Project to the Arduino Board (see the Generate, Compile, and Upload the Arduino Code step)

For Receiver Arduino - in Visuino Add, Set & Connect Components

F9HVHXNL9R2TUHF.jpg
F2OR7YCL9R2TUMW.jpg
2022-11-05_12-40-37.jpg
2022-11-05_12-32-00.jpg
ff.png
  • Add "Split Structure" component
  • Add "NRF24L01 Wireless" component


  • Double click on the "SplitStructure1" and in the "Elements" window drag "Digital" to the Left side
  • Close the "Elements" window


  • Connect "NRF24L011" pin Interface [SPI] To Arduino board pin [SPI]
  • Connect "NRF24L011" pin [Chip Select] To Arduino board digital pin [10]
  • Connect "NRF24L011" pin [Chip Enable] To Arduino board digital pin [9]
  • Connect "NRF24L011" pin [Out] to "SplitStructure1" pin [In]
  • Connect "SplitStructure1" > "Digital1" pin [Out] to Arduino digital pin [2]


Upload the Project to the Arduino Board (see the Generate, Compile, and Upload the Arduino Code step)

Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino modules, and press the button the LED connected to the Receiver Arduino will turn On or Off.

Congratulations! You have completed your project with Visuino. Also attached are the Visuino project files for Sender and Receiver, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu