NRF24L01 & Arduino Wireless Temperature Monitor with DHT11
In this tutorial, we will learn how to make wireless communication between two Arduino boards using the NRF24L01 transceiver module, i.e. nRF24L01 based Wireless Temperature Monitoring with DHT11 Arduino.
For this, we will be interfacing DHT11 Humidity & Temperature Sensor with Arduino Board on transmitter end along with the NRF24L01 transceiver module. And on the receiver end, we will be interfacing the Arduino board with LCD Display along with the NRF24L01 transceiver module to display temperature and Humidity data wirelessly.
Check the advance version of this project: ESP8266 NRF24L01 Wifi Gateway with Arduino NRF24L01 Node
Bill of Materials
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino UNO Board | 2 | Amazon | AliExpress |
| 3 | NRF24L01 Module | 2 | Amazon | AliExpress |
| 4 | DHT11 Sensor | 1 | Amazon | AliExpress |
| 5 | 16x2 LCD Display | 1 | Amazon | AliExpress |
| 6 | Potentiometer 10K | 1 | Amazon | AliExpress |
| 7 | Connecting Wires | 20 | Amazon | AliExpress |
| 8 | Breadboard | 1 | Amazon | AliExpress |
nRF24L01 – 2.4GHz RF Transceiver Module:
Description:
These RF modules are very popular among the Arduino tinkerers. The nRF24L01 is used on a wide variety of applications that require wireless control. They are transceivers which means that each module can transmit and receive data. These modules are very cheap and you can use them with any microcontroller (MCU).
Specifications:
- Low-cost single-chip 2.4GHz GFSK RF transceiver IC
- Range with Antenna: 250Kb rate (Open area) >1000 meter
- Power: Ultra-low power consumption
- Input Voltage: 3.3V
- Pins: 5V tolerant
- Price: $2
Pinouts:
Working of nRF24L01:
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.
The module can use 125 different 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.
Circuit Diagram & Connections:
Here we need two circuit assembly to make wireless communication between two NRF24L01 transceiver module. The first circuit diagram shown below is a Transmitter End Section. Assemble the circuit as shown in the figure below. It consists of Arduino Uno, nRF24 & DHT11 Humidity & Temperature Sensor.

The second circuit diagram shown below is a Receiver End Section. Assemble the circuit as shown in the figure below. It consists of Arduino Uno Board, nRF24L01, and 16×2 LCD Display.

Here is a The NRF24L01 pins Connection with Arduino for both circuits:
MISO connects to pin 12 of the Arduino UNO
MOSI connects to pin 11 of the Arduino UNO
SCK connects to pin 13 of the Arduino UNO
CE connects to pin 8 of the Arduino UNO
CSN connects to pin 9 of the Arduino UNO
GND and VCC of the NRF24L01 are connected to GND and 3.3V of the Arduino UNO
Source Code/Programs:
First, download this library and add to Arduino IDE:
1. NRF24L01 Library
2. RF24 Library
3. DHT11 Library
Code for Transmitter Section:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#include <SPI.h> #include <nRF24L01.h> #include <RF24.h> #include <DHT11.h> int pin = A0; DHT11 dht11(pin); float temperature[2]; double Fahrenheit(double celsius) { return ((double)(9 / 5) * celsius) + 32; } double Kelvin(double celsius) { return celsius + 273.15; } RF24 radio(8, 9); const uint64_t pipe = 0xE8E8F0F0E1LL; void setup(void) { radio.begin(); radio.openWritingPipe(pipe); } void loop(void) { float temp, humi; dht11.read(humi, temp); temperature[0] = temp; temperature[1] = humi; radio.write(temperature, sizeof(temperature)); delay(1000); } |
Code for Receiver Section:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
#include <SPI.h> #include <nRF24L01.h> #include <RF24.h> #include <DHT11.h> #include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); float temperature[2]; RF24 radio(8, 9); const uint64_t pipe = 0xE8E8F0F0E1LL; void setup(void) { Serial.begin(9600); lcd.begin(16, 2); radio.begin(); radio.openReadingPipe(1, pipe); radio.startListening(); lcd.print("Humidity & temp"); delay(2000); lcd.clear(); lcd.print("Starting....."); delay(2000); } void loop(void) { if ( radio.available() ) { bool done = false; while (!done) { done = radio.read(temperature, sizeof(temperature)); lcd.clear(); delay(500); lcd.setCursor(0, 0); lcd.print("Temp"); lcd.setCursor(0, 1); lcd.print("Humidity"); lcd.setCursor(9, 0); lcd.print(temperature[0]); lcd.print(" C"); lcd.setCursor(9, 1); lcd.print(temperature[1]); lcd.print(" %"); delay(1000); } } else { lcd.setCursor(0, 0); lcd.print("No radio Found"); } } |












14 Comments
I am having trouble compiling your RX section of the DHT to LCD Temp monitor, I have copied exactly the program but when compiled it gives me an error at the following lines
bool done = false;
while (!done)
{
done = radio.read(temperature, sizeof(temperature));
Any help would be appreciated.
Peter Ralls May 18, 2020 at 6:56 AM
I am having trouble compiling your RX section of the DHT to LCD Temp monitor, I have copied exactly the program but when compiled it gives me an error at the following lines
bool done = false;
while (!done)
{
done = radio.read(temperature, sizeof(temperature));
Any help would be appreciated.
Hi All the Library Has been updated. You can now compile the receiver code.
Sir, can you provide Proteus library for nrf24l01.
Plz
getting the same error. How can I correct?
same error : VOID VALUE NOT IGNORED AS OUGHT TO BE
Will this work with a nano?
Hi Mr Alam
i am getting a message no radio found
Any help would be appreciated
Thanks JS
I’m having the same problem. Did you ever get it working?
Delete “Done = ” from line 41 to read only “radio.read(temperature, sizeof(temperature));”
delete “Done = ” from line 41 to read radio.read(temperature, sizeof(temperature));
how do you download the libraries?
remove(done =) just type code as radio.read(temperature, sizeof(temperature));
it worked for me..
actually i am not able to add DHT11 library to the IDE software can you help me out