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

Arduino-Based Temperature and Humidity Monitoring System with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino-Based Temperature and Humidity Monitoring System with LCD Display

Circuit Documentation

Summary

This circuit is designed to interface a DHT11 humidity and temperature sensor with an Arduino UNO, displaying the readings on a 16-pin LCD display. A trimmer potentiometer is used to adjust the contrast of the LCD. The circuit is powered by the Arduino's 5V output, and the readings from the DHT11 sensor are processed and displayed in real-time.


Component List

Arduino UNO


Trimmer Potentiometer


LCD Display (16 pin)


Resistor (200 Ohms)


Resistor (10k Ohms)


DHT11 Humidity and Temperature Sensor


Wiring Details

Arduino UNO


Trimmer Potentiometer


LCD Display (16 pin)


DHT11 Humidity and Temperature Sensor


Documented Code

#include <DHT.h>
#include <LiquidCrystal.h>

// Define the pin where the DHT11 is connected
#define DHTPIN 6
#define DHTTYPE DHT11

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

// Initialize the LCD with the pins connected to the Arduino
// RS, E, D4, D5, D6, D7
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // Start the serial communication
  Serial.begin(9600);
  
  // Initialize the DHT sensor
  dht.begin();
  
  // Set up the LCD's number of columns and rows
  lcd.begin(16, 2);
}

void loop() {
  // Wait a few seconds between measurements
  delay(2000);

  // Read temperature as Celsius
  float temperature = dht.readTemperature();
  // Read humidity
  float humidity = dht.readHumidity();

  // Check if any reads failed and exit early (to try again)
  if (isnan(temperature) || isnan(humidity)) {
    Serial.println("Failed to read from DHT sensor!");
    lcd.setCursor(0, 0);
    lcd.print("Read Error");
    lcd.setCursor(0, 1);
    lcd.print("Check Sensor");
    return;
  }

  // Print the temperature and humidity to the Serial Monitor
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println(" %");

  // Display the temperature on the first line of the LCD
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temperature);
  lcd.print(" C  "); // Extra spaces to clear any previous data

  // Display the humidity on the second line of the LCD
  lcd.setCursor(0, 1);
  lcd.print("Humidity: ");
  lcd.print(humidity);
  lcd.print(" %  "); // Extra spaces to clear any previous data
}

This documentation provides a comprehensive overview of the circuit, detailing each component, its purpose, wiring connections, and the code used to operate the system.