AquaticTechTank.net

A forum dedicated to design and program aquatic tanks
It is currently Fri May 06, 2016 6:08 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: CO2 sensor!
PostPosted: Fri Dec 14, 2012 8:47 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 261
This is the final code for the arduino.
Code:
#include <kSeries.h>

/* Reports values from a K-series sensor back to the computer written by Jason Berger Co2Meter.com
*/
int pin = 8;

kSeries K_30(12,13); //Initialize a kSeries Sensor with pin 12 as Rx and 13 as Tx
void setup()
{
    Serial.begin(9600); //start a serial port to communicate with the computer
    pinMode(pin, OUTPUT);
}

void loop()
{
  double co2 = K_30.getCO2('p'); //returns co2 value in ppm ('p') or percent ('%')
 
  //there's a glitch sometimes with the sensor output
  if(co2 >= 0 && co2 <= 10000) {
      co2 = co2 * 0.8317 * 44.01 / 10000;
      //   converts ppmv to ppmw
      //  quicker than co2/1000000 * 0.8317 * 44.01 / 1000000
      //  0.8317 accounts for Henry's Law
      // max ppmw will be 36.6 with 10,000 ppmv

      //raise from 0 to 36... writes every loop
      if ( co2 < 36 ) {
          digitalWrite(pin, HIGH);
      } else {
          digitalWrite(pin, LOW);

      }
   
  }
 
  Serial.println(co2);   //print value
  delay(1500);   //wait 1.5 seconds

}



I've also attached the K-30 series library for the arduino in case you can't find it on their website.


Attachments:
File comment: KSeries library for the arduino
kSeries.zip [9.71 KiB]
Downloaded 104 times
Top
 Profile  
 
 Post subject: Re: CO2 sensor!
PostPosted: Fri Dec 14, 2012 10:49 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 261
Time to build out how the arduino controls a relay. I got a 5v relay from Radio Shack to play with.

Image
Attachment:
arduino_relay.png
arduino_relay.png [ 48.88 KiB | Viewed 1791 times ]


It's a but more complicated than I thought. Then I realized I'd need to supply power to the relay AND the sensor from the arduino. Good thing the arduino has a 5v and 3.3V...

So I got this bad boy. All of the circuitry and diode is in the box
Image

So to test things out...
Image

The wiring is a lot less complicate than before.

I then put the whole thing in a power box. For easy connection, I used a telephone 6 pin connector to connect to the arduino.
Image

Hook everything up to a power outlet.
Image

And then test everything out on a desk lamp.

Here's the sensor with the new silicone membrane.
Image


Top
 Profile  
 
 Post subject: Re: CO2 sensor!
PostPosted: Thu May 28, 2015 2:27 am 
Offline

Joined: Thu May 28, 2015 2:17 am
Posts: 1
I know this topic is very old, and there were no updates for very long, but I want to ask you if you were willing to make me this DIY CO2 meter for money (and how much would it cost)? I would like to try it in my aquatic experiments, but I'm not as technically skillful to be able to do it myself. I have one non-commercial website about nature aquariums (http://www.prirodni-akvarium.cz/en/), and would like to share the results with others to get our hobby on a higher level of understanding.

If you can help me, I'll be glad.

Marcel G


Top
 Profile  
 
 Post subject: Re: CO2 sensor!
PostPosted: Mon Jun 01, 2015 1:07 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 261
Marcel G wrote:
I know this topic is very old, and there were no updates for very long, but I want to ask you if you were willing to make me this DIY CO2 meter for money (and how much would it cost)? I would like to try it in my aquatic experiments, but I'm not as technically skillful to be able to do it myself. I have one non-commercial website about nature aquariums (http://www.prirodni-akvarium.cz/en/), and would like to share the results with others to get our hobby on a higher level of understanding.

If you can help me, I'll be glad.

Marcel G


Hi, This project was continued here viewtopic.php?f=11&t=11
In the end, it leaked. I need to find a better way to build it.


Top
 Profile  
 
 Post subject: Re: CO2 sensor!
PostPosted: Mon Nov 02, 2015 6:44 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 261
Ok, This project is back. I was browsing PVC tubings at the hardware store and saw some components that might work as an enclosure. I'll still use the silicone membrane because it's way cheaper. I will also add a fan and humidity sensor in with CO2 sensor. The fan will speed gas exchange. Water molecule will pass through the membrane like CO2. That's where the humidity sensor comes in and it'll help out in telling you if there's a leak.

If the humidity is too high, say 90%, I'd just open the enclosure to let the moisture out. So I'll have to design the enclosure where it's easy to open and close.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Copyright 2noodles LLC 2012