user2199899
Published © GPL3+

Wi-Fi programmable room thermostat with air quality monitor

Wireless programmable via Wi-Fi room thermostat with air quality monitor and other useful features.

IntermediateFull instructions provided537
Wi-Fi programmable room thermostat with air quality monitor

Things used in this project

Hardware components

Adafruit HUZZAH ESP8266 Breakout
Adafruit HUZZAH ESP8266 Breakout
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
×1
High Accuracy Pi RTC (DS3231)
Seeed Studio High Accuracy Pi RTC (DS3231)
×1
Graphic OLED, 128 x 64 Pixels
Graphic OLED, 128 x 64 Pixels
×1
Grove - Carbon Dioxide Sensor(MH-Z16)
Seeed Studio Grove - Carbon Dioxide Sensor(MH-Z16)
×1
TinyShield 433MHz Long Range Radio
TinyCircuits TinyShield 433MHz Long Range Radio
×2
DC/DC Converter, Step Down
DC/DC Converter, Step Down
×1
Linear Regulator (7805)
Linear Regulator (7805)
×1
Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
Test Accessory, AC Power Adaptor
Test Accessory, AC Power Adaptor
×1
Relay (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Mini Side Cutter, 120mm Length with 25mm Jaw Capacity
Mini Side Cutter, 120mm Length with 25mm Jaw Capacity
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Rosin
Solder Flux, Rosin

Story

Read more

Schematics

Analyzer

Contactor

Code

Analyzer

Arduino
No preview (download only).

Contactor

Arduino
/*
Wi-Fi programmable room thermostat with air quality monitor
Contactor
 */

#include <RCSwitch.h>     // https://github.com/sui77/rc-switch
RCSwitch mySwitch = RCSwitch();

void setup() {
      pinMode(13, OUTPUT);
      pinMode(3, OUTPUT);
      pinMode(4, OUTPUT);
      pinMode(5, OUTPUT);
      pinMode(6, OUTPUT);

      digitalWrite(3, HIGH);
      digitalWrite(4, HIGH);
      digitalWrite(5, HIGH);
      digitalWrite(6, HIGH);
      digitalWrite(13, LOW);

      mySwitch.enableReceive(0);
    }

void loop() {
       if( mySwitch.available() ){
        int value = mySwitch.getReceivedValue();

              //t < Tmin
        if(value == B11111110) digitalWrite(4, LOW);
        else if (value == B10000000) digitalWrite(4, HIGH);

                //co2 > Cmax  
        if(value == B11111101) digitalWrite(5, LOW);
        else if (value == B00000010) digitalWrite(5, HIGH);

             //h < Hmin
        if(value == B11111011) digitalWrite(6, LOW);
        else if (value == B00000100) digitalWrite(6, HIGH);

            //t > Tmax
        if(value == B11110111)digitalWrite(3, LOW);
        else if (value == B00001000) digitalWrite(3, HIGH);

        // LED D13 Arduino - indicates the presence of a transmitter-receiver connection (blinks - there is a connection)
        if(value == B10101010) digitalWrite(13, HIGH);  //  B10101010 - transmitter enabled code, generated in the analyzer without conditions 
        else  digitalWrite(13, LOW); 

        mySwitch.resetAvailable();
  }
}

PHP-script

PHP
<?php
// Wi-Fi programmable room thermostat with air quality monitor
// cadil@ukr.net
// test -  http://skorovoda.in.ua/php/aqm42.php?mymail=my_login@my.site.net&t=22.2&h=55&co2=666
$EMAIL=0;
$TEMPER=0;
$vlaga=0;
$carbon=0;
$device=0;
$EMAIL=$_GET["mymail"];
$device=$_GET["ID"];
echo $EMAIL;
$TEMPER=$_GET["t"];
$vlaga=$_GET["h"];
$carbon=$_GET["co2"];
$mdate = date("H:i d.m.y");
echo <<<END
<p>Temperature:  $TEMPER °С<p>
<p>Humidity: $vlaga %<p>
<p>Carbon dioxide content:  $carbon ppm<p>
<p>--------------------<p>
<p>Meteostation:  $device<p>
END;
echo <<<END
<p>$mdate</p>
END;
mail($EMAIL, "Air Quality Monitor " .$device. " v.051018","   This message was generated automatically by air quality monitor " .$device.    "One or more room air parameters (temperature, humidity or carbon dioxide content) are outside the specified limit values. === Temperature: ".$TEMPER."°C === "."Humidity: ".$vlaga."% === "."Carbon dioxide content: ".$carbon." ppm === "."Analyze the information! === Date: ".$mdate,"From: my_sensors@air-monitor.info \n")

?>

Credits

user2199899

user2199899

0 projects • 1 follower

Comments

Add projectSign up / Login