{"id":56,"date":"2012-05-04T12:57:24","date_gmt":"2012-05-04T12:57:24","guid":{"rendered":"https:\/\/www2.harwoodfamily.id.au\/index.php\/2012\/05\/04\/hardware-ph-monitoring\/"},"modified":"2020-05-06T05:17:41","modified_gmt":"2020-05-06T05:17:41","slug":"hardware-ph-monitoring","status":"publish","type":"post","link":"https:\/\/www.harwoodfamily.au\/index.php\/2012\/05\/04\/hardware-ph-monitoring\/","title":{"rendered":"Hardware pH Monitoring"},"content":{"rendered":"<p>pH Monitoring<\/p>\n<table class=\"contentpaneopen\">\n<tbody>\n<tr>\n<td valign=\"top\">\n<p>I would like to automate pH control of my swimming pool, but it has proven to be a much more complex task than I had imagined.<\/p>\n<p>My pool has an electrolytic chlorine generator. The pool contains salt, and the chlorinator generates Chlorine by electrolysis. In many ways this is an ideal way to sanitise a pool, but the chlorinator causes the pH to rise, which requires the regular addition of acid to bring the pH back within acceptable limits. In theory it should be easy enough to automate this. But it&#8217;s not as easy as you might think.<\/p>\n<p>I once bought and installed a commercial pH controller. On the first night it was installed, it pumped an entire 5 litre container of acid into the pool. There was no way to investigate what had happened, and the instructions did not explain the algorithm being used. I never gave it a second chance, it simply wasn&#8217;t up to the job at all.<\/p>\n<p>With a system that can automatically pump acid into a swimming pool, there is no room for error. It must be easy to see what is happening and why, and ideally there should be a detailed log of everything that happens. There must be safeguards, such as a maximum amount of acid to add in any given time period, and the system should be able to summon human intervention if the pH goes outside some preset limits. I&#8217;m not even sure I can trust a peristaltic pump at all &#8211; what if the computer controlling it crashes while the pump is running? For me, automatic control is a long way off.<\/p>\n<p>The first step is the pH sensing system. I&#8217;m using a standard pH probe mounted in the pool filtration plumbing. Previous experiments showed that fast moving water does not give accurate readings, so my pH sensor is mounted in a short dead-end branch teed off the main flow, like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-53\" src=\"https:\/\/www2.harwoodfamily.id.au\/wp-content\/uploads\/2012\/05\/images_felix_phprobemounting01.jpg\" border=\"0\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_phprobemounting01.jpg 400w, https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_phprobemounting01-300x225.jpg 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>In theory, building a pH interface should be easy, but I tried a couple of home-made interfaces and stability was a problem. Dealing with a high impedance device like a pH probe requires some very careful circuit construction and I finally gave up on building my own. Eventually, I found the perfect interface adaptor at <a href=\"http:\/\/www.phidgets.com\/products.php?product_id=1130\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"text-decoration: underline;\"><span style=\"color: #0066cc;\">Phidgets<\/span><\/span><\/a>. It takes a standard pH sensor with a BNC connector, a 5v supply, and provides an analog output of 0 &#8211; 5v, which is the perfect input for a DS2450 one-wire analog to digital converter. No other components are required. Here&#8217;s the Phidgets pH adaptor with my DS2450 mounted on a piece of strip-board.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-54\" src=\"https:\/\/www2.harwoodfamily.id.au\/wp-content\/uploads\/2012\/05\/images_felix_ph_adaptor.jpg\" border=\"0\" alt=\" \" title=\" \" width=\"696\" height=\"405\" srcset=\"https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_ph_adaptor.jpg 696w, https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_ph_adaptor-300x175.jpg 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/p>\n<p>The interface itself works very well indeed. I calibrate it using two reference solutions and a simple linear calibration formula.<\/p>\n<p>Calibration using two reference solutions of known pH provides two reference voltages:<\/p>\n<p> V1 = pH1<br \/> V2 = pH2<\/p>\n<p>Once these calibration values are known, the pH of any unknown liquid can be calculated using the following formula:<\/p>\n<p> pH = ((Raw_value &#8211; V1) * (pH2 &#8211; pH1) \/ (V2 &#8211; V1)) + pH1<\/p>\n<p>My Felix software does this rather effortlessly. You can see live data <a href=\"live-data\/pool-ph.html\"><span style=\"text-decoration: underline;\"><span style=\"color: #0066cc;\">here<\/span><\/span><\/a>, but only in the summer and only if everything is working. Here&#8217;s a typical day:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-55\" src=\"https:\/\/www2.harwoodfamily.id.au\/wp-content\/uploads\/2012\/05\/images_felix_pH_may_2010.png\" border=\"0\" alt=\" \" title=\" \" width=\"550\" height=\"250\" srcset=\"https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_pH_may_2010.png 550w, https:\/\/www.harwoodfamily.au\/wp-content\/uploads\/2012\/05\/images_felix_pH_may_2010-300x136.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p>When the filtration pump runs, so does the chlorinator, and the charge it applies to the water obviously affects the pH sensor. The chlorinator reverses its polarity every time it starts, hence the sensor is affected the opposite way on each cycle.<\/p>\n<p>Finally, I can now see why that commercial pH controller pumped an entire 5 litre container of acid into the pool on the first night it was installed.<\/p>\n<p>One possible fix for this could be to plumb in a small-bore tee off the main flow, through earthed metal tube, to a chamber housing the pH sensor, returning to the main flow via another earthed metal tube.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>pH Monitoring I would like to automate pH control of my swimming pool, but it has proven to be a much more complex task than I had imagined. My pool has an electrolytic chlorine generator. The pool contains salt, and the chlorinator generates Chlorine by electrolysis. In many ways this is an ideal way to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":53,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-felix"],"_links":{"self":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":1,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions\/92"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/media\/53"}],"wp:attachment":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}