Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
NRF24L01 Based Digital Temperature Monitoring System
Just Do Electronics
June 06, 2020
NRF24L01 Based Digital Temperature Monitoring System
Circuit Diagram :-
Transmitter Circuit
Receiver Circuit
Transmitter Code
//Prateek //www.prateeks.in //Transmitter #include
#include
#include
#include "DHT.h" const uint64_t pipeOut = 0xE8E8F0F0E1LL; #define DHTPIN 7 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); RF24 radio(9, 10); // CN and CSN pins of nrf struct MyData { byte h; byte t; }; MyData data; void setup() { Serial.begin(9600); dht.begin(); radio.begin(); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); radio.openWritingPipe(pipeOut); } void loop() { data.h = dht.readHumidity(); data.t = dht.readTemperature(); if (isnan(data.h) || isnan(data.t)){ Serial.println(F("Failed to read from DHT sensor!")); return; } Serial.print("Humidity: "); Serial.print(data.h); Serial.print("Temperature: "); Serial.print(data.t); radio.write(&data, sizeof(MyData)); }
Receiver Code
//Parteek //www.prateeks.in //Receiver #include
#include
#include
#include
#include
LiquidCrystal_I2C lcd(0x27, 16, 2); const uint64_t pipeIn = 0xE8E8F0F0E1LL; RF24 radio(9, 10); struct MyData { byte h; byte t; }; MyData data; void setup() { Serial.begin(9600); radio.begin(); lcd.init(); lcd.backlight(); lcd.clear(); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); radio.openReadingPipe(1, pipeIn); radio.startListening(); //lcd.println("Receiver "); } void recvData() { if ( radio.available() ) { radio.read(&data, sizeof(MyData)); } } void loop() { recvData(); lcd.setCursor(0,0); Serial.print("Temperature: "); Serial.print(data.t); lcd.print("Temperature:"); lcd.print(data.t); lcd.print("'C"); Serial.print("Humidity: "); Serial.print(data.h); lcd.setCursor(0,1); lcd.print("Humidity:"); lcd.print(data.h); lcd.print("%"); //Serial.print("\n"); }
0 Comments
Newer
Older
ESP32 Interfacing With LDR Sensor
ESP32 Led Blink With Push Button
IoT Based Patient Health Monitoring System Using Blynk App
Ultrasonic Sensor as a Counter with Arduino
Esp32 Cam Based Face Unlock
MLX90614 Non-Contact Infrared Thermometer With Arduino
Measure CO2 Level in Air Using Arduino
Sign Language to Speech Conversion using Arduino With Flex Sensor
ESP32 Interfacing Potentiometer
How to Make a Conveyor Belt System | Counter Machine
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments