Project in progress
HVAC

HVAC © GPL3+

Heating ventilation and air-conditioning for a dome.

  • 4,432 views
  • 0 comments
  • 52 respects

Components and supplies

Necessary tools and machines

Lasercutter
Laser cutter (generic)
3drag
3D Printer (generic)

Apps and online services

About this project

Main Idea

Our class has to make a greenhouse based on a dome. The greenhouse has to work autonomously. We are responsible for the Heating Ventilation and Air-conditioning, or shortly said the HVAC. We want to work eco-consious. So we used the ground as a power source. This energy we call geothermic energy. It's completely green and you don't create any pollutants. We use the heat exchanger for this. If it's still not hot enough, it will go through the compost bin (heat's up more). And the best thing of geothermic energy is that in the winter the ground is hot ( 10°C) so it will heat up and in the summer the ground is colder so it will cool off. This is very handy because we have to cool in the summer and heating in the winter.

The IoT part

Then we have the "IOT" part. We had a lot of data (including data from the moisture of each plant because we also have an automatic irrigation). We also want to visualize that data.

We used a database to store our data with a MySQl client. With PhpMyAdmin we can see that data but that isn't enjoyable. Therefore we used Yoomla, a free website maker. On our site we have made a real time graph of the moisture and temperature. We have connected our things to the internet, so that we can interact in real time with our greenhouse.

This photo is just a test of our database and our plugin from Yoomla. But it works fine.

Code

Arduino code collect the dataArduino
This program collect's the data from the sensors and send them to the serial port of a raspberry or any computer.
int sensorPin1 = 0;    // this is the analog inpunt for the sensor
int sensorPin2 = 1;
int Plant1 = 0;       // this is the starting value 
int Plant2 = 0;
int Moisture1 = 0;    // this is the starting value 
int Moisture2 = 0;
int MinMoisture = 30; // the min. moisture level 
int Valvepin1 = 8;      // the magnetic valve pin
int Valvepin2 = 7;      // the magnetic valve pin

void setup() {
  Serial.begin(9600);
  pinMode( sensorPin1 , INPUT);
  pinMode( sensorPin2 , INPUT);
  pinMode( Valvepin1 , OUTPUT);
  pinMode( Valvepin2 , OUTPUT);
}
void loop() {
  Plant1 = analogRead(sensorPin1);                 // this reads the sensor value a number between 398 and 1023
  Moisture1 = map( Plant1, 398, 1023, 100, 0);    // this maps the value in %
  Plant2 = analogRead(sensorPin2);                 // this reads the sensor value a number between 398 and 1023
  Moisture2 = map( Plant2, 398, 1023, 100, 0);    // this maps the value in %
  delay(5000);                                    // this is a little stop for the python program
  Serial.print(Moisture1);                        // this sends the values to the serial port
  Serial.print(" ");
  Serial.print(Moisture2);
  Serial.print('\n');
  if (Plant1 > MinMoisture)
{
    digitalWrite(Valvepin1, HIGH);                // opens the magnetic valve
}
  if (Plant2 > MinMoisture)
{
    digitalWrite(Valvepin2, HIGH);
}
}
PythonPython
This is a python program. This program is used to put the data from the arduino to the database.
import datetime                         # inserts a couple of modules
import time
import mysql
import sys
from mysql.connector import errorcode
import serial
fixed_interval = 5                      # makes an interval to pause the uploading (in seconds)
ser = serial.Serial('com3',9600)
while True: 
    
    # official log in protocol 
    cnx = mysql.connector.connect(user='', password='',
                              host='',
                              database='greenhouse')
    print(cnx)
    cursor = cnx.cursor()    
    
    try: 
        
        a,b = ser.readline().split()        # splits the arduino variables     
        
        today = datetime.datetime.today()   # gives the date of today
          # uploads our variables 
        cursor.execute("INSERT INTO temperature_inside (datetime,Bak1,Bak2) VALUES (%s,%s,%s)",(today,a,b))
        time.sleep(fixed_interval) # the rest of the program is the official way to commit and end it
        cnx.commit()
    except:
        pass
        print("error")
        ser.close()
        
    cursor.close()
    cnx.close()
    
    
    
print("Succesfully added to database")
HVACArduino
LVG, LVB, TempW, TempR, COLR, COLW are LED's. We worked with the 'if command' and made every possible result. Because not everything is the same somethimes the ventilators don't have to work and somethimes the threeway valve has to change from direction, here we use the servo .
//Libraries
#include <DHT.h>;
#include <Servo.h>;
Servo servo ;


//Constants
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)


int LVB = 6;
int LVG= 7;
int TempR= 10;
int TempW= 11;
int ventilator= 8;
int ventilator2= 9;
int hoek = 0;
int sensor = A3;
int COLR =4  ;
int COLW =13 ;
int sensorValue= 0;



DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino



//Variables
int chk;

float hum;  //Stores humidity value
float temp; //Stores temperature value


void setup()
{
    Serial.begin(9600);
  dht.begin();
  pinMode(LVB,HIGH);
  pinMode(LVG,HIGH);
  pinMode(TempW,HIGH);
  pinMode(TempR,HIGH);
  pinMode(COLR,HIGH);
  pinMode(COLW,HIGH);
  pinMode(ventilator,HIGH);
  pinMode(ventilator2,HIGH);
  pinMode(sensor,INPUT);
  Serial.begin(9600);

  servo.attach(5); 
  servo.write(hoek);
 

  

}

