# DIY CO2 Controller - The Real Thing



## g8wayg8r (Dec 24, 2003)

I did a search for pH meters and controllers and I found five. Two were courtesy of National Semiconductor. I started with the plan for a pH meter based around their LMC6001 and LMC6041 Op-Amps and assembled it on a breadboard. Their plan and calibration instructions are excellent and it surpassed my expectations. All I needed to do was to make a comparator using two LM411 Op-Amps: one to compare the pH against a reference and the other to invert the voltage so I could turn my CO2 solenoid off and on. Today, I'm controlling the pH between 6.92 and 6.82. Getting the hysteresis set was a bit tricky at first but I think I found a configuration that works smoothly.

I'll post a schematic soon and provide greater detail regarding the comparator.
Until then, I've got a picture of the circuit wired on my breadboard. I still have to set my decimal point on the panel meter but that's no biggie. 100 mV = 1 division of pH so 682 mV is a pH of 6.82.


----------



## Aftica (Nov 26, 2003)

Ok - I am excited about this one - looks like it may be a wee bit of fun...

Please oh please make the instructions idiot proof for people like me


----------



## unirdna (Jan 22, 2004)

I'm blown away! The millivolt/pH stuff I understand, but I don't know circuitry from a hole in the ground. How much $ do you suppose you saved making your own? You'll still need to buy a probe, I assume (if you are macgyvering the probe as well, you really need to audition for "survivor").


----------



## g8wayg8r (Dec 24, 2003)

You are correct about the probe. I bought a Hanna HI2114P/2, a 7.00 buffered standard and some storage solution from Automated Aquarium Systems. I love their stuff and would have bought a Hanna single point controller if I did want to play around with this project.

In the end, I'm not sure if you save any money. I bought enough electronic components to build the meter three different ways and I've not even begun thinking too much about the hardware. The thing about this project is that you learn about basic electronics, stuff that's useful even if you are a computer guy and like Basic Stamps and things like that. You will need and learn about voltage dividers, what op amps can do (which is really cool) and how to get rid on noise problems with hysteresis using Schmitt Triggers.

In the end, you may save money if you happen to have so electronic parts around. You can also save some money using a power supply from an old computer too. You will need + and - 12 VDC. Is it worth it? That all depends on how much you want to know about the numbers you are seeing. Do you just want something to plug in and run or do you want to know how your signal is generated and what happens to it along the way? 

The answer is maybe, it could just save you a few bucks - but probably not. But, if it doesn't, you will learn a lot of cool stuff through the aggravation and experience. Plus, you may have one heck of a controller that YOU can fix and manage.

I'll do my best to simplify things so the devil will be the hardware: boxes, switches, plugs, mounting, etc.


----------



## Stu (Feb 16, 2004)

Sweet!
I'd deffinately be interested in playing about with a DIY controller.









You can't beat a bit of home-made satisfaction IMO (until it breaks and you have no idea why, followed by hours of painful diagnostics.














)


----------



## g8wayg8r (Dec 24, 2003)

This is an edited sketch with (I believe) fewer error. It shows all of the positive and negative voltage connections. The grounds are the upside down triangles. Please note that crossing lines without a node (dot) are not connected. 

This controller requires positive and negative 12 VDC. You can build that using a transformer, a diode bride and some capacitors or you can modify an old computer power supply. You may need to find a link that identifies the gang of wires on the plug.

Since I started, I had to replace the LMC6001 with a LMC6041 and it seems to be working fine. Both are very low current op amps.


----------



## Sterving (Dec 23, 2004)

Sounds like fun. I dabbled in this stuff last time... say 12 years ago. Much interested.


----------



## g8wayg8r (Dec 24, 2003)

I used an old computer power supply box to mount the controller. The wiring isn't as tidy as I wanted but I had to do some debugging. Once it was working and could fit in the box.....good enough.


----------



## g8wayg8r (Dec 24, 2003)

This is the backside. From right to left is the: probe input, an output for a short to ground and -0.4141 volts to allow calibration, a 1.5 amp slowburn fuse for the CO2 solenoid valve and (from top to bottom) a hole, +12 VDC output for the solenoid, +12 VDC input from the power supply, ground for the solenoid, ground from the power supply and -12 VDC from the power supply.


