Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Evan Rust
Published © GPL3+

Arduino Humidifier Control

Instead of having to increase the humidity manually, why not let your humidifier turn itself on when necessary?

IntermediateFull instructions provided2 hours16,695
Arduino Humidifier Control

Things used in this project

Hardware components

Relay (generic)
×1
Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Just connect as-is

Code

The Arduino Code

C/C++
Copy and paste
#include "DHT.h"
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE);
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
Serial.println("ready.");
pinMode(7,OUTPUT);
dht.begin();
digitalWrite(7,HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
delay(5000);
float h = dht.readHumidity();
Serial.println(h);
if (h < 30){
  while(h < 40){
    h = dht.readHumidity();
    digitalWrite(7,LOW);
  delay(1000 * 60 * 10);
  }
}
else if (h > 30){
  digitalWrite(7,HIGH);
  delay(1000 * 60 * 10);
}
}

Credits

Evan Rust

Evan Rust

122 projects • 1093 followers
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.

Comments