Howto: PLC Reef Controller II

Wattage values on resistors tells you the max they are rated for and this is a low wattage circuit so any wattage value should be ok.

I have the chips for that circuit too, but R1 is hard to find.
 
slug said:
Wattage values on resistors tells you the max they are rated for and this is a low wattage circuit so any wattage value should be ok.

I have the chips for that circuit too, but R1 is hard to find.

Did you find R1? I've looked with no luck...

Also R3, and R4.

R3 looks like it says 8 5k,
is this 85k or eight 5k resistors? which would be 40k? I'm lost here.

Same with R4 it says 9 100k, is this 9100k(9.1M), or 9 100k resistors 900k?
 
I know this is a little off topic but does anyone know the equation (if there is one) used to find the phase of the moon on a given night?
 
The easy simplified way would be to choose a given day to be a new moon, then increment 29.5 days to be another new moon. 14.8 would be a Full Moon. You can scale from there.

The more accurate and compliated way is available on the net. Search google for "pom moon source code" you'll see several C and Java examples.
 
Well I've gotten what I need to know as far as ph and orp go. This ph circuit should work flawlessly, I'm removing the tempature compensation resistor (Its pricey and hard to find, micro-ohm has it as a special order item). I'm going to replace it with a 100k resistor, and use a thermocoupler next to the ph probe, and do the tempature compensation in the plc's program. The only problem I forsee is our MH's I'm going to have to put sometype of capacitor on the + and - feeds into the circuit in order to filter out the noise. I've read a few articles regarding MH's and other ballast type lights throwing off readings on these diy circuits, I'll test this when I build it.

I'm going to order both a ph probe and orp probe (I have no need for orp readings but I'm going to get a probe in order to test a second circuit for orp readings). Considering ORP stays in MV's and doesn't have to be converted into another type of measurement this should be a simple opamp circuit.

I've ordered enough parts for 2 intial circuits. For those of you who are monitoring this thread getting ideas for your own controllers, it would not be hard at all to modify this circuit for use on a basicx stamp / pic or some other type of microcontroller. Nor would it be hard to create a simple LCD display to show you orp values and ph values, instead of connecting it to a PLC.

Bear with me, its hard switching back and forth between normal wiring diagrams that I'm use to, to electronic schematics.
 
pH Circuit-long post

pH Circuit-long post

Here is a simple solution that attaches a pH probe to a high-impedance input of an op amp. The output is then read to the input of a digital voltmeter(Fig1). I used LFXXX rather than LMXXX for the JFET Op Amps, $4.50 for all all parts including caps and resistors.
Figure1.jpg
[/IMG]


You will still need to convert the the DMM readings to pH units using a calculator to plot three dots on the line. Figure 2 shows a typical plot of pH versus millivolt output. (Note that pH is temperature-dependent; you have to recalibrate if the temperature changes.) It is also very linear.
Fig2.jpg
[/IMG]

To calibrate the system use 3 pH standards, 4-, 7-, and 10-pH units. These standards are inexpensive and available at any chemical-supply house and most LFS.

The calibration procedure is as follows:

Short the input leads (pins 2 and 3) together and adjust the offset potentiometer such that the output reads 0 mV. Untie the leads. Place your pH probe in each standard and record the output (in millivolts) for each standard and record the values in your calculator and determine the slope of the line. Remember y=mx+b? :D

If you want to drive the signal directly to pH units, build this guy in FIG3:
Fig3.jpg
[/IMG]

At approximately 24Ã"šÃ‚°C, the equation for the slope of the line is Y=ââ"šÂ¬Ã¢â‚¬Å“0.017X+7, for better accuracy lets redo the equation by ten. We now have 10Y=ââ"šÂ¬Ã¢â‚¬Å“0.17X+70.

There are three sections in Figure 3. The voltage from the probe to pin 3 of LF351 provides the high-impedance input. This device inverts the signal and then outputs a signal to one-half of the LF353 to control the slope. This LF353 also multiplies the LF351's output by ââ"šÂ¬Ã¢â‚¬Å“0.17. The last stage uses the second half of the LF353, and it functions as a summing amplifier and controls the Y intercept by adding 70 mV to the input signal.

When you build this circuit, solder the BNC directly to the op amp's input pin to prevent any added impedance levels from the probe.

After you build this guy, its time to calibrate and set the slope. To calibrate the circuit, first short the inputs together and adjust the offset potentiometer to obtain 0-mV output from the LM351.

To calibrate the circuit for pH units, place the pH probe into a pH standard. Measure the voltage at the output of the LM351. Multiply this voltage by 0.17 and adjust the slope potentiometer until the output of the second op amp (Pin1 of the 353) is exactly the number you just calculated only negative in value. Then, connect the meter to the output of the circuit and adjust the Y-intercept potentiometer until the circuit yields the pH of the standard you use. (For example, a pH of 10.1 reads 0.101V.) To tweak the circuit, place the pH probe in other standards and adjust the Y-intercept potentiometer.

