Go Down

Topic: How to control Humidity in mushroom room? (Read 175 times) previous topic - next topic

matsuo

Mar 18, 2015, 03:57 pm Last Edit: Mar 18, 2015, 04:05 pm by matsuo
Hellow!

              I have a problem about control Humidity in mushroom room, Now i'm using DHT21 sensor Link
for measurement but i think it's slowly for get value So both of devices  fast operated.


my condition
1.Humindity <= 70% -- Ultrasonic Humidifier & FAN1 running
2.Humindity >= 85% --FAN2 running



Code: [Select]
#include <Wire.h>
//#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
#include "DHT.h"
#define DHTPIN 2   
int MHONG = 5; // Ultrasonic Humidifier
const int FAN1 =  4;      // FAN for umidifier
const int FAN2 =  3;      // FAN  reduce humidity
#define DHTTYPE DHT21   // DHT 21 (AM2301)
DHT dht(DHTPIN, DHTTYPE);
void setup() {
 pinMode(FAN1, OUTPUT);
 pinMode(FAN2, OUTPUT);
 pinMode(MHONG, OUTPUT);
dht.begin();
}
void loop() {
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (h<=70.0){
     digitalWrite(MHONG,LOW);
     digitalWrite(FAN1, LOW);
   }
     else{
     digitalWrite(MHONG,HIGH);
     digitalWrite(FAN1, HIGH);
 }
  if (h>=85.0){
   digitalWrite(FAN2, LOW);
   }
  else{
   digitalWrite(FAN2, HIGH);

  }
}

weedpharma

I am having trouble understanding your question. Please explain again what the problem is.

Weedpharma

Go Up