chenwei19940207
Published © GPL3+

Automatic Humidifier

Automatically turn on the humidifier when the environment humidity is below 50%.

EasyShowcase (no instructions)971
Automatic Humidifier

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
DHT11 Temperature & Humidity Sensor
DHT11 Temperature & Humidity Sensor
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
LED (generic)
LED (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×5
Resistor 330 ohm
Resistor 330 ohm
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Humidifier
×1

Hand tools and fabrication machines

Digilent Screwdriver
Digilent Screwdriver

Story

Read more

Schematics

Circuit

20180121 201136573 ios 6vm7ddfyot

Code

Untitled file

Arduino
#include "DHT.h"
#include "LiquidCrystal.h"

#define DHTPIN 10
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
  dht.begin();
  lcd.begin(16, 2);
  lcd.print("TEMP: ");
  lcd.setCursor(0, 1);
  float c = dht.readTemperature(true);
  float h = dht.readHumidity(true);
  lcd.setCursor(6, 0);
  lcd.print((c - 35) * 0.5556);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0, 1);
  lcd.print("HUMI: ");
  lcd.setCursor(6, 1);
  lcd.print(h);
  lcd.print(" %");
  pinMode(9, OUTPUT);
  pinMode(6, OUTPUT);
// init------------------------------------
}

void loop() {
  int a = 1;
  float c = dht.readTemperature(true);
  float h = dht.readHumidity(true);
  lcd.setCursor(6, 0);
  lcd.print((c - 35) * 0.5556);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0, 1);
  lcd.print("HUMI: ");
  lcd.setCursor(6, 1);
  lcd.print(h);
  lcd.print(" %");
//--------------------------------------------  
  if (h < 50){
  digitalWrite(9, HIGH);
  digitalWrite(6, HIGH);
  delay (250);
  digitalWrite(6, LOW);
  delay (250);
  digitalWrite(6, HIGH);
  delay (250);
  digitalWrite(6, LOW);
 // send pulse 2X-----------------------------
  while (a = 1){
  delay(1000);
  float c = dht.readTemperature(true);
  float h = dht.readHumidity(true);
  lcd.setCursor(6, 0);
  lcd.print((c - 35) * 0.5556);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0, 1);
  lcd.print("HUMI: ");
  lcd.setCursor(6, 1);
  lcd.print(h);
  lcd.print(" %");
  // LCD--------------------------------------
  if (h >= 55){
  digitalWrite(6, HIGH);
  delay (250);
  digitalWrite(6, LOW);
  digitalWrite(9, LOW);
  break;}
  }
  }
}

Credits

chenwei19940207

chenwei19940207

0 projects • 1 follower
Contact

Comments

Add projectSign up / Login