The Planted Tank Forum banner

1 - 12 of 12 Posts

·
Registered
Joined
·
517 Posts
Discussion Starter #1 (Edited)
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.
 

·
Registered
Joined
·
3,350 Posts
Cool, another electronics geek! :thumbsup:

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. :)
 

·
Registered
Joined
·
517 Posts
Discussion Starter #3
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.
 

·
Registered
Joined
·
517 Posts
Discussion Starter #4
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.
 

·
Registered
Joined
·
3,350 Posts
g8wayg8r said:
I've checked my wiring and my notes.
Notes! Wow, you're more organized than me. :)

g8wayg8r said:
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.

g8wayg8r said:
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.
 

·
Registered
Joined
·
517 Posts
Discussion Starter #6 (Edited)
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.
 

·
Registered
Joined
·
3,350 Posts
g8wayg8r said:
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.

g8wayg8r said:
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?

g8wayg8r said:
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.

g8wayg8r said:
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. :)

g8wayg8r said:
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.
 

·
Registered
Joined
·
517 Posts
Discussion Starter #8
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.
 

·
Registered
Joined
·
1 Posts
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,
 

·
Registered
Joined
·
517 Posts
Discussion Starter #10
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.
 

Attachments

·
Registered
Joined
·
517 Posts
Discussion Starter #12
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.
 
1 - 12 of 12 Posts
Top