DIY continuous read network/wifi ph meter

caretak3r

Well-Known Member
So, i needed a decent ph meter and really wanted a 'smart'/network aware one. Turns out they exist but are expensive. Any decent ph meter seems to be fairly costly. So, I looked around to see what it would take to put one together. Here's a basic parts list:

computer platform (2 choices):
tp link tl wr703n - can be purchased for < $25 from china on ebay, or a little more on amazon
http://www.amazon.com/TP-LINK-TL-WR703N-Portable-802-11n-Wireless/dp/B0083Z54P0
http://www.ebay.com/sch/i.html?_sop=15&_from=R40&_sacat=0&_nkw=tp+link+703n&LH_BIN=1


raspberry pi:
http://www.mcmelectronics.com/product/83-14421
raspberry pi is not ready-to-go out of the box, you'll need an SD card, a power source, and (if desired) a wifi dongle

ph probe with bnc connector:
http://www.ebay.com/sch/i.html?_nkw=ph+probe+bnc&_sacat=0&_from=R40

ph sensor:
this will work for both (via USB):
http://www.sparkyswidgets.com/product/leophi/

this will likely work on raspberry pi but I haven't personally tested (will require working with GPIO pins):
http://www.sparkyswidgets.com/product/miniph/

[HR][/HR]So, I have both computing platforms, but use the tp link running openwrt for my ph meter. My cost for the build was:
$25 for tplink router
$30 for usb ph sensor
$20 for bnc probe
_______________
~$75

Just wanted to share that there are options out there. I can query for my PH from any machine I want to, and can even send myself SMS alerts, etc.

If desired, I could do a writeup if you guys are interested.
 

caretak3r

Well-Known Member
First - I forgot to mention you need ph buffer solution to calibrate the meter - that'll run you ~$15 for a couple of bottles.

I don't have enough time for a full writeup this morning, but to get you started check here for openwrt images and instructions for flashing the TL WR703N:
http://www.madox.net/blog/projects/tp-link-tl-wr703n/

The standard image should work out of the box (I used the usbip image because I wanted to try that out first). For the usb ph meter, you need kmod-usb-acm installed and according to the page, that standard image already has the USB ACM drivers.

Update the password for the 'root' user in the web interface and take note of what it is.

Follow these steps through stop after step 8 (this will get you connected to your home wireless network):
http://www.madox.net/blog/2013/01/04/tl-wr703n-example-project-3-wireless-3d-printing-or-2d-printing-or-just-simply-wireless-usb/

The only other thing you need is the cgi-script. You can use winscp to copy it to /www/cgi-bin/ or use putty or other terminal to ssh in and create it if you know your way around unix. Name it something with a '.lua' extension

Code:
#!/usr/bin/lua
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end

response = os.capture("cat /dev/ttyACM0 | head -n 3 | tail -n 1 | awk '{print $3}'")

print [[
Content-Type: text/plain
]]

print(response)
you'll need to set execute permissions on the file
[HR][/HR]this is dependent on the meter being in continuous read mode and you will have to calibrate it (will cover later). Anyway, you should be able to hit:
http://<ip of wr703n>/cgi-bin/<filename.lua> in your browser and get a ph reading if everything is right.
 

heckler73

Well-Known Member
Thanks for the link to the pH Sensor/Interface!
It turns out Leo used it with the Arduino, so that should make hacking easier, since that is what I use! ;)
 

contraptionated

New Member
Quick question... Anybody know why there is such a thing as pH electrode storage solution? The answer is extremely relevant to this thread...anybody?
 

caretak3r

Well-Known Member
Quick question... Anybody know why there is such a thing as pH electrode storage solution? The answer is extremely relevant to this thread...anybody?
please enlighten us - my understanding is the probe will be fine if it stays submerged but I could be wrong.
 

jimjim2609

Well-Known Member
So caretak3r, any plans of boxing this up and selling them for those not as technically advanced as yourself :idea:
 

caretak3r

Well-Known Member
please enlighten us - my understanding is the probe will be fine if it stays submerged but I could be wrong.
I checked around on the aquarium boards - probes seem to be able to last months to years, depending on whether you take the time to clean it periodically. It also will require regular calibration (maybe once a month)
 

contraptionated

New Member
As for the accuracy of probe readings in hydroponic nutrient solution when submerged for extended periods of time. The reading will be far from accurate much sooner than if the probe was submerged in an aquarium.

An aquarium (whether it be salt or fresh) does not have a comparable chemistry to make a comparative analogous relationship in regards to pH electrode maintenance frequency, when submerged indefinitely.

Here's what happened when I tried to submerge a common glass bulb electrode (which by the way is the best candidate for prolonged submersion, the isfet probes are super delicate) for over 3 days.

I was a total noob. The year was 2007. I thought to myself, hey I used a Milwaukee pH controller for Co2 administration in a planted aquarium (relatively low ppm in contrast to our fertilizer strengths) why not in an inorganic dwc auxiliary (control bucket) reservoir. I figured , depending on which way the pH tends to swing I could wire the controller and specially plumbed dosing pump to administer the pH down (it liked to swing up).

Within 5 days everything died. There was a time delay on the system to make sure pH down was not administered too fast for the pH probe/meter to keep up with the rate of dissolution into the reservoir. No matter how far the time delay gap was made the readings were always off when I compared the readings of a properly stored electrode and the indefinitely submerged electrode.

Needless to say, this was the only reason why my first grow died horribly. Try to use a proper nutrient with an ample supply of potassium and if you need pH up, do yourself a favor and order some Potassium Hydroxide. For pH down, order some 85% Phosphoric Acid and dilute either one of these to 10% strength.

Instead of needless and fatal controls. More often than not, the problem with pH control is due to 1 or a combination of any of these factors. Organic nutrients; carbonate salt pH adjusting chemicals (carbonates usually won't dissolve quick enough in comparison to the aforementioned pH adjusting chemicals; an inorganic nutrient that goes cheap on the Monopotassium Phosphate (Monopotassium Phosphate is the most expensive nutrient by far). If your nutrient is properly balanced you will only need to adjust pH in your hydro reservoir at every water change. Matter of fact, I do not bother checking pH anymore because I know my strain and everything has become consistent.

Although, I am done telling anybody how I control my res. Find out for yourself now that I gave you the proper clues. If you choose to adjust your nutrient accordingly (another hint: Follow Fatmans advice, he is in fact the nutrient messiah) a side benefit will occur (as long as you maintain a negative pressure environment). You will kill all bugs. ALL BUGS.
 

caretak3r

Well-Known Member
thanks for the detailed post contraptionated - I appreciate it. Since I have the ph setup already, I'll still give it a whirl and see if it works any better than your experience. I was never intending on auto-adjusting PH and I'm leaning toward a good drain-to-waste setup so it's not a huge deal either way.
 

contraptionated

New Member
If you're not auto-adjusting the pH I guess you could test the accuracy of the readings (of the submersed probe) by comparing it with a stored probe (probe stored in pH electrode storage solution) over the course of time. The calibrations for each electrode can be done at the same time to see if there is an adverse effect from the reservoir.
 

Roweniii

Well-Known Member
I'm a pseudo nerd with a pi laying around that I intended to make a small media player out of. I'm thinking I may be trying this! Awesome idea, too! Can't be long before this type of hardware becomes common place with automated homes these days. If it were me I'd consider a Kick Start for something like. OP could make some mulah! :)
 
Top