void loop(){
int sensorValue= analogRead(sensor);

Serial.println(sensorValue);


    //Read data and store it to variables hum and temp
    hum = dht.readHumidity();
    temp= dht.readTemperature();
    //Print temp and humidity values to serial monitor
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Temp: ");
    Serial.print(temp);
    Serial.println(" C");
    delay(2000); //Delay 2 sec.
if  (temp > 22)
if (hum >55)
if (sensorValue > 100)
{digitalWrite(TempR,HIGH);
digitalWrite(TempW,LOW);
digitalWrite(LVB,LOW);
digitalWrite(LVG,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(ventilator2,HIGH);
digitalWrite(COLR,HIGH);
digitalWrite(COLW,LOW);
   for(hoek = 0;hoek < 105; hoek+=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }

}
if (temp < 22)
if (hum < 55 )
if (sensorValue < 100)
{digitalWrite(TempW,HIGH);
digitalWrite(TempR,LOW);
digitalWrite(LVG,LOW);
digitalWrite(LVB,HIGH);
digitalWrite(ventilator,LOW);
digitalWrite(ventilator2,LOW);
digitalWrite(COLW,HIGH);
digitalWrite(COLR,LOW);
 
   for(hoek = 105; hoek > 0 ; hoek-=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }

}

if (temp< 22)
if (hum > 55)
if (sensorValue<100)
{digitalWrite(LVB,HIGH);
digitalWrite(LVG,LOW);
digitalWrite(TempW,LOW);
digitalWrite(TempR,HIGH);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,HIGH);
digitalWrite(COLR,LOW);

 for(hoek = 105; hoek > 10;hoek -=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }


}


if (temp> 22)
if (hum >55)
if (sensorValue< 100)
{digitalWrite(LVB,LOW);
digitalWrite(LVG,HIGH);
digitalWrite(TempW,LOW);
digitalWrite(TempR,HIGH);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,HIGH);
digitalWrite(COLR,LOW);
    for(hoek = 0; hoek < 105; hoek+=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }

}

if (temp<22)
if (hum< 55)
if (sensorValue > 100)
{digitalWrite(LVB,HIGH);
digitalWrite(LVG,LOW);
digitalWrite(TempW,HIGH);
digitalWrite(TempR,LOW);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,LOW);
digitalWrite(COLR,HIGH);
    for(hoek = 105; hoek > 10;hoek -=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }

}
 
if (temp> 22)
if (hum< 55)
if (sensorValue >  100)
{digitalWrite(LVB,LOW);
digitalWrite(LVG,HIGH);
digitalWrite(TempW,HIGH);
digitalWrite(TempR,LOW);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,LOW);
digitalWrite(COLR,HIGH);
    for(hoek = 0; hoek < 105; hoek+=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }

}


if (temp > 22)
if (hum < 55)
if (sensorValue < 100)
{digitalWrite(LVB,LOW);
digitalWrite(LVG,HIGH);
digitalWrite(TempW,HIGH);
digitalWrite(TempR,LOW);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,HIGH);
Serial.println("COLW");
digitalWrite(COLR,LOW);
    for(hoek = 0; hoek < 105;hoek +=1);
  {                                
             
     servo.write(hoek);
     delay(10);
  }
}
if (temp < 22)
if (hum > 55)
if (sensorValue > 100)
{digitalWrite(LVB, HIGH);
digitalWrite(LVG,LOW);
digitalWrite(TempW,LOW);
digitalWrite(TempR,HIGH);
digitalWrite(ventilator2,HIGH);
digitalWrite(ventilator,HIGH);
digitalWrite(COLW,LOW);
digitalWrite(COLR,HIGH);
    for(hoek = 105; hoek > 10;hoek -=1);
  {                                
             
     servo.write(hoek);
     delay(10);
}} }

Custom parts and enclosures

This is the heat exchanger , the threeway-valve and also we made something to attach the servo in the threeway-valve
hvac_5bD9Yx0u0o.zip

Schematics

It regulates the temperature humidity and gas ( later we will change this to a CO2 meter).
Fritz 55wzvpg0nr

Comments

Similar projects you might like

Traffic Light Information System

Project tutorial by Pieter Luyten and Joppe Smeets

  • 16,238 views
  • 18 comments
  • 36 respects

Fish-O-Matic

Project showcase by Team The Fish-O-Matic team

  • 12,195 views
  • 3 comments
  • 71 respects

MultiFunctional Clock

Project in progress by 3 developers

  • 15,853 views
  • 2 comments
  • 28 respects

Plant Assistant

Project showcase by Team Vitronics

  • 2,793 views
  • 0 comments
  • 32 respects

Arduino UNO Mini-Weather Station

Project tutorial by Igor Fonseca Albuquerque

  • 25,837 views
  • 21 comments
  • 67 respects

A.S.C.H. (Automatic Safe Chicken House)

Project showcase by Team A.S.C.H.

  • 5,909 views
  • 2 comments
  • 24 respects
Add projectSign up / Login