After a year of dumping various sorts of chlorine into the pool, I finally got all the bits and pieces together to automate the chlorine addition process. The key element that pushed me over the hump was learning I could open a COD account at Hill Brothers Chemical to buy commercial sized quantities of 12.5% bleach at a reasonable price. The 15 gallon, reusable carboy is a perfect size -- enough to last me about ~3 months without any packaging waste to deal with.
Nikon D600, ISO 5000, ƒ/3.5, 1/50sec, 42mm focal L.[/center:jj7pc718]
The next part was the positive displacement pump to move the bleach with. I found a Watson-Marlow OEM peristaltic pump on eBay. It runs with simple 12V DC and pumps a quart in a little over 9 minutes.
[center:jj7pc718]Watson-Marlow Pump -- Model 102FD/R for OEM applications
Nikon D600, ISO 2000, ƒ/2.8, 1/50sec, 38mm focal L.[/center:jj7pc718]
For the design, I wanted to have a web-enabled interface to allow me to control it from any browser on my network. And, I wasn't going to drag a network cable out to the pump equipment, thus, it needed to be WIFI enabled. The Raspberry Pi is the perfect solution: runs on linux; has USB port(s) to plug a cheep wifi dongle into; runs on 5V power from almost any USB phone charger; $30 including WIFI dongle.
[center:jj7pc718]Raspberry Pi -- with a 5V regulator, and a few relays to control stuff
Nikon D600, ISO 800, ƒ/4.5, 1/50sec, 27mm focal L.[/center:jj7pc718]
The rPi has quite few GPIO that can used as 3.3V LVTTL output signals. I put together a few relay circuits: 1 to turn on the peristaltic pump, and 1 to kick on the main pool circulation pump.
[center:jj7pc718]GPIO to relay
It's all mounted into an outdoor rated box that keeps the weather out. The output of the chemical pump is plumbed into the intake side of the main pool circulation plumbing.
[center:jj7pc718]The final install
Nikon D600, ISO 180, ƒ/4.5, 1/50sec, 26mm focal L.[/center:jj7pc718]
On the software side, a simple PHP web interface front-ends a MYSQL database to keep a history of all measurements made. Knowing the size of the pool, the past chlorine inputs, and the subsequent measurements taken, it's a straightforward calculation to figure how much bleach to inject to maintain the appropriate concentration. Everyday after the sun goes down, the Pi kicks on the main circulation pump, meters out the bleach, and then circulates the water long enough to circulate it thought out the pool. Although the software can all run stand-alone on the rPi, the database and web-interface lives on my main web server.
As an added bonus, the system reminds me when it's time to take the various measurements -- as the old measurements go stale, the colored box fades to gray showing that it's about time to retest that portion of chemistry.
Also, the Raspberry Pi also trivially interfaces to Dallas/Maxim 1-wire sensors to measure temperatures.
If you want to attempt do duplicate this effort, I'm willing to share many more details, but, I will forewarn that the SW is a real hack that was hastily written without any mind to be easily transported to another situation.