DKARDU
Published © LGPL

How to Make Arduino Automatic Temp & Humidity Controller

Today we will make an automatic air humidifier with Arduino!

BeginnerFull instructions provided1 hour23,886

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
1.3 inch 128 x 64 I2C OLED Display Module
×1
DHT11 Temperature & Humidity sensor
×1
MB-102 3.3V/5V Power module
×1
5V relay module
×1
DV 5V , 300mA , 2W , 108KHz Atomization humidifier
×1
DC 12V charger (6.5V-12V)
×1
Breadboard
×1
Jumper wires
×1

Story

Read more

Schematics

circuit_diagram_6xeO9JmhVl.jpg

Code

auto_humid.ino

Arduino
#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);//Set the device name: I2C-SSD1306-128*64 (OLED)

#include "DHT.h"

#define DHTPIN A0

#define DHTTYPE DHT11 

#define jiashi 2

#define button 12


DHT dht(DHTPIN, DHTTYPE);

void setup() {
  
  Serial.begin(9600);
  pinMode(jiashi,OUTPUT);
  pinMode(button,INPUT);
  dht.begin();

}

void loop() {
  float Humid = dht.readHumidity();
  float Temp = dht.readTemperature();
  
  Serial.print("Temp");
  Serial.print(Temp);
  delay(1000);
  Serial.print("Humid");
  Serial.print(Humid);
  delay(1000);

  
  u8g.firstPage();
  do
  {
    u8g.setFont(u8g_font_gdr14r);
    u8g.setPrintPos(25,18);
    u8g.print("DKARDU");
    u8g.setFont(u8g_font_9x18);
    u8g.setPrintPos(1,40);
    u8g.print("Temp: ");
    u8g.print(Temp);
    u8g.print("'C");
    u8g.setPrintPos(1,60);
    u8g.print("Humid: ");
    u8g.print(Humid);
    u8g.print("%");
  }while(u8g.nextPage());

if(Humid<80){
  digitalWrite(jiashi,LOW);
}else
{
  digitalWrite(jiashi,HIGH);

}


}



  

Credits

DKARDU

DKARDU

22 projects • 44 followers
Arduino

Comments