Lastly if the temperature changes, you must recalibrate, but since we don't typically deal with much temp changes this issue is moot. The accuracy of this circuit is generally Ã"šÃ‚±0.1 pH units. When you order pH probes, you should order low-impedance units. This particular circuit uses Cole-Parmer (www.colepalmer.com) U-59001-65 probes.
Probe

Now Roy, how do we do code to get the PLC to control and not just monitor?
 
So what kind of output is that circuit putting out? +/- 600 mV? What type analog input would you need on the PLC to use this with?
 
Depends on temp, but certianly less than +/-600mV, pH will stay around the 8.0pH range. If you ever see a positive voltage your tank is reaking. The voltage output of this circuit is a direct feed to an EM235. It is basically an A/D converter type PLC with trim pots for calibration. This unit communicates to the CPU and in turn the PLC controls some event. Turn on a powerhead to supply Kalk if pH drops below 8.2 too low for example.
 
Last edited:
easttn said:
Depends on temp, but certianly less than +/-1V. The voltage output of this circuit is a direct feed to an EM235. It is basically an A/D converter type PLC with trim pots for calibration. This unit communicates to the CPU and in turn the PLC controls some event. Turn on a powerhead to supply Kalk if pH drops below 8.2 too low for example. Or shunt power to Ca reactor if pH clibs over 8.4.

OK, so I assume if you use the circuit in figure 1, you would be using an analog input with a voltage (bipoler) range of +/- 1V.

If using the figure 3 circuit, I assume you would want to use a lower range if possible (+/- 100mV or 250mV).

For those not using Siemens equipment:

For a DL06, the only analog input I have found that supports a bipolar voltage input in this range is the F0-04THM (same module used to measure thermocouple inputs). The F0-04THM has multiple bipolar mV input ranges, including a +/- 156mV that should work with the circuit in Figure 3. Unfortunately, the F0-04THM can't measure both a thermouple input and a voltage input at the same time...you would need 2 of them ($200 each).

For a EZPLC, I haven't found a suitable analog input module for this.

It would be nice to have a circuit that outputs a more common 4-20 mA signal. Anybody seen one?
 
Could you use a switch and decoupling cap between the two ckts? In other words, use the switch to break the ground for both pH and Temp so only one ckt is energized at any time.
 
easttn said:
Could you use a switch and decoupling cap between the two ckts? In other words, use the switch to break the ground for both pH and Temp so only one ckt is energized at any time.

I assume you're referring to the inability to run the pH and thermocouple off the same input module...I don't think that would work very well for a number of reasons...but the biggest being that the range has to be set via a memory setting in the PLC.
 
When you order pH probes, you should order low-impedance units

Are the standard probes sold with a ph meter from some place like premiumaquatics typically low or high impedence?
 
javajaws said:
OK, so I assume if you use the circuit in figure 1, you would be using an analog input with a voltage (bipoler) range of +/- 1V.

If using the figure 3 circuit, I assume you would want to use a lower range if possible (+/- 100mV or 250mV).

For those not using Siemens equipment:

For a DL06, the only analog input I have found that supports a bipolar voltage input in this range is the F0-04THM (same module used to measure thermocouple inputs). The F0-04THM has multiple bipolar mV input ranges, including a +/- 156mV that should work with the circuit in Figure 3. Unfortunately, the F0-04THM can't measure both a thermouple input and a voltage input at the same time...you would need 2 of them ($200 each).

For a EZPLC, I haven't found a suitable analog input module for this.

It would be nice to have a circuit that outputs a more common 4-20 mA signal. Anybody seen one?

The problem with using a 4-20ma signal is that on the analog inputs you have to select a type for the whole module. If you use 4-20, then this is going to make it almost impossible to use a ORP probe which is simply measured in mV's and has no conversion.

The programming is simple enough, if I have a curve for the conversion or get enough data I can create one from any input, if I have values from 4, 7, and 10 thats more than enough data to create an equation on the plc to do the conversion.
 
slug said:
Are the standard probes sold with a ph meter from some place like premiumaquatics typically low or high impedence?

Order high impedence there cheaper, these circuits will take care of the amplifying and make the signal readable by a normal voltmeter if you wanted.

JavaJaws: Your comment about not being able to use a thermo with a ph probe on the same module is incorrect. You were right that its not possible without mod's.

You could use the same ph circuit that I posted, with a few mod's to it, it could also be used for a thermocoupler. It would output the same voltage that the ph circuit would, allowing them to both be on the same module.

Easttn: By control, do you mean use the values from the ph probe to turn outputs on and off.etc. If so thats simple each input has a varible, it'd be the same type of code that I used for the Thermocoupler module.
 
