# Wireless Recycled Reef Controller

ph Sensors:

Here's the basic conversion from mV to pH. The ratio is:

6 mV = 0.1 pH

if you massage that it becomes:

mV * 60 = pH

So I expanded to include a calibration offset [mV_offset]

(mV + mV_offset) * 60 = pH

Now the mV put out by the probe are very tiny and would require a very precise meter, so we are upping the voltage using the MAX406? Amplifier. To take this into the equation we must divide the observed mV readings by the amplification factor (Ampfactor) to get back to the true mV at the probe:

(mV + mV_offset) / Ampfactor * 60 = pH

pH is also dependant upon temperature and requires a correction based on the pH & Temp observed. I obtained a table from a pH probe manufacture as follows:
 - Temperature pH Above 25º C Below 25º C Above 7 Sub Add Below 7 Add Sub
 Temperature offset at given ph/temp Temp C pH - 2 3 4 5 6 7 8 9 10 11 12 5 -.30 -.24 -.18 -.12 -.06 0 .06 .12 .18 .24 .30 15 -.15 -.12 -.09 -.06 -.03 0 .03 .06 .09 .12 .15 25 0 0 0 0 0 0 0 0 0 0 0 35 .15 .12 .09 .06 .03 0 -.03 -.06 -.09 -.12 -.15 45 .30 .24 .18 .12 .06 0 -.06 -.12 -.18 -.24 -.30 55 .45 .36 .27 .18 .09 0 -.09 -.18 -.27 -.36 -.45 65 .60 .48 .36 .24 .12 0 -.12 -.24 -.36 -.48 -.60 75 .75 .60 .45 .30 .15 0 -.15 -.30 -.45 -.60 -.75

And so base on that info I have create this code snippet to adjust the pH based on the temp of the water:
```if temp > 25
if ph > 7
ph= ph-(ph-7)*(temp-25)*.03/10
else
ph= ph+(7-ph)*(temp-25)*.03/10
fi
else
if ph > 7
ph= ph+(ph-7)*(25-temp)*.03/10
else
ph= ph-(7-ph)*(25-temp)*.03/10
fi
fi
```

Ok, that wasn't too hard, but now we have to fit it to the measurable voltage range of the DS2438. There's two inputs Vdd [2.4v-10v] and Vad [1.5v-10v]. The Vdd has a better accuracy (+-10mV vs +- 25 on the Vad) so I think we want the Vdd pin for measurement. We need to fit the mV scale to the range using the correct op-amp multiplier. I've arbitrarily set our usable pH scale to 3-11 pH. I chose this since calibration solutions come in 4, 7, 10 pH mixtures so we want those plus a little cushion. Given that the probe measures 60mV per 1 pH our observed mV range for pH 3-11 is 480mv

Our measurable range with the DS2438 on Vdd is aprox 6.25v (2.5v-10v minus 0.5v on each end for a little cushion) so to find the op-amp gain multiplier I took:

0.48 * X = 6.25
X=13

So our optimal voltage multiplier should be 13 times.

Of course there's a big caveat to all this though: pH probes reference 7pH (neutral) as 0 mV and pH readings below 7 are negative and above 7pH are positive voltage. This means we need to shift the voltage readings upwards since our 1-wire input can only read positive voltage.

I don't know enough about electronics to do this. Is it even possible to shift a voltage like that with a positive and negative scale? I need some help to get over this hurdle.

http://www.seabird.com/application_notes/AN18_1.htm Formula for ph Calculations from you voltage output also some notes on ORP

http://www.emesystems.com//OL2ph.htm A Pic Basic PH probe example and source code

Other Schematics

http://www.edn.com/index.asp?layout=article&articleid=CA250813

Most Likely Canidate for WRRC

http://bytality.com/wrrc/images/15092ph-circuit.JPG

The outputs from the MAX406? should go straight to a DS2450 1-Wire ADC?. So all we have to do is read the voltage from the DS2450's input, apply the temperature and slope formula from above to get our pH scale data.

Source for Cheap pH probes
http://www.weissresearch.com/

Page Hits: 17742