Colorimetric CO2 Analysis

I am trying to make an automated aquarium and one of my control parameters is CO2 concentration in the tank water. An accurate (enough) method for determining CO2 concentration is by using a device called a drop checker, which has a color-changing solution that varies in color with CO2 concentration.

All drop checkers on the market are manual instruments; I want to automate one. Would it be possible to shine different colored lights through the indicator solution and use a photocell to measure light absorption of specific colors? I need to differentiate between blue, green, and yellow indicator solutions.

I know this has been done with opaque materials by measuring reflected light, does anyone have experience measuring light absorption in liquids?

Thanks,
khanqueso

You could use 3 leds turned on and off in sequence and measure their outputs.
Ldr photocells have very slow response compared to phototransistors, this may not be a problem for you.

The results would have to be determined experimentally though.

Eg measure the outputs rgb values for each case of colour change.
It may then be possible to derive a lookup table for ph.

The physical design of those drop checkers may not give optimum results however.
It would need to be totally light tight for instance, aquarium light leaking in would be a problem, although you could measur at night.

check - http://creative-technology.net/MAKE.html -

and - http://www.instructables.com/id/A-simple-DIY-spectrophotometer/ -

Thanks for the help!

The results would have to be determined experimentally though.

Eg measure the outputs rgb values for each case of colour change.
It may then be possible to derive a lookup table for ph.

I am planning on extensive testing to determine the rgb response to each color. Wouldn't want my CO2 dosing system to incorrectly think the CO2 level is low and shove so much CO2 in the tank that the fish can't breathe. :cold_sweat:

The physical design of those drop checkers may not give optimum results however.
It would need to be totally light tight for instance, aquarium light leaking in would be a problem, although you could measur at night.

I would be making my own drop checker. The ones on the market are designed for form rather than function. Mine will go over the edge of the aquarium, so I don't have to bother with waterproofing my entire system. I figure I can isolate the analyzer from the aquarium by building a case around the indicator solution, LEDs, and photocell/transistor.

check - http://creative-technology.net/MAKE.html -

and - http://www.instructables.com/id/A-simple-DIY-spectrophotometer/ -

Glad to see that this has been done before.

The most experience I have with colorimetry is from my freshman chem lab. I never received an explanation on how the analyzer worked (I'm assuming now it was a spectrophotometer), and I was convinced the machine ran on black magic. XD

The instructables spectrophotometer is interesting; I never would have considered using a stepper motor and diffraction to measure the color of a fluid. Still not exactly sure how I will do it, but now I have some ideas to explore!

I said rgb , iwould also suggest a yellow led given the colourchange.

Diffraction grating method covers the entire spectrum, led method only covers the range given by the specific leds.

Led method i would expect to be simpler.
Use a photocell , or lightmeter if u have one , and experiment with different colour leds.
You might be surprised.
Yellow led gives u good solid change indication with thymol blue ph indicator and a few others.

Not sure about the mix used in your co2 indicator though.

Hello,

Maybe you could use this kind of sensor Recommendations For You - DealeXtreme

Just move the white led to put them in front of the sensor, through you coulored liquid ?

Wow,
ill have to get one of those now.

Yellow led gives u good solid change indication with thymol blue ph indicator and a few others.

Not sure about the mix used in your co2 indicator though.

Typically, the indicator solution in drop checkers is bromothymol blue with a 4 kH standard. Assuming thymol is short for bromothymol, I should invest in some yellow LEDs :slight_smile:

Maybe you could use this kind of sensor http://dx.com/p/tcs3200-color-sensor-recognition-module-w-two-pins-for-arduino-white-149656

That looks like the perfect sensor for this! Maybe if I put a mirror behind the drop-checker, I can measure color without moving the white LEDs.

Thanks!
khanqueso

Hi:

In case you decide to go in a different direction with a different CO2 sensor:

Good Luck!

Another solution could be using a cam pointed at the instrument and extracting the RGB components from the image by software. That will require way less hardware tweaking. However this may need stable lighting and you may not need an Arduino.

Brothymol v thymol
They are different and cover a different ph range. Colour is similar though.

In case you decide to go in a different direction with a different CO2 sensor:

CO2 sensor for use in water and atmosphere

I've been looking for a sensor like that for a while now. Thanks for pointing me in the right direction. I fear it may be out of my budget though.

Another solution could be using a cam pointed at the instrument and extracting the RGB components from the image by software. That will require way less hardware tweaking. However this may need stable lighting and you may not need an Arduino.

I shouldn't have any trouble providing stable lighting. Phototransistor or camera, I'll need consistency in regards to lighting. I'm not quite sure how to interface a camera with the CO2 control system if I don't go through an Arduino directly. I suppose I could use some kind of DAS to communicate between a computer and the Arduino, but I'm not familiar with setting up a DAS.

Any recommendations on communicating between computer and Arduino (and vice-versa)?

Brothymol v thymol
They are different and cover a different ph range. Colour is similar though.

I looked them up. Seems that thymol is not soluble in water, but is in alcohol. As amusing as it would be to watch drunk fish, I'm not sure they would appreciate it. Gonna have to stick with bro(mo?)thymol XD

I would try to use the sensor I told you. It will save you a lot of problems and the accuracy will be undoubtedly superior.
If you can't because of budget reasons (you need to find out how much it is for real, I don't know) and you need to stay with the drop checker then:
If you are not familiar with Arduino and electronics already and neither with writing software for the computer then I would try the computer software approach. It will be easier, more accurate and reliable (I think). On the other hand, you don't need to build any hardware for that, with a camera and a computer you are all set. It will probably take longer since you will need to learn how to do some coding; but there are several examples of how to capture the camera and extracting the RGB components from the image. In this case, computer speed won't be a problem as you can sample the CO2 concentration every second or so, I guess. At such a low rate any computer can extract the RGB with no problems. I have done it several times and its so fast that you hardly notice anything. Your device is static which is another great advantage. Then you still will need an Arduino to perform the control you want. That will help you learn some Arduino tricks and coding too and on the other hand you would have learned to code in the computer and communicate with Arduino, something you will appreciate having spent time on in future projects. The down side is of course, having to use a computer; but you probably can find one for that. If the solution change in color is hardly noticeable for a person then it will probably be harder for the computer to detect the changes and that will limit your resolution and accuracy. That can become another limitation you may encounter with this method. I have no idea about it.
Arduino can communicate with the computer directly by just connecting it to a USB port. Nothing else is required and there are millions of examples of how to do that.
Anyways, either method you use, you will have to provide interlocks alarms, etc in your system to prevent (as you mention earlier) wrong CO2 deliveries to the tank.
To give you some ideas, with the same cam you can set a white spot which can be used as control image and determine if the illumination is right, for example. Another colored spot (or several) corresponding to known values within your range can be used to calibrate the system on every measurement and find out if the readings are right. You can take readings from 2 or more places in the image, compare them and average, etc. Illumination is critical though. Of course, things like contamination of the solution, broken container, power failures you will have to find ways to detect them.
Again; if you can find the money, try to get the right sensor. In my opinion, it will be the easiest and more reliable way to do it.

