Co2 Controller

Ok so let me start off by saying that I know a little bit about programming the Arduino. I have built a temperature controller and now I would like to build a Co2 controller. I am willing to pay someone for help with this. This is the temp controller I have built:

Here is the code:

#include <EEPROM.h>
#include <LiquidCrystal.h>// include the library code
int tempPin = A0;  // make variables// thermistor is at A0
int led =13; // led is at pin
float temp;  // make a variable called temp
float settemp; // make a variable called temp
int swtu = 7;  // switch up is at pin 7
int swtd = 6;   // switch down is at pin 6
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // lcd is at 12,11,5,4,3,2

void setup() {
  pinMode (led,1);  // make led or pin13 an output
  Serial.begin (9600); // set the serial monitor tx and rx speed
  lcd.begin(16, 2); // set up all the "blocks" on the display
  lcd.setCursor(0,0); // set the cursor to colum 0 row 0
  lcd.print("Welcome"); // display Welcome for 1 second
  lcd.clear(); // clear the lcd
  EEPROM.read (1); // make the eeprom or atmega328 memory address 1
}

void loop() {

  int tvalue = analogRead(tempPin);  // make tvalue what ever we read on the tempPin
  float temp = (tvalue / 6.388888888889); // the math / conversion to temp
  lcd.setCursor (0,0); // set the cursor to 0,0
  lcd.print ("TEMP ");
  lcd.print (temp);  // Print the current temp in f
  lcd.print (' °F');
  Serial.println (temp);  // print the temp it the serial monitor
  settemp = EEPROM.read(1); // read the settemp on the eeprom

  delay (250); // wait for the lcd to refresh every 250 milliseconds
 
  if             // if we se the switch up pin reading on 1 or 5 volts
    (digitalRead(swtu)== 1 )
  {
    settemp ++  // add one to the settemp, the settemp is the ideal temperature for you
   

      ;
  EEPROM.write (1,settemp); /* write the most recent settemp in eeprom data stoage
  so that if the power is disconnected, you settemp is saved!*/
}
  

else{// other wise do nothing

}

if
(digitalRead (swtd) == 1)// if we detect a 1 on the other switch pin
{
  (settemp --);// subtract one fromm the settemp
 EEPROM.write (1,settemp); /* write the most recent settemp in eeprom data stoage
  so that if the power is disconnected, you settemp is saved!*/
}
else {
// else, do nothing
}

if (temp > settemp) // if the temperature exceeds your chosen settemp
{
  digitalWrite (led, 1); // turn on the led
}
else // if that doesn't happen, then turn the led off
{
  digitalWrite (led,0);
}



lcd.setCursor (0,1); // set the cursor to 0,1
lcd.print ("SET TEMP "); // Print set to and your ideal temperature in f
lcd.print (settemp);
lcd.print (' °F');
Serial.println(settemp);  // Print the settemp in the serial montior

delay (250); // wait 250 milliseconds

}

I am wanting to do the same exact thing only with a Co2 sensor. It will monitor and control the ppm level of Co2. Like I said I am somewhat knowledgeable when it comes to Arduino. Also I am willing to pay someone to guide me through everything. Thanks.

Anyone?

Check this page in the playground: Arduino Playground - MQGasSensors. It covers a bunch of gas sensors, including one for CO2.

Thanks Bill! Yeah I am sort of pinched for time with this project. I was hoping someone could draw up a diagram as the one for my temperature controller and write a code for me. I would even pay the person. Anyone out there willing to help me out??

As Bill kindly pointed out, its all on his link with the code.
http://itp.nyu.edu/physcomp/sensors/Reports/MG811

Well I appreciate the efforts. But as I stated I don't know too much about programming. The link really is not helping me. That uses an SD card shield and I don't understand most of the code. That has temp/humidity and co2 combined. I would like to keep it simple only using the Co2 sensor and have it control a relay. Just like my temperature project. I just never used a co2 sensor and that why I am hoping someone can guide me through connecting everything and with the code.

Anyone willing to help me on this?

Anyone?

That sensor is read using analogRead. So your existing code will work as is except that you'll need to change some of the text in the serial.print statements and you'll need to adjust the conversion factors to get to PPM. You can just print the raw values from the sensor to start with and verify that it changes when you blow on it.

The circuit is given on the page I linked earlier - you just need to choose the resistor required which is covered in the text on that page.

Don't forget that that type of sensor usually requires a 24 hour burn in period before you use it.

I don't suppose I can convince someone to help me with the code and wiring? :stuck_out_tongue:

Anyone?

I think the details of what you need and want are too sparce.

are you looking for someone to write a sketch for you ? if so, please detail the overall scope.

are you looking for someone to lay out a schematic for you? if so, please detail the required functions.

Yes I am willing to pay someone to write a sketch and draw me a diagram in fritzing. Like I mentioned before I want this to be just like my temperature controller I built except instead of temperature, it will control C02.

So, what I'm trying to figure out is why you can't adapt your temperature controller over to CO2. It seems like it would be very very similar.

Where are you located? What parts do you have to use, or does your helper need to figure out those? Is there much of a budget?

See I am not sure about the parts. I know I need the Co2 sensor. But am unsure which to use. I am located in Western NY. I don't have too large of a budget but I feel like this code may be simple. I'm not sure about using the existing temp code for the co2 one and adapting because the temperature sensor changes voltages and allowing me to do some math within my code to convert to degrees Fahrenheit.

Same principle. You'll just need to find something that measures CO2 within your budget.
http://www.digikey.com/product-search/en/sensors-transducers/gas-sensors/1966735
Though those are expensive. You may need to do your own research.

Once you find something, it will feed the data out as either an analog or digital signal, and you can use the Arduino to process and adjust your output.

Mirith I totally agree with you. I just do not know how to wire everything up and write the code. Could you look at me temp controller code and see if I can use that with some adjustments?

FallenDemon:
Mirith I totally agree with you. I just do not know how to wire everything up and write the code. Could you look at me temp controller code and see if I can use that with some adjustments?

Assuming simple bang-bang control like you have, then all you need is to do is basically read the C02 sensor and feed it into temp. It would work exactly the same. Then whatever you do with output, you would do it the same with with the value. You might need to adjust conversions, but that is about it.

The sensor I am using will be here....CozIR®-A 2,000 ppm CO2 Sensor | CO2Meter.com

Anyway I can convince you to help me with the code? ?

Nice Sensor