Russ DiBenedetto
Created November 2, 2016

Whole house Arduino based Humidistat for gas hot air furnace

I built an Arduino based Humidistat to control my furnace humidifier and replace the inaccurate commercially available ones.

IntermediateFull instructions provided364
Whole house Arduino based Humidistat for gas hot air furnace

Things used in this project

Story

Read more

Custom parts and enclosures

Complete Project PDF

This can be downloaded and used to create your own project although you may have to find your own voltage points on your particular furnace.

Schematics

Schematic

Code

humidistat sketch

Arduino
#include "DHT.h"

#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define solenoid 4      // Pin to Activate water solenoid
#define activity 11     // Pin to show activity (reading sensor)



DHT dht(DHTPIN, DHTTYPE);

void setup() {
  pinMode(activity, OUTPUT);
  pinMode(13,OUTPUT);
  pinMode(solenoid, OUTPUT);
  Serial.begin(9600); 
  dht.begin();
}

void loop() {
  // Wait a 5 seconds between measurements.
  delay(5000);

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old'
  // (its a very slow sensor)
  digitalWrite(activity, HIGH);
  delay(100);
  float h = dht.readHumidity();
  //h=40;
  //h=h+16.0;
  digitalWrite(activity, LOW);
  // Read temperature as Celsius
  float t = dht.readTemperature();
  float tt = dht.convertCtoF(t);
  
  
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    // If the sensor fails to read successfully execute for loop
    // and flash the activity and solenoid lights together for 10 
    // times a total of 15 seconds
    for(int x=0; x < 10; x++){
    digitalWrite(activity,HIGH);
    digitalWrite(13,HIGH);
    delay(1000);
    digitalWrite(13,LOW);
    digitalWrite(activity,LOW);
    delay(500);
    }
    return;
  }
  // Read pot and convert to humidity values between 30 and 50%
  // humidtiysetpoint = the pot value
  // setpointvalue = the set point for the target humidity level
  // Test to see if the humidity is less than the set point
  // if so turn on solenoid
  // If not turn off solenoid
  // Temp is just displayed on serial console but not used
  float setpointvalue;
  int humidtiysetpoint=analogRead(A0);
  if (humidtiysetpoint < 0) 
    {
        humidtiysetpoint = 0;
    }
  if (humidtiysetpoint > 1023)
    {
      humidtiysetpoint = 1023;
    }
  setpointvalue=((humidtiysetpoint - 1) * 20 / 1023) + 30;
  
  if(h < setpointvalue ) {
      digitalWrite(solenoid, HIGH);
      digitalWrite(13, HIGH);
      delay(120000);
  } else {
     digitalWrite(solenoid, LOW);
     digitalWrite(13,LOW); 
  }
  Serial.println (setpointvalue);
  Serial.print("Humidity: "); 
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: "); 
  Serial.print(tt);
  Serial.println(" F ");
 
}

Credits

Russ DiBenedetto
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.