0% found this document useful (0 votes)
16 views11 pages

Project Overview ESP8266 Weather Station With Blynk Control

The project involves creating a real-time temperature and humidity monitoring system using an ESP8266 microcontroller, DHT11 sensor, LDR, and a 16x2 LCD display, controlled via the Blynk IoT platform. It includes hardware components, software libraries, and a code explanation for setup and operation. The project serves as a foundational IoT application with potential for further expansion and additional features.

Uploaded by

Arin Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views11 pages

Project Overview ESP8266 Weather Station With Blynk Control

The project involves creating a real-time temperature and humidity monitoring system using an ESP8266 microcontroller, DHT11 sensor, LDR, and a 16x2 LCD display, controlled via the Blynk IoT platform. It includes hardware components, software libraries, and a code explanation for setup and operation. The project serves as a foundational IoT application with potential for further expansion and additional features.

Uploaded by

Arin Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Project Overview: ESP8266

Home automation with


Blynk Control
This project focuses on creating a real-time temperature and humidity
monitoring system using an ESP8266 microcontroller, DHT11
temperature and humidity sensor, LDR light sensor, and a 16x2 LCD
display. The project will leverage the Blynk IoT platform for remote
control and data visualization.
Components Required & Circuit Diagram
Hardware Software

• ESP8266 NodeMCU • Arduino IDE


• DHT11 Sensor • Blynk Library
• LDR
• 16x2 LCD
• Jumper Wires
• 10kΩ Resistor
Diagrams of
components

Node mcu esp8266

16*2 LCD

DHT 11
Image of hardware
Output Images
Code Explanation (Arduino IDE)
Libraries
• ESP8266WiFi
• BlynkSimpleEsp8266
• DHT
• LiquidCrystal_I2C (or LiquidCrystal)

Constants
• BLYNK_TEMPLATE_ID
• BLYNK_DEVICE_NAME
• DHTPIN
• DHTTYPE
• ldrPin

Setup
• Blynk.begin
• dht.begin
• lcd.init
• lcd.backlight

Loop
• Read sensor values
• Send data to Blynk
• Display data on LCD
• Delay
#define BLYNK_TEMPLATE_ID "TMPL3WiwOtmdw"
#define BLYNK_TEMPLATE_NAME "NodeMCU" //
#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

#include <DHT.h>

#include <LiquidCrystal.h>

// Define Blynk Credentials char auth[] = "qD0gApko3KZzOKQhvISQWp5oM94J5jLF"; // Replace with your Blynk auth token char ssid[] = "OnePlus Nord CE 2"; // Replace with your WiFi SSID char pass[] = "ajayarti"; // Replace with your Wi

// Define Sensor Pins #define DHTPIN D2 // DHT11 connected to D2 #define DHTTYPE DHT11 // DHT11 sensor type #define LDR_PIN A0 // LDR connected to Analog pin A0

// Initialize DHT Sensor DHT dht(DHTPIN, DHTTYPE);

// Initialize LCD (RS, E, D4, D5, D6, D7) LiquidCrystal lcd(D4, D3, D5, D6, D7, D8);

void setup() { Serial.begin(115200); Serial.println("DHT11 + LDR Sensor Test");

Blynk.begin(auth, ssid, pass); // Connect to Blynk

dht.begin(); // Start DHT sensor


lcd.begin(16, 2); // Initialize 16x2 LCD
lcd.print("Initializing...");
delay(2000);
lcd.clear();

void loop() { Blynk.run(); // Run Blynk


// Read Temperature & Humidity
float temperature = dht.readTemperature(); // Read temperature in °C
float humidity = dht.readHumidity(); // Read humidity in %

// Read LDR Sensor Value (0-1023)


int ldr_value = analogRead(LDR_PIN);

// Check if DHT11 is working


if (isnan(temperature) || isnan(humidity)) {
Serial.println("Error: DHT11 Sensor Not Found!");
lcd.setCursor(0, 0);
lcd.print("DHT11 Error!");
return; // Stop execution if sensor fails
}

// Print to Serial Monitor


Serial.print("Temp: "); Serial.print(temperature); Serial.print("°C | ");
Serial.print("Humidity: "); Serial.print(humidity); Serial.print("% | ");
Serial.print("LDR: "); Serial.println(ldr_value);

// Send Data to Blynk (Assign Virtual Pins)


Blynk.virtualWrite(V0, temperature); // Send Temperature to Blynk (V0)
Blynk.virtualWrite(V1, humidity); // Send Humidity to Blynk (V1)
Blynk.virtualWrite(V2, ldr_value); // Send LDR Value to Blynk (V2)

// Display on LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp: " + String(temperature) + "C");
lcd.setCursor(0, 1);
lcd.print("Hum: " + String(humidity) + "% L:" + String(ldr_value));

delay(2000); // Update every 2 seconds


// Display on LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp: " + String(temperature) + "C");
lcd.setCursor(0, 1);
lcd.print("Hum: " + String(humidity) + "% L:" + String(ldr_value));

delay(2000); // Update every 2 seconds


}
Blynk Setup Steps
Create a Blynk Account

Create a new Template

Create a new Device

Add Datastreams

Design the Dashboard


Conclusion

This project demonstrates a basic IoT application, utilizing an


ESP8266 microcontroller and the Blynk platform for remote
weather monitoring. The project offers the foundation for
more advanced IoT projects and applications, allowing for
expansion with additional sensors, data logging, and alert
functionalities.

You might also like