DIY pH Contorller - New and Improved - The Planted Tank Forum
 
LinkBack Thread Tools Display Modes
post #1 of 12 (permalink) Old 01-29-2006, 08:57 PM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
DIY pH Contorller - New and Improved

I've been tinkering with DIY controllers for the last two years and I've built a lot of prototypes and followed a lot of plans somewhat unsuccessfully at times and this is the best I can offer for my effort to date.

The meter portion of the controller is a modification of plans provided by National Semiconductor. It uses an ultra low current op-amp (LMC6001). Their plan uses +/- 5VDC so the pH is read out in tenths of a volt, e.g. 0.7 volts is a pH of 7. I didn't like that so I desigend the circuit to run off of +/- 12 VDC. I had to make adjustment to the resistor values so that 1 volt is 1 pH unit and I've provided the equations I used iterate resistior values in a spreadsheet to get a workable combination. Rather than using a precision voltage control diode (I burned my last one up), I decided to simply use a red LED, which seems to work.

The output goes into a comparator (not an op-amp). The set point for the pH is provided by a precision voltage regulator that is adjustable. When I set it at 6.6 volts, it stay put and may only drift 10 or 20 milivolts. Hysteresis is provided by a potentiometer and a resistor in series to give me 0.02 to about 0.12 volts offset. I can control a range in pH of 0.04 with no problem.

The output for the comparator turns the solenoid on through a series of transistors. The first two are general purpose and for reasons I can't explain are needed. The first one triggers an LED to show that the comparator is calling for CO2 and it in turn triggers a Darlington pair that activates the solenoid, which runs on 12 VDC. I've got a simple snubber (a capacitor and and a resistor) to soften the activation. Normally you see circuits like this with a diode to protect the transistors. Since the solenoid is on the emitter side of the transistor I believe I don't have to be as careful but there is a LED attached in the same manner that not only verifies that the solenoid is activated, it provides a path to divert any voltage spikes.

The whole unit is powered by the +/- 12 VDC from a old computer power supply.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.

Last edited by g8wayg8r; 06-09-2007 at 04:33 PM.
g8wayg8r is offline  
Sponsored Links
Advertisement
 
post #2 of 12 (permalink) Old 01-29-2006, 10:09 PM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Cool, another electronics geek!

It appears that the hysteresis loop is wrong.

When the output of the the comparator goes high, the hysteresis circuit tries to raise the setpoint voltage, which would turn the comparator off. When the comparator is off, it tries to lower the setpoint voltage, which would turn the comparator back on.

In short, this is not wired as hysteresis - it's wired as an oscillator! And it would be oscillating like crazy if it were not for the fact that the setpoint voltage regulator is connected to the comparator's negative input *without* a resistor - meaning the LM317 is actively cancelling the effects of your erroneous hysteresis circuit.

Hysteresis should be on the positive side of the op-amp. Connect LM411 pin 6 to LM339 pin 3 with a resistor. Connect LM339 output to to LM339 pin 3 with a fixed resistor and variable resistor in series. That's a proper hysteresis circuit. The actual hysteresis is determined by the ratio between the resistance of the hysteresis circuit and the resistor on the input from the previous op-amp. This is a good page to see how hysteresis works.

The relay driver could use some cleanup too, but that's not a functional change.
DarkCobra is offline  
post #3 of 12 (permalink) Old 01-30-2006, 12:25 AM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
Thanks for the advice. It may be that I've got them connected properly but that's doubtful. I'll take another look.

Ok. Here's the scoop. I've checked my wiring and my notes. I started out with the hysteresis on the non-inverting input but it altered the pH reading due to the additional voltage. I changed it to the non-inverting input hoping it would move the set point so that the meter reading would be the same regardless of a high or low state from the LF411. I would work to drive down the pH after a water change but I guess it was ocillating very slowlywhen it reached the set point. Oh well. Maybe I could could invert the output through another op amp and get what I want. That's another day.

