This is the modified circuit with the Hysteresis , thanks to this forum,
I now have an issue of heat which I need to address.
The current configuration allows the humidity to dictate the fan and vent operation.
I now would like to turn a fan on at around 95 degrees.
Thanks for the consideration.
[/
//
// Humidity control
// AUTHOR: Curt Crothers
// VERSION: 0.1.01
// PURPOSE: DHT library test sketch for DHT11 && Arduino
// URL:
//
// Released to the public domain
//
#include <dht.h>
dht DHT;
#define DHT11_PIN 5
int fan = 3;
int vent = 4;
void setup()
{
Serial.begin(115200);
Serial.println("DHT TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT_LIB_VERSION);
Serial.println();
Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
pinMode (fan, OUTPUT);
pinMode (vent, OUTPUT);
}
void loop()
{
// READ DATA
Serial.print("DHT11, \t");
int chk = DHT.read11(DHT11_PIN);
// DISPLAY DATA
Serial.print(DHT.humidity, 1);
Serial.print(",\t");
Serial.println(DHT.temperature, 1);
delay(5000);
if (DHT.humidity>57) {
digitalWrite(vent,LOW);
} else if (DHT.humidity<55){
digitalWrite(vent, HIGH);
}
if (DHT.humidity>61) {
digitalWrite(fan,LOW);
}else if (DHT.humidity<59) {
digitalWrite(fan,HIGH);
}
}
//
// END OF FILE
//code]