----------



## g8wayg8r (Dec 24, 2003)

On the bookshelf and operating after my water change. The holes under the meter from right to left are (1) set point to get -0.414 volts, (2) pH set point for the controller, (3) zero adjustment (either electronic 7.00 or buffered solution) and (4) slope adjustment used to make the instrument read 14.00 at -0.414 volts. The right, top switch is a selector for the controller/set-point outputs or the calibration outputs. The switch below allow me to switch to ground so I can zero the instrument electronically (ph = 7.00) and to -0.4141 volts so I can set the slope of the instrument (pH = 14.00). I can also use a buffer solution at 7.00, which requires an adjustment of only a few tenths with my new probe. A second standard solution is unnecessary. The switch on the left allows me to display either the set point or the pH being monitored. When the controller opens the soleniod, a green LED illuminates. I don't have a power on light because I have one on the power supply. Regardless, I couldn't resist pimping my controller. I installed a ultra bright blue LED inside the case. It's sweet at night and I've watched it control the pH over a range of 0.1 - not too shabby.


----------



## g8wayg8r (Dec 24, 2003)

I don't know how to photograph at night. Perhaps this is the best the camera can catch. Believe it or not, the mostly dark areas on the right are illuminated with a 1 watt moonlight.


----------



## Marc (Oct 13, 2004)

I've been reading your most and dang that thing is sweet!
My question, because I may not be understanding the information- can you set the exact range you want so that the meter can controll what ph to kick the solenoid on and off at? For example: ON from 6.8-6.70 and OFF at 6.69 ph. I like your controller because you can minimize the pH swings even if its only .1 change.


----------



## bigpow (May 24, 2004)

Okay... enough bragging 
tell us how much you want for it and when is the soonest we can buy?


----------



## g8wayg8r (Dec 24, 2003)

Marc:

The adjustment is made to limit the low pH when the solenoid is on. The range in pH is determined by the resistance ratios of the schmidt trigger, which are the 1M, 220 and 619K resistors attached to the non-inverting (+) input of the IC labelled A3. The 220 ohm is the key. The lower the ohms, the tighter the control. The problem is that you get to a limit which defeats the purpose of the circuit. The circuit adds or subtracts a little bit of voltage so that when the relay turns the soleniod on or off, it's outside the noise level and it stays on or off - no chatter. The values I have selected add about 3 mV to the set point, where 1 mv is 0.01 pH units. When it turns off, e.g., at 6.85 and the instrument stabalizes in a minute, the pH reads 6.82. It turns on again at or about 6.93, sometime higher.