Do any of the circuits posted so far offer accuracy better than +/- .1 pH? This doesn't seem like it would be accurate enough for our needs - I'd think we would need at least +/- .05 pH.

Also, do any of these circuits provide for any sort of isolation between input/output...or other such features to prevent noise problems?

Roy: Well, with "mods" anything is possible...knowing what the "mod" is IS the problem. In my industry (software) I'm always asked "Can you do so and so?". My answer is always: "Yep...it's only software...I can make it do anything!" :)

An analog input of either: 0-20 mA, 4-20 mA, 0-5 V, or 0-10V seems to be the most common (and cheapest) input modules available on both the DL06 and EZPLC. I'd still like to find a circuit (or a cheap prebuilt transmitter) that will output one of these outputs.
 
Well I'm going to attempt two circuits, .1 accuracy is fine in my opinion most handheld meters (pinpoints) are the same accuracy. Accuracy is all about how the circuit is built, if its ground and guard properly, if there is minimal to no induction into the circuit...etc

If you'd like to purchase a commercial transmitter be my guest, I'm not made of cash and can't afford $250 for a transmitter for one ph probe, I'd rather rally around $20 my cost, and deal with +/- .1 accuracy. In my opinion the circuit isn't going to flux around by .1 its going to be off by .1.

These circuits are extremely simple to build, were not even talking about double layered PCB boards for the final product. As for the thermo and the ph on the same input 0-5v's. Just sit back and look at the big picture, I think you may be looking to in-depth. Fairly soon if everyone starts using pre-made manufacture projects the cost of your controllers will surpass a commercial made project that does the same thing.

My s7 has been up and running for two weeks now doing the following.

-Monitor for leaks on the back and side glass, if the water is detected it shunts the pump and puts it into a timeout sequence. It also trips a "zone" on my home burglar alarm panel and calls the monitoring service say there is a leak on the tank.

-Monitors the sump/canopy/and main display tank temperatures. If the temp rises too high in either the display tank the halide is turned off and put into a timeout sequence. If one thermocouplers temp fluxates erratically its input is ignored in temperature decisions (it assumes itââ"šÂ¬Ã¢"žÂ¢s faulty).

-If the temp drops in the sump or tank, the heater is turned on (It has yet to have to turn on too much the mag 9 in the sump keeps the tank at a constant 80 degrees for the most part, along with the mh. When the lights turn out the heater turns on about once an hour for 5 mins it seems.

-If the temperature in the canopy rises above a certain temp, the first canopy fan is turned on; if the temp continues to rise a second fan is turned on.

-I've got push button shutoffs for every relay on the bank, if I need to turn off the MH when itââ"šÂ¬Ã¢"žÂ¢s on, I just push a 12vdc push button it sends 12vdc to an input and turns the MH off.

- Moonlights are run off an equation in the plc, depending on the day of the month, there a more or less blue leds lit.

-I have a sunrise and sunset bank of leds set on arrays that use timers and simulate sunrise and sunset.

The only things left to do are program the ph / orp code, which is simple its almost identical to the thermocoupler code.

Total Costs So Far
PLC + Modules $225
TC's $25
PH Probe $40
Materials for PH Circuit $20
Misc Relays + Elec's $25+Free
Enclosure Free

Total $335

All I'm trying to say is I intended to start this a moderate cost reef controller project, and its still possible to keep this a moderate cost project you don't have to spend tons of cash to make this possible.
 
Roy, Please don't take my comments/questions the wrong way. My priorities are different from yours and lead me to ask questions that may not be as important to you. I am not suggesting everyone run out and buy $250 transmitters (most of these questions I am asking are so I don't have to).

MY priorities are (in order): reliability, accuracy, cost. Also thrown in there in no particular order are: usability (BNC connectors for ease in replacing probes, etc.) and the general feature set of the PLC solution (this is something only time and money can provide).

Having a circuit with one of the output types I mentioned above would allow more people to undertake projects such as this without being locked in to a particular brand of PLC or having to spend tons of money. Also, I think we alll need to be aware of the limitations of any hardware/software solutions we put together...to do otherwise just doesn't same rational.
 
Blitz: This is for you, I didn't forget about you. If you need any more info, let me know

224wiringmodules.JPG


M is your negative for your dc power
L is your postive of your dc power
The green lines are your grounds, the symbol there linked too means ground.

JavaJaws: I understand your priorities, I wish there was a cheaper product that was commerical I found a company that made interfaces for plc's specifically but they never returned a phone call nor did they email me back. I'll try and find the site again, you may have better luck, the prices are not posted though.

Edit: Heres the site java, there isn't too much data on them.
http://www.bat4ph.com/bat/b20.htm
 
Thanks gabe, that will be helpful. Now i can finish up a diagram of what i need. Lookin at the analog input module it looks the the inputs will have 3 leads. What are the 3 and how do they connect to the plc(which to RA,a+,a-)?
 
Back
Top