Just wanted to point you can build your own co2 controller. Its pretty damn easy/quick to build one on a breadboard.
I used:
Arduino Uno
12v 1a 2.1mm DC power supply
Gravity: Analog Infrared CO2 Sensor For Arduino (0~5000 ppm)
BH1750FVI Digital Light intensity Sensor Module (GY-302) (optional - you could just as easily set a timer to turn everything off when the lights are off)
WiFi Module - ESP8266 (again optional, allows you to get it on your wifi network and report back info (like the current PPM), you may or may not need a 5v-3.3v logic converter.
(a breadboard, jumper cables etc).
You can get all this from dfrobot.com or core-electronics.com.au.
Taking out the optionals you could easily be up and running with < AUD$100.
And heres my sketch (the code). Its rough as fuck and is just a cobbled together collection of samples but it works
Its using the esp8266, the light sensor and also a temp/humidity sensor (DHT22). Reports values back to thingspeak.com.
Oh and I havent got around to programming the relay to actually turn the regulator on and off yet. That's this weekends project. For that I will use a
5V SINGLE CHANNEL RELAY MODULE 10A (CE05137)
---
#include "DHT.h"
#include <SoftwareSerial.h>
#include <SoftTimer.h>
#include <Wire.h>
#include <BH1750FVI.h>
#define DHTPIN 2
#define DHTTYPE DHT22
#define RX 10
#define TX 11
String AP = "XXX"; // CHANGE ME
String PASS = "XXX"; // CHANGE ME
int countTrueCommand;
int countTimeCommand;
boolean found = false;
String API = "XXX"; // CHANGE ME
String HOST = "api.thingspeak.com";
String PORT = "80";
String temp = "field1";
String humidity = "field2";
String co2 = "field3";
String lux = "field4";
int sensorCo2In = A0;
uint8_t ADDRESSPIN = A3;
BH1750FVI::eDeviceAddress_t DEVICEADDRESS = BH1750FVI::k_DevAddress_H;
BH1750FVI::eDeviceMode_t DEVICEMODE = BH1750FVI::k_DevModeContHighRes;
BH1750FVI LightSensor(ADDRESSPIN, DEVICEADDRESS, DEVICEMODE);
DHT dht(DHTPIN, DHTTYPE);
SoftwareSerial esp8266(RX, TX); // RX, TX
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
esp8266.begin(9600);
Serial.print("Starting up!\r\n");
Serial.print("Sending AT\r\n");
sendCommand("AT", 50, "OK");
sendCommand("AT+CWMODE=1",5,"OK");
sendCommand("AT+CWJAP=\""+ AP +"\",\""+ PASS +"\"",20,"OK");
analogReference(DEFAULT);
dht.begin();
LightSensor.begin();
Task sendSensorDataTask(60000, sendSensorData);
SoftTimer.add(&sendSensorDataTask);
}
void sendSensorData(Task* me) {
uint16_t luxValue = LightSensor.GetLightIntensity();
float h = dht.readHumidity();
float t = dht.readTemperature();
float concentration = getPpm();
String getData = "GET /update?api_key="+ API +"&"+ temp +"="+String(t) + "&"+ humidity + "="+String(h) + "&" + lux +"="+String(luxValue);
if (concentration > 0) {
getData += "&" + co2 + "="+String(concentration);
}
sendCommand("AT+CIPMUX=1",5,"OK");
sendCommand("AT+CIPSTART=0,\"TCP\",\""+ HOST +"\","+ PORT,15,"OK");
sendCommand("AT+CIPSEND=0," +String(getData.length()+4),4,">");
esp8266.println(getData);
delay(1500);
countTrueCommand++;
sendCommand("AT+CIPCLOSE=0",5,"OK");
}
float getPpm() {
int sensorValue = analogRead(sensorCo2In);
float concentration;
float voltage = sensorValue*(5000/1024.0);
if(voltage == 0)
{
Serial.println("Fault");
return 0;
}
else if(voltage < 400)
{
Serial.println("preheating " + String(voltage));
return 0;
}
else
{
int voltageDifference=voltage-400;
concentration=voltageDifference*50.0/16.0;
// Print Voltage
// Serial.print("voltage:");
// Serial.print(voltage);
// Serial.println("mv");
//Print CO2 concentration
Serial.print(concentration);
Serial.println("ppm");
return concentration;
}
}
//void loop() {
// put your main code here, to run repeatedly:
// if (mySerial.available()) // check if the esp is sending a message
// {
// if (mySerial.find("+IPD,")) {
// delay(1000);
// int connectionId = mySerial.read() - 48;
// if (mySerial.find("?climate")) {
// float h = dht.readHumidity();
// float t = dht.readTemperature();
// float f = dht.readTemperature(true);
//
// if (isnan(h) || isnan(t) || isnan(f)) {
// return;
// }
//
//
// String cipSend = "AT+CIPSEND=";
// cipSend += connectionId;
// cipSend += ",";
// cipSend += "{\"t\":";
// cipSend += t;
// cipSend += "}";
// // cipSend +=webpage.length();
// cipSend += "\r\n";
// sendData(cipSend, 1000);
// String closeCommand = "AT+CIPCLOSE=";
// closeCommand += connectionId; // append connection id
// closeCommand += "\r\n";
//
// sendData(closeCommand, 1000);
// }
// }
// }
//}
void sendCommand(String command, int maxTime, char readReplay[]) {
Serial.print(countTrueCommand);
Serial.print(". at command => ");
Serial.print(command);
Serial.print(" ");
while(countTimeCommand < (maxTime*1))
{
esp8266.println(command);//at+cipsend
if(esp8266.find(readReplay))//ok
{
found = true;
break;
}
countTimeCommand++;
}
if(found == true)
{
Serial.println("OYI");
countTrueCommand++;
countTimeCommand = 0;
}
if(found == false)
{
Serial.println("Fail");
countTrueCommand = 0;
countTimeCommand = 0;
}
found = false;
}