When I get some time, I've got to update the schematic and add some user notes. I'll try to assemble some sort of price list to buy the components. I'll not bother to offer any great detail about thing you can buy at Radio Shack but I will include general prices. You can get the panel meter from Circuit Specialist. The best and only place a hobbyist can buy all of the cute little IC that don't take kindly to shorts circuits, reversed polarity and other stupid assembly methods (yes, that's experience talking) is DigiKey. Although they do not have the lowest prices on basics compents like resistors, they are inexpensive and the IC prices are reasonable (about $3 for the fancy chips). You will appreciate their customer service: prompt delivery and an inventory so big it's hard to find the part you want. Plus, there is no minimum order. They have a small service charge for order below $25 and you only pay exact USPS express mail changes, which cost you only several dollars. It's one stop shopping for everything but the panel meter.

After all of the screw-up along the way, I don't want to build anymore proto-types, at least for a while. I just want to watch and listen to it work.


----------



## Chamkeeper (Apr 12, 2005)

If I could figure out how to get the darn analog right on these Microcontrollers, I'll be building half of this circuit...

Nice work.


----------



## Aphyosemion (Oct 15, 2004)

Okay, McGyver, I wanna see you design the CO2 tank and regulator and solenoid out of a couple of coconuts, now! :tongue: 
-Aphyosemion


----------



## g8wayg8r (Dec 24, 2003)

I've had some trouble with the controller lately. It slowly became non-responsive and I couldn't determine the source of the problem. I set my solenoid on a timer to mimic the cycle I have been observing and it does dose the tank with CO2. The plants grow. Still, I don't feel comfortable pushing the pH down too low that way so I needed to buy or build a new controller. 

After a very unpleasant experience dealing with Hanna Insturments and their retailer that sell computerized systems I felt it was best to dust off the chalkboard again. I assembled two versions of a contoller on a breadboard: one designed by Jim Hurley in 1992 and another based on a plan for a pH meter provided by the datasheet for a LF444 chip. I corrected a few errors with Jim's plan but I was never able to introduce enough hysteresis to keep the controller from sticking at the set point. I don't know enough about electronics to do that. I was able to do that, however, with the controls I designed for the LF444 meter. For the past week, it's been working well: less than +/- 0.1 unit. 

Both of the pH measuring portions of the circuit are simple. You do the zero adjustment with the second pot that's downstream either by grounding the input or putting the electrode in a 7.00 buffer solution. For some reason, both of my electrodes read 0.2 higher in the buffered solution. I'm not concerned. I just zero it there. The slope is set by applying a know voltage based on 0.059 V/ph unit. Since I really can't count on more than 10 VDC out of the IC's with 12 VDC input , I applied 0.1770 (0.059 x 3) volts so I could use to first pot to set the pH at 4.00. Once that's done it's a matter of setting the set point and letting the electronic do the work.

I've got another schematic of the controller. I'll make an update on the component values and verify the hookups when I start the assembly.


----------



## debelius (Sep 16, 2006)

Hi g8wayg8r,

About your famous CO2 controller (bravo!!!!); (I'm french and have some problems with english) I need some explanations:
I would to know if the OPAmp circuit (6001 and 6041) provides positive power at the output, because i want to connect this output to a analog-numeric convert component which accept only positive power in a 0-5v range. this component is a 1wire component and is the only one i know to work with 1-wire bus.
Best regards
Dominique


----------



## snafu (Oct 9, 2004)

debelius said:


> Hi g8wayg8r,
> 
> About your famous CO2 controller (bravo!!!!); (I'm french and have some problems with english) I need some explanations:
> I would to know if the OPAmp circuit (6001 and 6041) provides positive power at the output, because i want to connect this output to a analog-numeric convert component which accept only positive power in a 0-5v range. this component is a 1wire component and is the only one i know to work with 1-wire bus.
> ...


if you look at the data sheet for the LMC6001, you'll see a detailed writeup of the sensor conditioning circuit...

http://www.national.com/ds/LM/LMC6001.pdf

also, why limit yourself to 1-wire? 
-snafu


----------



## debelius (Sep 16, 2006)

OK but i'm not a specialist of electronic circuits and i don't understand the datasheet write-up. can you tell me if the probe provides -118 mv which voltage i should obtain at the output of the circuit (LMC6041)?
The 1-wire system is interesting because you can connect components directly to you PC (USB) and under Linux the component is seen like a file system; then you can build a web site and see your tank from anywhere!!
Dominique


----------



## snafu (Oct 9, 2004)

debelius said:


> OK but i'm not a specialist of electronic circuits and i don't understand the datasheet write-up. can you tell me if the probe provides -118 mv which voltage i should obtain at the output of the circuit (LMC6041)?
> The 1-wire system is interesting because you can connect components directly to you PC (USB) and under Linux the component is seen like a file system; then you can build a web site and see your tank from anywhere!!
> Dominique


pH = 9 or 900mV. according to the datasheet, the LMC6041 inverts and shifts.

is the '1-wire' you are referring to the Dallas 1-wire serial protocol or something else?


----------



## debelius (Sep 16, 2006)

Yes, it is the Dallas DS2450 I use also DS 2406 to switch on and off the lamps and cooler or resistors, and DS1820 to temperature measure. the whole system are connected to my linux PC via a dongle DS9490R.
Thanks a lot for your answer, did you realize this circuit?

Dominique


----------



## snafu (Oct 9, 2004)

debelius said:


> Yes, it is the Dallas DS2450 I use also DS 2406 to switch on and off the lamps and cooler or resistors, and DS1820 to temperature measure. the whole system are connected to my linux PC via a dongle DS9490R.
> Thanks a lot for your answer, did you realize this circuit?
> Dominique


not yet... it's on my list of things to do. you should start up a new thread on your 1-wire controller concept. i imagine there could be a lot of interest in something like that.
-snafu


----------

