nRF24L01 based Wireless Temperature Monitoring with DHT11 Arduino

(Last Updated On: April 26, 2019)

nRF24L01 based Wireless Temperature Monitoring with DHT11 Arduino

In this tutorial we will learn how to make a 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 NRF24L01 transceiver module. And on the receiver end we will be interfacing Arduino board with LCD Display along with NRF24L01 transceiver module to display temeprature and Humidity data wirelessely.


Components Required:

1. Arduino Uno Board - 2 (Buy Online from Amazon)
2. DHT11 Humidity & Temperature Sensor (Buy Online from Amazon)
3. nRF24L01 Modules - 2 (Buy Online from Amazon)
4. 16x2 LCD Display (Buy Online from Amazon)
5. 10K Potentiometer
6. Connecting Jumper Wires
7. Breadboard -2



nRF24L01 – 2.4GHz RF Transceiver Module:

Description:

nrf24l01 module

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 this means that each module can transmit and receive data.These modules are very cheap and you can use them with any microcontroller (MCU).

Specifications:

1. Low cost single-chip 2.4GHz GFSK RF transceiver IC
2. Range with Antenna: 250Kb rate (Open area) >1000 meter
3. Power: Ultra low power consumption
4. Input Voltage: 3.3V
5. Pins: 5V tolerant
6. Price: $2

Pinouts:

NRF24L01 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.

Working of NRF24L01

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 a wireless communication between two Arduino boards using the NRF24L01 transceiver module, i.e. nRF24L01 based Wireless Temperature Monitoring with DHT11 Arduino. The first circuit diagram shown below is a Transmitter End Section. Assemble the Circuit as shown in the figure below. It consists Arduino Uno, nRF24L01 & DHT11 Humidity & Temperature Sensor.

nRF24L01 based Wireless Temperature Monitoring with DHT11 Arduino
Circuit Diagram for Transmitter End

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

Circuit for nRF24L01 based Wireless Monitoring
Circuit Diagram for Receiver End

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 these library and add to Arduino IDE:
1. NRF24L01 Library
2. DHT11 Library

Code for Transmitter Section:

#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:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <DHT11.h>
#include <Wire.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);
radio.begin();
radio.openReadingPipe(1, pipe);
radio.startListening();
lcd.begin(16, 2);
lcd.clear();
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");
}
}

Video Tutorial:

Recommended For You

About the Author: Alex Newton

Ask A Question .......

Close