The 1K pull-up resistor on the out put of the LM339 gives me almost 12V. I've got a 220ohm reisistor connecting pin 6 of the LF411 and pin 3 of the LM339. I'm using around 500K for the feedback and that gives me about 0.1 volts hysteresis. It doesn't make much sense given the ratio. I've got a decent Fluke meter - not a $10 home utility type - so I'll go with the volts for now.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.
g8wayg8r is offline  
 
post #4 of 12 (permalink) Old 01-31-2006, 01:10 AM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
Ok, I've got it working in a 0.1 pH range with the hysteresis on the non-inverting input. I still don't understand the apparant lack of control with the hysteresis voltage but it's working and I continue to experiment with the ratios.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.
g8wayg8r is offline  
post #5 of 12 (permalink) Old 01-31-2006, 03:24 AM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by g8wayg8r
I've checked my wiring and my notes.
Notes! Wow, you're more organized than me.

Quote:
Originally Posted by g8wayg8r
I started out with the hysteresis on the non-inverting input but it altered the pH reading due to the additional voltage.
Connect the selector switch for the display directly to the output of the LF411. The new resistor between the LF411 and the LM339 + input will shield it from the hysteresis voltage. 220 ohms sounds low, try 1k as a starting point.

Quote:
Originally Posted by g8wayg8r
The 1K pull-up resistor on the out put of the LM339 gives me almost 12V.
If you still have a pull-up resistor on the hysteresis circuit/LM339 output, remove it. That will throw the ratio for sure.
DarkCobra is offline  
post #6 of 12 (permalink) Old 02-22-2006, 03:30 AM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
Ok. I'm starting anew again using an quad op-amp as a comparator circuit because the voltages from the LM339 are driving me nuts. I've feed the output from the pH meter and the set-point reference into seperate op-amps that are wired as a voltage follower. Both go into another op amp that does the controlling. The pH goes into the inverting input and the set-point into the non-inverting input with positive feedback to give it some hysteresis. That output is inverted to turn the transistor on when the pH is high and off when it low. The transistor circuit is rather simple and I have only had success using either a power transistor or a reed selonoid as an emitter follower. I've also noticed that I can clamp the output using two zenor diodes and it has a profound effect on the reading and hysteresis. So, I've not figured out how to make the controller and the meter independent of the power handling portion of the circuit. Sometimes I wonder if I would have done better starting with something programable like BasicStamps. Oh well. The good new is, however, is that it appears to work. The best I can do now is plus and minus 0.03 pH units.

I think I'm going to stick with this basic set-up and work with it from here.

Cobra: I really appreciate the help. I can go months and learn less. Anyway, I'm still not certain about the panel meter wiring. Maybe I'm not clear. I've got an on-on two position switch. One wire is attached on the non-inverting input and the other to the inverting input. Another wire goes to the panel meter to read the voltage. I know somthing is missing.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.

Last edited by g8wayg8r; 06-09-2007 at 04:34 PM.
g8wayg8r is offline  
post #7 of 12 (permalink) Old 02-22-2006, 06:56 PM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by g8wayg8r
I've feed the output from the pH meter and the set-point reference into seperate op-amps that are wired as a voltage follower.
Probably unnecessary, but as long as it works and you're comfortable with it, go with it. I see no functional problems in your arrangement.

Quote:
Originally Posted by g8wayg8r
That output is inverted to turn the transistor on when the pH is high and off when it low.
What's the purpose of R15/R16?

Quote:
Originally Posted by g8wayg8r
I've also noticed that I can clamp the output using two zenor diodes and it has a profound effect on the reading and hysteresis. So, I've not figured out how to make the controller and the meter independent of the power handling portion of the circuit.
I'm not sure exactly where you're placing the zeners, or the value. Let me know and maybe I can explain why this is causing a problem.

Quote:
Originally Posted by g8wayg8r
Sometimes I wonder if I would have done better starting with something programable like BasicStamps.
It wouldn't have simplified much. Although I admit, I have a secret desire to see a cheap DIY pH meter with USB interface.