I am looking into the fischundwasser sensor and the mini-pro CO2 sensor by Pro-Oceanus. Hopefully, one of the two will be in a reasonable price range.

My plan is to take CO2 samples at about 6 - 10 samples per minute, so I wouldn't have to worry about computer speed. I am already familiar with C programming at a basic level, but I do not know how to use it to interface the serial I/O from the Arduino to another program such as Excel.

The resolution is not too crucial, +/-2 ppm weight is acceptable (target CO2 concentration is 20 - 30 ppm weight). The indicator solution should change color very noticeably with that much swing in CO2 concentration, so a camera-computer setup will work just fine.

I am definitely planning on safety interlocks; my aquarium is sitting on a CO2 tank large enough to completely displace all the oxygen in my living room. Don't exactly want it all to empty at once :fearful:

but I do not know how to use it to interface the serial I/O from the Arduino to another program such as Excel.

It is possible to either directly log the data into Excel with a computer or use and SD card as the transfer media in an Arduino stand alone situation, although I don't know using C.

Camera or no, I probably should log all my measurements to Excel anyway. That way I can look up the history of my aquarium if I think something is going wrong. My project gains another step in complexity every time I think about it :slight_smile:

Camera or no, I probably should log all my measurements to Excel anyway. That way I can look up the history of my aquarium if I think something is going wrong. My project gains another step in complexity every time I think about it smiley

Apparently your project is getting more and more similar to this one... :). Skip to the end so you can see the data logged. The code for how to log the data is in the description... Enjoy.

Thanks. That weather station is very similar to what I am planning for my aquarium. I like the rate detection alarms; the most deadly thing about water conditions in aquaria is the rate at which they change.

Now I just gotta have the system email me when my aquarium starts drastically deviating from ideal. Maybe even remote control... I'm making this harder on myself every day XD

EDIT: The Pro-Oceanus CO2 sensor is not cheap at all, about $5000 for analog output and $9000 for serial with on-board data logging. Still no results on the ficshundwasser sensor.

Now I just gotta have the system email me when my aquarium starts drastically deviating from ideal. Maybe even remote control...

Yeah, that's something pretty cool and I need to work on that too... In the project I showed you, I couldn't solve that... Have to try harder when I get some time.

I'm making this harder on myself every day smiley-lol

It's very easy to fall onto that temptation... It happens to me constantly. In reality, all these projects are the never ending story and features can be added as you can imagine them and are willing to spend the time (and sometimes money) building them.

My recommendation is try to do one thing at a time and begin only with what is really necessary. That way you already have something at hand and that gives you more motivation to continue. In the process you learn and continue adding as needed.

In reality, all these projects are the never ending story and features can be added as you can imagine them and are willing to spend the time (and sometimes money) building them.

I enjoy the never ending story (so far). It is much easier to modify the code inside an Arduino than the cranks and linkages in a mechanical device.

Speaking of spending money, the fischundwasser CO2 sensor is 1500 Euros, definitely out of my budget. Back to square 1.1: LED and/or camera photospectrometer. How I wish I was done with my degree and making money to fund this project! $) XD

I whipped up an LED photospectrometer for proof of concept (literally a pile of black cardstock, wires, and LEDs; I had all the parts laying around). I haven't tested it with a colored solution yet, hoping to get to that once I figure out how to get more light from my wimpy green LED. :confused: