Arduino Wireless Communication - NRF24L01 Tutorial
Arduino Wireless Communication - NRF24L01 Tutorial
Arduino Wireless Communication - NRF24L01 Tutorial
(https://howtomechatronics.com)
WHAT'S NEW? Arduino Robot Arm and Mecanum Wheels Platform Automatic Op…
(https://www.youtube.com/user/DejanNedelkovski)
(https://plus.google.com/+Howtomechatronics)
(https://www.facebook.com/howtomechatronics/)
Follow me on: ()
Home (https://howtomechatronics.com)
Tutorials (https://howtomechatronics.com/category/tutorials/) Arduino Tutorials
(https://howtomechatronics.com/category/tutorials/arduino/)
72 (https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-
tutorial/#comments)
In this Arduino tutorial we will learn how to make a wireless communication between two
Arduino boards using the NRF24L01 transceiver module. You can watch the following video or
read the written tutorial below.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 1/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Overview
For explaining the wireless communication we will make two examples, the rst one will be
sending a simple “Hello World” message from one Arduino to another, and in the second
example we will have a bi-directional communication between the Arduino boards, where
using the Joystick at the rst Arduino we will control the servo motor at the second Arduino,
and vice versa, using the push button at the second Arduino we will control the LED at the rst
Arduino.
Let’s take a closer look at the NRF24L01 transceiver module. It uses the 2.4 GHz band and it
can operate with baud rates from 250 kbps up to 2 Mbps. If used in open space and with
lower baud rate its range can reach up to 100 meters.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 2/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
The module can use 125 di erent channels which gives a possibility to have a network of 125
independently working modems in one place. Each channel can have up to 6 addresses, or
each unit can communicate with up to 6 other units at the same time
(https://howtomechatronics.com/tutorials/arduino/how-to-build-an-arduino-wireless-network-
with-multiple-nrf24l01-modules/).
The power consumption of this module is just around 12mA during transmission, which is
even lower than a single LED. The operating voltage of the module is from 1.9 to 3.6V, but the
good thing is that the other pins tolerate 5V logic, so we can easily connect it to an Arduino
without using any logic level converters.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 3/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Three of these pins are for the SPI communication and they need to be connected to the SPI
pins of the Arduino, but note that each Arduino board have di erent SPI pins. The pins CSN
and CE can be connected to any digital pin of the Arduino board and they are used for setting
the module in standby or active mode, as well as for switching between transmit or command
mode. The last pin is an interrupt pin which doesn’t have to be used.
So once we connect the NRF24L01 modules to the Arduino boards we are ready to make the
codes for both the transmitter and the receiver.
You can get the components needed for this Arduino Tutorial from the links below:
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 4/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
*Please note: These are a liate links. I may make a commission if you buy the components through
these links. I would appreciate your support in this way!
Arduino Codes
Here are the two codes for the wireless communication and below is the description of them.
Transmitter Code
1. /*
2. * Arduino Wireless Communication Tutorial
3. * Example 1 - Transmitter Code
4. *
5. * by Dejan Nedelkovski, www.HowToMechatronics.com
6. *
7. * Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
8. */
9.
10. #include <SPI.h>
11. #include <nRF24L01.h>
12. #include <RF24.h>
13.
14. RF24 radio(7, 8); // CE, CSN
15.
16. const byte address[6] = "00001";
17.
18. void setup() {
19. radio.begin();
20. radio.openWritingPipe(address);
21. radio.setPALevel(RF24_PA_MIN);
22. radio.stopListening();
23. }
24.
25. void loop() {
26. const char text[] = "Hello World";
27. radio.write(&text, sizeof(text));
28. delay(1000);
29. }
Receiver Code
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 5/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
1. /*
2. * Arduino Wireless Communication Tutorial
3. * Example 1 - Receiver Code
4. *
5. * by Dejan Nedelkovski, www.HowToMechatronics.com
6. *
7. * Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
8. */
9.
10. #include <SPI.h>
11. #include <nRF24L01.h>
12. #include <RF24.h>
13.
14. RF24 radio(7, 8); // CE, CSN
15.
16. const byte address[6] = "00001";
17.
18. void setup() {
19. Serial.begin(9600);
20. radio.begin();
21. radio.openReadingPipe(0, address);
22. radio.setPALevel(RF24_PA_MIN);
23. radio.startListening();
24. }
25.
26. void loop() {
27. if (radio.available()) {
28. char text[32] = "";
29. radio.read(&text, sizeof(text));
30. Serial.println(text);
31. }
32. }
Description:
So we need to include the basic SPI and the newly installed RF24 libraries and create an RF24
object. The two arguments here are the CSN and CE pins.
Next we need to create a byte array which will represent the address, or the so called pipe
through which the two modules will communicate.
We can change the value of this address to any 5 letter string and this enables to choose to
which receiver we will talk, so in our case we will have the same address at both the receiver
and the transmitter.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 6/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
In the setup section we need to initialize the radio object and using the
radio.openWritingPipe() function we set the address of the receiver to which we will send data,
the 5 letter string we previously set.
1. radio.openWritingPipe(address);
On the other side, at the receiver, using the radio.setReadingPipe() function we set the same
address and in that way we enable the communication between the two modules.
1. radio.openReadingPipe(0, address);
Then using the radio.setPALevel() function we set the Power Ampli er level, in our case I will
set it to minimum as my modules are very close to each other.
1. radio.setPALevel(RF24_PA_MIN);
Note that if using a higher level it is recommended to use a bypass capacitors across GND and
3.3V of the modules so that they have more stable voltage while operating.
Next we have the radio.stopListening() function which sets module as transmitter, and on the
other side, we have the radio.startListening() function which sets the module as receiver.
1. // at the Transmitter
2. radio.stopListening();
1. // at the Receiver
2. radio.startListening();
In the loop section, at the transmitter, we create an array of characters to which we assign the
message “Hello World”. Using the radio.write() function we will send that message to the
receiver. The rst argument here is the variable that we want to be sent.
1. void loop() {
2. const char text[] = "Hello World";
3. radio.write(&text, sizeof(text));
4. delay(1000);
5. }
By using the “&” before the variable name we actually set an indicating of the variable that
stores the data that we want to be sent and using the second argument we set the number of
bytes that we want to take from that variable. In this case the sizeof() function gets all bytes of
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
the strings “text”. At the
Ok
endRead
of the program we will add 1 second delay.
more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 7/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
On the other side, at the receiver, in the loop section using the radio.available() function we
check whether there is data to be received. If that’s true, rst we create an array of 32
elements, called “text”, in which we will save the incoming data.
1. void loop() {
2. if (radio.available()) {
3. char text[32] = "";
4. radio.read(&text, sizeof(text));
5. Serial.println(text);
6. }
7. }
Using the radion.read() function we read and store the data into the “text” variable. At the end
we just print text on the serial monitor. So once we upload both programs, we can run the
serial monitor at the receiver and we will notice the message “Hello World” gets printed each
second.
Let’s see the second example, a bi-directional wireless communication between two Arduino
boards. Here’s the circuit schematics:
You can get the components needed for this example from the links below:
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 8/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
*Please note: These are a liate links. I may make a commission if you buy the components through
these links. I would appreciate your support in this way!
See Also
Source Codes
Here are the two codes and below is the description of them.
Transmitter Code
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
1. /* Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
2. * Arduino Wireless Communication Tutorial
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 9/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Receiver Code
1. /*
2. * Arduino Wireless Communication Tutorial
3. * Example 2 - Receiver Code
4. *
5. * by Dejan Nedelkovski, www.HowToMechatronics.com
6. *
7. * Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
This website
8. */ uses cookies to improve user experience. By using our website, you agree to our use of cookies.
9. Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 10/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
10. #include <SPI.h>
11. #include <nRF24L01.h>
12. #include <RF24.h>
13. #include <Servo.h>
14.
15. #define button 4
16.
17. RF24 radio(7, 8); // CE, CSN
18. const byte addresses[][6] = {"00001", "00002"};
19. Servo myServo;
20. boolean buttonState = 0;
21.
22. void setup() {
23. pinMode(button, INPUT);
24. myServo.attach(5);
25. radio.begin();
26. radio.openWritingPipe(addresses[0]); // 00001
27. radio.openReadingPipe(1, addresses[1]); // 00002
28. radio.setPALevel(RF24_PA_MIN);
29. }
30.
31. void loop() {
32. delay(5);
33. radio.startListening();
34. if ( radio.available()) {
35. while (radio.available()) {
36. int angleV = 0;
37. radio.read(&angleV, sizeof(angleV));
38. myServo.write(angleV);
39. }
40. delay(5);
41. radio.stopListening();
42. buttonState = digitalRead(button);
43. radio.write(&buttonState, sizeof(buttonState));
44. }
45. }
What’s di erent here from the previous example is that we need to create two pipes or
addresses for the bi-directional communication.
In the setup section we need to de ne both pipes, and note that the writing address at the
rst Arduino needs to be the reading address at the second Arduino, and vice versa, the
reading address at the rst Arduino needs to be the writing address at the second Arduino.
1. // at the Transmitter
2. radio.openWritingPipe(addresses[1]); // 00001
3. radio.openReadingPipe(1, addresses[0]); // 00002
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
1. // at the Receiver
2. Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
radio.openWritingPipe(addresses[0]); // 00002
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 11/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
3. radio.openReadingPipe(1, addresses[1]); // 00001
In the loop section using the radio.stopListening() function we set the rst Arduino as
transmitter, read and map the value of Joystick from 0 to 180, and using the radio.write()
function send the data to the receiver.
1. radio.stopListening();
2. int potValue = analogRead(A0);
3. int angleValue = map(potValue, 0, 1023, 0, 180);
4. radio.write(&angleValue, sizeof(angleValue));
On the other side, using the radio.startListening() function we set the second Arduino as
receiver and we check whether there is available data. While there is data available we will
read it, save it to the “angleV” variable and then use that value to rotate the servo motor.
1. radio.startListening();
2. if ( radio.available()) {
3. while (radio.available()) {
4. int angleV = 0;
5. radio.read(&angleV, sizeof(angleV));
6. myServo.write(angleV);
7. }
Next, at the transmitter, we set the rst Arduino as receiver and with an empty “while” loop we
wait for the second Arduino the send data, and that’s the data for the state of the push button
whether is pressed or not. If the button is pressed the LED will light up. So these process
constantly repeats and both Arduino boards are constantly sending and receiving data.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 12/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
(https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/)
JLCPCB – Prototype PCBs for $2 (For Any Color) & 24-Hour Lead Time
(https://jlcpcb.com)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
(https://jlcpcb.com)
Arduino (https://howtomechatronics.com/tag/arduino/)
Communication (https://howtomechatronics.com/tag/communication/)
NRF24L01 (https://howtomechatronics.com/tag/nrf24l01/)
Wireless (https://howtomechatronics.com/tag/wireless/)
Тutorial (https://howtomechatronics.com/tag/tutorial/)
SHARE ON:
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 13/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
1&url=https%3A%2F%2Fhowtomechatronics.com%2Ftutorials%2Farduino%2Farduino-wireless-communication-nrf24l01-
tutorial%2F&media=https%3A%2F%2Fhowtomechatronics.com%2Fwp-content%2Fuploads%2F2017%2F02%2FArduino-
Wireless-Communication-NRF24L01-
Tutorial.jpg&description=Arduino%2BWireless%2BCommunication%2B%26%238211%3B%2BNRF24L01%2BTutorial)
Tweet
R E L AT E D P O S T S
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 14/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
13 (https://howtomechatronics.com/tutorials/arduino/how-to-build-an-arduino-wireless-network-with-
(https://howtomechatronics.com/tutorials/arduino/how-to-build-an-arduino-wireless-network-
multiple-nrf24l01-modules/#comments)
with-multiple-nrf24l01-modules/)
HOW RFID WORKS AND HOW TO MAKE AN ARDUINO BASED RFID DOOR LOCK
(HTTPS://HOWTOMECHATRONICS.COM/TUTORIALS/ARDUINO/RFID-WORKS-MAKE-ARDUINO-BASED-RFID-DOOR-
LOCK/)
(https://howtomechatronics.com/tutorials/arduino/r
Ok d-works-make-arduino-based-r d-door-
Read more (https://howtomechatronics.com/privacy-policy-page/)
38 (https://howtomechatronics.com/tutorials/arduino/rfid-works-make-arduino-based-rfid-door-
lock/#comments)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 15/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
lock/#comments)
lock/)
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
(https://howtomechatronics.com/tutorials/arduino/how-to-use-a-rgb-led-with-arduino/)
72 RESPONSES
Thank you for sharing this very useful tutorial. Can you help me with the code to control
More than one servo (I need to control 6 servo) using 6 potentiometer in one direction?
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 16/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Well this shouldn’t be a problem, you just have to send those potentiometer values to
the other Arduino and apply them to the servo motors. The same method would be
used.
REPLY
if you use a uno R3 board on the transmitter and receiver, what pins are you using for
your push button and joystick, LED, and servo. have to set it up to understand how it
works.
thanks,
REPLY
The important thing is that you need to use the SPI pins of the Arduino board for the
NRF24L01 module, or that’s the pins 13-SCKI, 12-MISO and 11-MOSI. For anything else,
you can use any pin.
don’t go by diagram for Nano audrino go by written pin connection for 13… its good
program… thanks to the programmer
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
REPLY Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 17/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Hi,how can send data for speci c pipe and get answer from it.
Master have one address and if send data all slave get,s it?
I wont have one master that get data from 2 slave.
REPLY
Hi, do you know any possible reason why my serial output is “yyyyyy yyyyyy yyyyy”???
REPLY
Might be your serial monitor baud rate, check whether it matches with the baud rate set
in the program.
REPLY
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 18/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Can I extend the range to 200 meters by using a repeater. Master to repeater (slave/master)
to other slaves and back?
REPLY
Could be possible.
REPLY
Hello, is your circuit diagram is wrong? The SCK of nrf2401 is not going to Pin 13 of arduino
nano.
REPLY
Hi Mr. Dejan,
I have already implemented this project using two Arduino NANOs.
Initially it was not working but after several hours of inspections I got a very important
notice and would like to share it with all your follower. To get 2 NANOs wireless
connected and communicating then auxiliary SPI pins must be used instead of D11, D12,
and D13.
I nally got them working like dream. Thank you very much for sharing your lovely
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
project. Cheers!
Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 19/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
Hi , It is a good one .
Can we use arduino nano , UNO.
REPLY
REPLY
if uno is used for transmitter, what are the replacement pins for 50,51,52 of the Mega?
Thanx
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 20/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Your tutorials are just wonderful. I very much like the way you present them. Very clear and
very helpful. Keep up, man!!
REPLY
Thank you!
REPLY
Hi. Wonderfull explanation. Q? Will system stand duplex if continuously move the joystick?
In this case the program will be inside the while() function all time.
REPLY
This websiteItuses
Thanks. cookieson
depends to improve user experience.
the situation By using
but it could our You
work. website,
canyou agreein
notice tothe
our introduction
use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 21/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
Hi dejan
I have successfully trans communicated with mega 2560 to uno. … But my problem is the
connection is not lasting for long time ..its just working for few seconds and stopping…
Resetting on both boards Is also not working … When I disconnect two boards and connect
them to power supply again its working for few seconds… But working time is di erent in
each case….. Can you help me with this
REPLY
The problem might be the power. Try to use more stable external power. These wireless
module can be power hungry when transmitting data, so you might be losing the
connection. Also try yo use decoupling capacitors.
REPLY
hi all!
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 22/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
rst, I want to congratulate dejan ’cause his tutos are wonderfull like sbdy say it before
me!
in second, I’d the same problem of function-malfunction after two or three times using
the joystick and it seems it was due cause using a non genuine uno.
when I change it for a genuine Arduino uno, the problem was solved… curious…
REPLY
REPLY
Great, thanks!
REPLY
Thanks. The two resistors used in the second example are 220 Ohms.
REPLY
Hi there!
I was able to make this project work. However, I am faced with an issue. Whenever I move
the two Arduino boards (each with the NRF24L01 module attached in them), the signal gets
lost. It was as if the modules can only work less than one meter in range? Unless I have
missed something from the tutorial.
REPLY
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 24/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Do you have any ideas on how to establish a connection and receive data with a laptop
computer rather than a second arduino?
Thanks
REPLY
You can use a Bluetooth Module for that purpose. I already have a tutorial how to do it
using a Bluetooth module.
REPLY
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 25/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
The link is included in this article already. You can nd it right under the “Arduino Codes”
section.
REPLY
hello! great video! thank you for uploding, I have a problem my module doesnt recieve any
data(I’m using arduino nano as tranciever and uno as reciever).I checked the wiring many
times i tried it 100 ways to get it work but i haven’t succeeded yet.
Is there any oportunity with this library to check if the arduino can communicate with rf24 ?
I searched in the RF24.h and i found a bool ChipIsConnected() but it doesnt return anything.
REPLY
Try using a capacitor across the 3.3V and GND pins. The code library and the code I used
for in this project are working 100%.
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 26/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
could be the distance between the two modules…it is almost 10 cm max, because of
the (PA _MIN).. try to bring them near to each others, or replace the _MIN with _LOW.
if you have a capacitor connected, just remove the line in both sketches.
Good luck
Hi thank a lot for your example but i have a little problem maybe about the rf signal. i use
uno r3 as transceiver and nano as receiver when i upload the code the data normally send
and receive but after 30 sec it stop to send and receive the data could you pls help me out
REPLY
The problem might be in the power. Try to use a capacitor to stabilize the power supply
or try
This useuses
website an external
cookies topower
improvesupply.
user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 27/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
Your example is really helpful but I am communicate both the nrf24L01 using getting
started example but I am receiving garbage value instead of hello world. What can I Do?
REPLY
Make sure they work at the same baud rate and your Serial monitor is set to the same
baud rate.
REPLY
Hi, great tutorial, thank you! Is it possible to transmit from another source instead, say my
own sensor with a 2.4GHz antenna, transmitting an analogue frequency. Then just use one
Arduino and one nrf24I01 to receive and con gure the data? Or will this module only
communicate with another nrf24I01?
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 28/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
Thanks for such a great tutorial, I used the long range version of these to get about 400m
using external PSU to create a long range door bell with reply function.
REPLY
Many thanks for your great e orts, can i ask you how to do it if im using the HC 05 or HC 06
bluetooth moudles? im making an rc car and gured out how to drive the motors but i have
one sevo on front intended for steering how can i code it?
REPLY
Check my detailed Arduino Bluetooth Tutorial for the HC-05 Bluetooth module, you
might nd some useful information.
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
REPLY Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 29/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Can we do the “Hello World” communication between two arduino in only one PC? means
it’s only has one IDE. can we?
REPLY
Yes you can do that. You just need to start the IDE two times, so you will have two
di erent IDE on which you can select the di erent ports to which your Arduino are
connected.
REPLY
I tried to make the nRF24l01 work, but the receiver code is just showing some random
symbols even if the serial monitor baud rate is same as the code. Can you please tell me
what might be the problem.
Thank you
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 30/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Try to use decoupling capacitors and try to place the transmitter and the receiver at
some distance, at least 1m.
REPLY
Excellent tutorial.
How can i communicate more then two Arduinos using NRf24L01. I am working on a
project where i have LCD with each arduinos and there is no concept of master-slave in it.
for example. Arduino A send message to arduino B and C and display that message on B
and C LCD. and then B or C reply to A And A show the message on LCD.
This project is based on consensus control of multi-agent systems where every agent is
responsible to control its own resources.
REPLY
Thanks! Check my other tutorial for making a wireless network with RF24Network library.
REPLY
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 31/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Hi,
Thank you for your tutorial. It gives me an alternative for wireless communication between
devices.
May I know how can I increase the distance range, and does the devices need a direct line
of sight or is it possible to communicate even there is/are obstruction in between?
Thank you.
REPLY
You can increase the range by using PA LNA SMA Antenna. And of course, the
communication is possible even if there are obstacles like walls, but in that way the
range will be decreased.
REPLY
Thank you, I have tried wireless connection using RF433MHz module. But when I try to
obstruct their line of sight. It can’t receive the signal of the transmitter.
I have a follow up question. Please do correct me if I’m wrong, I’m using Arduino Pro
Mini, the SPI pins will be; MOSI(11), MISO(12), SCK(13). Am I correct?
This website
Gerald uses cookies
December to improve
24, 2018 user experience. By using our website, you agree to our use of cookies.
(https://howtomechatronics.com/tutorials/arduino/arduino-
wireless-communication-nrf24l01-tutorial/#comment-5012)
Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 32/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Thanks a lot for your work to stretch out the basic principles in an easy and comprehensive
way to everyone. Once again I used one of your great tutorials for the rst step to a new
topic before diving into depth and realizing my own thoughts and ideas. I really can
recommend your publications as a quick introduction to the “howto’s”.
Keep the ball rollin’…
REPLY
REPLY
Hi, Thanks for the video. I am facing an unusual problem. Here is part of the receiver code I
am working with. The “Available” string is getting printed , but there is no content in the text
variable. Its just blank. Please help
if (radio.available()) {
Serial.println(“Available”);
char text[32] = “”;
radio.read(&text, sizeof(text));
Serial.println(text);}
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 33/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Hey, make sure you use a capacitors at the module VCC and GND and make sure you
send the same type of data as you are receiving. Also try to distance the two modules at
least a meter.
REPLY
Hello
The rst example, writing “Hello World” works with out problem.
But the second example is not working for me. I don’t know the reason.
I checked my wiring of the led, servo and joystick but no connection error and tried multiple
time. But no receiving and transmitting. My rf module are very close to each other. When I
upload the code to UNO and MEGA the servo moves at end of code uploading. But when I
pus joystick and button nothing happens.
Is there any thing I need to consider?
REPLY
Hey, what about capacitors, try to use capacitors near the modules VCC and GND and
distance a bit the two modules.
REPLY
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 34/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Thanks for your reply. The problem was one of the nrf24l01 module was not working
properly (it only receives, doesn’t transmit). It takes me long time to identify the
problem. I use another nrf24l01 and it works with out problem.
HI, this is exactly what i need for my DIY RC Plane. But I can’t get this to work with 2 arduino
unos. Does the board matter, I looked up the corresponding ICSP pins for the Uno boards, I
don’t know why it is not working. I would appreciate a helpful response, Thank You.
REPLY
The boards doesn’t matter. Most of the time the problem is the powers supply. Make
sure you have good 3.3V power source, maybe even external one, and use bypass
capacitor for stabilizing it. Also try to distance a bit the two modules when
communicating.
REPLY
Congratulations my friend, your videos and explanations have helped and motivated an
immensity
This websiteofuses
students
cookies and professionals,
to improve thank
user experience. Byyou
usingfor
oursharing
website, your knowledge,
you agree to our usewe thank
of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 35/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
REPLY
Thank you very much..I’ve just made the project using 2 UNO boards…Very nicely explained
….
REPLY
REPLY
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 36/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Thanks for the tutorial. I was able to have it up and running in no time! I one question
though, so with the transmitter code I am useing a mega2560 as well, but I am trying use a
nano instead and whenever I put the pins that are normally on the 50, 51 and 52 pins of the
mega2560 and put them on like pins 13, 12 and 11 of the nano, even just the 13, 12 and 11
of the mega2560, it doesn’t work. For some reason they only work on pins 50, 51 and 52 for
the transmitter, any way I can x this?
REPLY
The SPI pins of the Nano are SCK -13, MISO – 12, MOSI – 11. So if connected properly it
should work the same as with the Mega. And make sure you use a capacitor right next to
the module for stabilizing the power supply.
REPLY
I switched the pins to the ones you said to and it worked. Thanks again!
Hi
If for some reason ( like while using an Arduino motor shield) digital pins can be blocked.
The SIP pins are available on ICSP header and can be used there but can I use analog pins
like A0 and A1 for this line :
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
RF24 radio(7, 8); // CE, CSN
Ok Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 37/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
REPLY
L E A V E A R E P LY
Comment
Name* Email*
Website
S U B MIT
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
Ok
(https://jlcpcb.com/)
Read more (https://howtomechatronics.com/privacy-policy-page/)
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 38/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
L AT E S T
2 (https://howtomechatronics.com/projects/diy- 9 (https://howtomechatronics.com/projects/diy-
arduino-gimbal-self-stabilizing-platform/#comments) arduino-based-rc-hovercraft/#comments)
POPULAR
Ul
Se
HC
SR
an
Ar
Tu
(h
se
hc
sr
(h
(h
se
(https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/)
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 39/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Arduino Radar
Project
(https://howtomech
radar-project/)
Dejan
(https://howtomec
354
(https://howtomec
radar-project/#com
(https://howtomechatronics.com/projects/arduino-radar-project/)
(https://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-
a4988-driver-and-arduino/)
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 40/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
(https://howtomechatronics.com/tutorials/arduino/arduino-and-hc-05-bluetooth-module-
tutorial/)
162 (https://howtomechatronics.com/tutorials/arduino/arduino-tft-lcd-touch-screen-tutorial/#comments)
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 41/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
(https://howtomechatronics.com/tutorials/arduino/arduino-tft-lcd-touch-screen-tutorial/)
F O L LO W M E !
Join My Newsletter!
Get noti ed when I publish new projects and tutorials straight to your inbox.
SUBSCRIBE
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 42/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
How To Mechatronics
24,776 likes
How To Mechatronics
YouTube 292K
C R E AT I V IT Y H E R O P R O J E CT
(https://creativityhero.com/diy-projects/diy-interactive-led-co ee-table/)
MY R E C O M M E N D AT I O N S
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 43/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
Dejan Dejan
(https://howtomechatronics.com/author/howtom12_wp/) (https://howtomechatronics.com/author/howtom12_wp/)
(https://howtomechatronics.com/recommends/banggood-prime-sale/)
H O W T O M E C H AT R O N I C S
F O L LO W H O W T O M E C H AT R O N I C S O N S O C I A L M E D I A
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 44/45
7/8/2019 Arduino Wireless Communication - NRF24L01 Tutorial - HowToMechatronics
(https://www.facebook.com/howtomechatronics)
(https://plus.google.com/+Howtomechatronics)
(https://www.youtube.com/user/DejanNe
D I S C LO S U R E
This website uses cookies to improve user experience. By using our website, you agree to our use of cookies.
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/ 45/45