Project Overview ESP8266 Weather Station With Blynk Control
Project Overview ESP8266 Weather Station With Blynk Control
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 LCD (RS, E, D4, D5, D6, D7) LiquidCrystal lcd(D4, D3, D5, D6, D7, D8);
// 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));
Add Datastreams