Shiyu Tang
Published © CERN-OHL

The small automatic humidifier

In the north of China the weather is very dry in winter and it will make my comfortable.

BeginnerShowcase (no instructions)3 hours298
The small automatic humidifier

Things used in this project

Hardware components

Seeed studio-Grove - Water Atomization
×1
Base Shield V2
Seeed Studio Base Shield V2
×1
Seeed Studio-Grove - 16X2 LCD RGB Backlight - Full Color Display
×1
Seeed Studio-Grove - Temperature & Humidity Sensor (DHT11)
×1
Seeed Studio-Arduino Uno Rev3 Development board and Arduino beginner programming
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Connecting all the components

Code

Code

Arduino
#define DHTTYPE DHT11
#define DHTPIN 2 
#include <rgb_lcd.h>
#include "Arduino.h"
#include <DHT.h>
rgb_lcd lcd;  
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  // put your setup code here, to run once:
  pinMode(6,OUTPUT); //water atomization
  pinMode(7,OUTPUT); //water atomization
  lcd.begin(16, 2);
  lcd.setRGB(88, 160, 255);
}

void loop() {
  // put your main code here, to run repeatedly:
  //---------------water atomization-------------------
  //------------------LCD hum&temp-------------------------
   float temp_hum_val[2] = {0};
    if (!dht.readTempAndHumidity(temp_hum_val)) {
        lcd.clear();
        lcd.print("Humidity: ");
        lcd.print(temp_hum_val[0]);
        lcd.print(" %\t");
        lcd.setCursor(0,1);
        lcd.print("Temperature: ");
        lcd.print(temp_hum_val[1]);
        lcd.println(" *C");
        if (temp_hum_val[0] < 50)
          {
            digitalWrite(6,HIGH);
            digitalWrite(7,HIGH);
          } 
        else
          {
            digitalWrite(6,LOW);
            digitalWrite(7,LOW);
          }

          
    } else {
        lcd.println("error");
    }     

}

Credits

Shiyu Tang
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.