Quote:
Originally Posted by g8wayg8r
Cobra: I really appreciate the help. I can go months and learn less. Anyway, I'm still not certain about the panel meter wiring. Maybe I'm not clear. I've got an on-on two position switch. One wire is attached on the non-inverting input and the other to the inverting input. Another wire goes to the panel meter to read the voltage. I know somthing is missing.
No problem on the help.

If it's working, nothing is missing. Meter input attached to center switch terminal, inverting/non-inverting inputs attached to outer switch terminals, and that's it.

Other notes: D3 in the diagram is backwards. D1 may be backwards also, but I'm not familiar with your use of an LED as a voltage-control device, so I'm not sure.
DarkCobra is offline  
post #8 of 12 (permalink) Old 02-23-2006, 02:00 AM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
1. The voltage followers are being used because they are there. I guess I could just use a singel op amp and wire a PNP transistor to accomplish the same thing as the quad amp and the NPN transistor. Transistors! I get so confused with them at times.

2. The R15 and R16 are there. It was like they were there and it worked and they were easier to use than cutting another wire. It's not like you need a bunch of volts to turn on a transistor.

3. I tried to clamp the voltage between the 4.7K resistor and the last op amp that inverts the voltage.

4. The LED do light up so I guess I have them drawn in like a zenor diode. In a way, that's how I'm using them.

I've got to rethink one and two above. No sense in over building the circuit.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.
g8wayg8r is offline  
post #9 of 12 (permalink) Old 10-29-2006, 07:29 AM
Guest
 
PTrader: (0/0%)
Join Date: Oct 2006
Posts: 1
Hi All,
I'm new in this forum, I'v just looked around and afound this interesting post.


g8wayg8r: what kind of electronic editor did you use.
Do you have a lateset working update of the monitor ?

I want to try and build one.

Thanks,
berler_d is offline  
post #10 of 12 (permalink) Old 02-12-2008, 01:59 AM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
Here the old controller and a circuit of a barebones meter I'll try to design a better controller around buy nulling out the 20 millivolts from the 20 pico amps of current from the 1 gigaohm probe.
Attached Thumbnails
Click image for larger version

Name:	MASI pH Meter.jpg
Views:	414
Size:	34.8 KB
ID:	5914  

Click image for larger version

Name:	New pH Controller.jpg
Views:	1213
Size:	45.5 KB
ID:	5915  


Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.
g8wayg8r is offline  
post #11 of 12 (permalink) Old 02-12-2008, 02:38 AM
Planted Tank Obsessed
 
intermediate_noob's Avatar
 
PTrader: (16/100%)
Join Date: Jan 2007
Location: ABQ, New Mexico
Posts: 309
Don't mean to take any fun out of this project, but here is a complete circuit, parts and step by step to create it. Have not had a chance to do it yet, but think it would be pretty cool.

http://www.66pacific.com/ph/ph_1.htm
intermediate_noob is offline  
post #12 of 12 (permalink) Old 02-12-2008, 10:16 PM Thread Starter
Planted Tank Enthusiast
 
g8wayg8r's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2003
Location: St Charles, MO
Posts: 517
The purpose is never to save money or time. This was a learning exercise for me. I now have a spreadsheet that I can input resistor values and make all of my gain and summing addition calculations.

I assembled and had the project that guy on yoru link based his design on. The advantage of his approach is that it gives you the correct ph on the display with no negative DC. I'm at the amp part of the circuit now and I'm having trouble with the reference ground working for some reason. I have no clue why. I've also discovered the reason why a Fluke RMS meter cost a bunch more than the little $10 POS multimeter I bought online. That meter and an oscilloscope really opened my eyes.

Andrew, MASI Treasurer

This message is always under construction: 75-gallon tank; 2, Eheim 2026 filters - one twice broken; Tek Light with 4, 54W T5s (6000K) ; Sand on top of 4:1 sand:clay mixture; Milwaukee CO2 controller; PlantGuild vortex CO2 reactor; pH = 6.6, kH=70mg/l, GH=120mg/l; EI; Flourish excel on 50% weekly water change: AGA Member.
g8wayg8r is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome