Page 1 of 1

New to Forums! Help With CO2 Sensor...

Posted: Sat Nov 12, 2016 11:02 pm
by cooledwhip
Hey everyone. I am new here as I had a few questions on a project I want to build. First off, my name is John and I am 16. I love technology and computers, I especially like to build computers and I've built about 5. I'm very technologically advanced if I say so myself. I am taking Computer Science Honors and I have been very familiar on what a raspberry pi is and heard so much of them, all you can do with them, etc. I have never owned one but hopefully soon I plan on buying a few models. One of my favorite hobbies is setting up Planted Aquariums. You can google them, look up videos on youtube, etc, they are very peaceful and awesome fish tank builds with gorgeous tropical fish and amazing aquatic plants. Aquatic plants are amazing to see grow, and it's very cool to see how they feed off the fish waste, and in return grow and filter the water. It's a cycle.

One thing that is almost essential for these planted tanks is CO2. Over the years people in the hobby have found many ways to make co2, and now the best way to do it is to purchase a CO2 tank which can cost anywhere from $50-$200, and a CO2 regulator and solenoid... What these pieces of equipment do is regulate the amount of CO2 going into the tank. You can set them on a timer and it will go on at a certain time, off at a certain time, etc, and will control the amount of co2 injected into the tank. The solenoid goes onto an adapter which goes onto the tank. You then have a line that goes from the solenoid to the tank and it outputs the Co2 gas, and regulates it.

The reason the co2 amount MUST be regulated is because if you just keep the co2 running 24/7, yes, your plants will look amazing, but all the fish will die of co2 poisoning. A good regulator and solenoid can cost upwards of a couple hundred dollars. Essentially for a good co2 system it will cost almost $400-$500. I know there is a better, cheaper, and more efficient way to regulate the Co2 going into the tank. I am wondering, does the raspberry pi (or other models) have any capability to regulate gas or pressure? I'm sure there is some way to attach a valve that can be opened or closed from the circutboard which in return will open up the line letting gas out. Could it be controlled by a chip on the pi board? Again, I've never owned one but I have an idea of what you can do with them. Still unsure. Would you be able to write a program that counts a 24 hour clock and you can have it do a command like "valveOpen: 0600" and then "valveClose 1400"? Again I need some help and guidance here.

What would the best model be for me to try this on? Would this even work? Thanks so so sOOOOO much

-John :)

Re: New to Forums! Help With CO2 Sensor...

Posted: Tue Nov 15, 2016 12:47 pm
by texy
Hi John,
sounds like an easy job for the pi with a little bit of extra hardware. So you need a method of controlling the solenoid with the Pi.
Have you bought any C02 kit yet?
Texy

Re: New to Forums! Help With CO2 Sensor...

Posted: Thu Nov 17, 2016 2:19 am
by cooledwhip
texy wrote:Hi John,
sounds like an easy job for the pi with a little bit of extra hardware. So you need a method of controlling the solenoid with the Pi.
Have you bought any C02 kit yet?
Texy
So far I have a couple CO2 tanks and an adapter that allows me to control air flow to a 6 mm aquarium tube line. It's basic, but my assumption is that there has to be some kind of device that will connect on the air line so I can leave the "hard" switch (the one that controls valve pressure FROM tank TO line) always on, and the raspberry pi will control when to open or close the valve. I just don't know what parts I need for this to work. I also need a raspberry pi... :) thanks

Re: New to Forums! Help With CO2 Sensor...

Posted: Thu Nov 17, 2016 8:29 am
by BMS Doug
you can control your solenoid using either a transistor or a relay (which would need a transistor to safely power). There are many pre-built relay boards for the Pi, some of the Arduino relay boards will work and others wont.

If you want to have accurate timing control then you should consider adding a real time clock device to the pi.

Do you have a CO2 sensor of some kind that could measure the CO2 levels so you could program the pi to open and close the CO2 solenoid based on the actual levels? (Datasheet link required if you want advice on how to connect it).

Re: New to Forums! Help With CO2 Sensor...

Posted: Thu Nov 17, 2016 10:32 am
by texy
cooledwhip wrote:
texy wrote:Hi John,
sounds like an easy job for the pi with a little bit of extra hardware. So you need a method of controlling the solenoid with the Pi.
Have you bought any C02 kit yet?
Texy
So far I have a couple CO2 tanks and an adapter that allows me to control air flow to a 6 mm aquarium tube line. It's basic, but my assumption is that there has to be some kind of device that will connect on the air line so I can leave the "hard" switch (the one that controls valve pressure FROM tank TO line) always on, and the raspberry pi will control when to open or close the valve. I just don't know what parts I need for this to work. I also need a raspberry pi... :) thanks
Give us a link to the 'adapter' you have, otherwise we are just guessing with help.
Texy

Re: New to Forums! Help With CO2 Sensor...

Posted: Fri Nov 18, 2016 1:26 am
by cooledwhip
There is a co2 detector I have that will show me how much Co2 is in the tank. It's just a simple manual CO2 detector. It's not electronic though.

https://www.amazon.com/Fluval-A7551-CO2 ... B0052M9886

The way I am thinking of testing when there's too much and when to have the valve open and close is just spend a day opening and closing the valve every 5 seconds and observing the fish and the detector. I'm fine with that though.

I'm uploading a video to show you guys what I'm working with so you have an idea of what I'm talking about.

Re: New to Forums! Help With CO2 Sensor...

Posted: Fri Nov 18, 2016 1:45 am
by cooledwhip
Here's exactly what I have and what I am working with in the video. Thanks

https://www.youtube.com/watch?v=0OkxbBNZ2zo

Re: New to Forums! Help With CO2 Sensor...

Posted: Fri Nov 18, 2016 8:48 am
by BMS Doug
cooledwhip wrote:There is a co2 detector I have that will show me how much Co2 is in the tank. It's just a simple manual CO2 detector. It's not electronic though.

https://www.amazon.com/Fluval-A7551-CO2 ... B0052M9886

The way I am thinking of testing when there's too much and when to have the valve open and close is just spend a day opening and closing the valve every 5 seconds and observing the fish and the detector. I'm fine with that though.

I'm uploading a video to show you guys what I'm working with so you have an idea of what I'm talking about.

Sounds like a good opportunity for an openCV application (eventually) but you will want to get the timed mode working first.

Once the timed method is working you can point a camera at the indicator and use computer vision to interpret the colour change.

Re: New to Forums! Help With CO2 Sensor...

Posted: Fri Nov 18, 2016 9:09 am
by BMS Doug
I've watched the video, I would think that you need something like this solenoid valve (I don't guarantee that this one is suitable although I think that it might be). provide the solenoid valve with 12V to open it and let CO2 through, drop the 12V and the valve will close (which is why its called a Normally closed).

The Pi can be used to switch the 12V on and off by using a darlington pair transistor and a flyback diode.
(The Pi GPIO output turns on the first transistor, which then turns on the power transistor which switches the 12V on to the solenoid)>

Re: New to Forums! Help With CO2 Sensor...

Posted: Fri Nov 18, 2016 10:03 pm
by cooledwhip
AWESOME!!!! :).

What model raspberry pi should I get?? I'm so excited I wish I had the parts now so I could make this a weekend project!
Thanks again.

Re: New to Forums! Help With CO2 Sensor...

Posted: Sat Nov 19, 2016 11:09 pm
by BMS Doug
cooledwhip wrote:AWESOME!!!! :).

What model raspberry pi should I get?? I'm so excited I wish I had the parts now so I could make this a weekend project!
Thanks again.
Any model of Pi will do for this, the Pi0 might be best for the finished version as it has the smallest footprint but the Pi3 would be easier to use while developing your solution.

Re: New to Forums! Help With CO2 Sensor...

Posted: Sun Nov 20, 2016 12:52 am
by cooledwhip
Ok but will there be problems with voltage? If the 12v pressure switch requires 12v to open, isn't the board only 1.2v? I'm talking about the Raspberry piZero

Re: New to Forums! Help With CO2 Sensor...

Posted: Sun Nov 20, 2016 7:50 am
by rpdom
cooledwhip wrote:Ok but will there be problems with voltage? If the 12v pressure switch requires 12v to open, isn't the board only 1.2v? I'm talking about the Raspberry piZero
All Pi models work at 3.3V. You will need a driver board and a 12V power supply to control the 12V for your switch, as Doug suggested
BMS Doug wrote:The Pi can be used to switch the 12V on and off by using a darlington pair transistor and a flyback diode.
(The Pi GPIO output turns on the first transistor, which then turns on the power transistor which switches the 12V on to the solenoid)