Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Wi-Fi Controlled Temperature and Humidity Monitoring System with NodeMCU and DHT11

View and Edit Project In Cirkit DesignerImage of Wi-Fi Controlled Temperature and Humidity Monitoring System with NodeMCU and DHT11

Circuit Documentation

Summary

This circuit is designed to monitor the temperature and humidity of a room using a DHT11 sensor and display the readings on a 16x2 I2C LCD. The system is controlled by a NodeMCU V3 ESP8266 microcontroller, which also connects to the Blynk platform for remote monitoring. A fan is controlled via a 1 Channel Relay to maintain the temperature within a specified threshold. The circuit is powered by a 12V 5A power supply, and the voltage is stepped down using an LM2596 Step Down Module.

Component List

  1. NodeMCU V3 ESP8266

    • Description: Microcontroller with WiFi capabilities.
    • Pins: A0, GND, VU, S3, S2, S1, SC, S0, SK, 3V3, EN, RST, Vin, D0, D1, D2, D3, D4, D5, D6, D7, D8, RX, TX
  2. KY-015 DHT11 Temperature-Humidity Sensor Module

    • Description: Sensor module for measuring temperature and humidity.
    • Pins: VCC, GND, DOUT
  3. LM2596 Step Down Module

    • Description: Voltage regulator module to step down voltage.
    • Pins: OUT-, OUT+, IN-, IN+
  4. 1 Channel Relay 5V

    • Description: Relay module for controlling high voltage devices.
    • Pins: VCC, GND, IN, NC, COM, NO
  5. 16x2 I2C LCD

    • Description: LCD display with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  6. Ceramic Capacitor

    • Description: Capacitor for filtering and stabilization.
    • Pins: pin0, pin1
    • Properties: Capacitance: 0.0000001 Farads
  7. Fan

    • Description: Fan for cooling purposes.
    • Pins: Neutral, Live
  8. POWER SUPPLY 12V 5AMP

    • Description: Power supply unit providing 12V DC.
    • Pins: 220V Positive Pole (AC), 220V Negative Pole (AC), GND, GND (DC), 12V-24V Output (DC)
  9. Power 220V

    • Description: 220V AC power source.
    • Pins: hot wire, neutral wire

Wiring Details

NodeMCU V3 ESP8266

KY-015 DHT11 Temperature-Humidity Sensor Module

LM2596 Step Down Module

1 Channel Relay 5V

16x2 I2C LCD

Ceramic Capacitor

Fan

POWER SUPPLY 12V 5AMP

Power 220V

Code Documentation

#define BLYNK_TEMPLATE_ID "TMPL6ls4CXNs1"
#define BLYNK_TEMPLATE_NAME "Monitoring Suhhu Kamar Mesin"
#define BLYNK_AUTH_TOKEN "IoFHwZSvj9nxvMqe1Gw1oG1cGkNtSijw"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "DHT.h"
#define DHTPIN D5     // Digital pin connected to the DHT sensor

#define DHTTYPE DHT11   // DHT 11
#define FAN_PIN D2   // FAN RELAY
WidgetLED FAN(V0);

char auth[] = "IoFHwZSvj9nxvMqe1Gw1oG1cGkNtSijw";
char ssid[] = "Bah";
char pass[] = "14092002";

float humDHT = 0;
float tempDHT = 0;
int Val=0;

// Initialize DHT sensor.
DHT dht(DHTPIN, DHTTYPE);

// Initialize LCD (address 0x27, 16 columns, 2 rows)
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(115200);
  pinMode(FAN_PIN, OUTPUT);
  digitalWrite(FAN_PIN, LOW);
  Serial.println(F("DHTxx test!"));
  dht.begin();
  Blynk.begin(auth, ssid, pass);

  // Initialize the LCD
  lcd.begin();
  lcd.backlight();
  lcd.print("Initializing...");
}

BLYNK_WRITE(V3)
{
  Val = param.asInt(); // assigning incoming value from pin V3 to a variable

  Serial.print(" The Threshold value is: ");
  Serial.println(Val);
  Serial.println();
}

void loop() {
  Blynk.run();

  // Wait a few seconds between measurements.
  delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)
  humDHT = dht.readHumidity();
  // Read temperature as Celsius (the default)
  tempDHT = dht.readTemperature();