Foobert's bleach pump automation

foobert

0
LifeTime Supporter
Jul 19, 2013
142
Bay Area, CA
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.


[center:jj7pc718]Industrial Bleach
DSC_4399-20130801.jpg

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
DSC_4377-20130714.jpg

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
DSC_4379-20130714.jpg

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
gpio.png
[/center:jj7pc718]


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
DSC_4397-20130728.jpg

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.
 
Topher -- ping me if you have any questions. I found it to be a fun project. Don't skimp on the pump -- the little cheepy units found ubiquitously at DIY electronics places are utter junk:
crappy_pump.jpg


The copy I had with failed to move the rollers after a mere 45 minutes of total usage.
 
Foobert,

Very impressive... makes my pool light app look like child's-play. Question: does the RB measure the chlorine levels in the pool and add the appropriate amount, or is it just programmed to put a pre-determined quantity into the pool on a recurring basis?

Kevin
 
kodiak1120 said:
Question: does the RB measure the chlorine levels in the pool and add the appropriate amount, or is it just programmed to put a pre-determined quantity into the pool on a recurring basis?
Kevin

Thanks for the kind words.

It's a closed-loop feedback control system. I periodically take manual measurements and enter the results through the web interface to update the history database. Then, the automation takes over from there to compute the necessary dosing and apply it as needed. Once the system is stabilized, I'm pretty sure I'll be able to walk away from it for a week's time without worries of coming back to a green pool.

I've thought about using an ORP/PH sensor to close the loop automatically. However, I'm not convinced that the hassle of calibrating and maintaning the ORP sensor is any less work than just taking a manual FC measurement every few days. From my understanding, there are also some vagaries of the ORP reading that requires "learning" before the result can be trusted. Considering it takes 2 minutes to do the FAS/DPD test and PH and there is always something else to do with the pool (check the skimmers, check for critters, skim the leaf crop off, etc), one can never truly just be completely hands off.

I plumbed the output of the bleach pump into the suction side of the pool circulation pump (for better or worse). It has the advantage of putting less stress on the bleach pump but the disadvantage of running the higher-strength oxidizer through the pump/filter and some additional valving. I'm not terribly worried about the later. At full speed, the bleach pump injects about 3.5 oz/minute. If my pool circulation pump moves 60 gallons/minute, that's an equivalent FC concentration of ~30ppm flowing through the plumbing. I could easily slow down the injection rate if I really wanted to.
 
foobert said:
kodiak1120 said:
Question: does the RB measure the chlorine levels in the pool and add the appropriate amount, or is it just programmed to put a pre-determined quantity into the pool on a recurring basis?
Kevin

Thanks for the kind words.

It's a closed-loop feedback control system. I periodically take manual measurements and enter the results through the web interface to update the history database. Then, the automation takes over from there to compute the necessary dosing and apply it as needed. Once the system is stabilized, I'm pretty sure I'll be able to walk away from it for a week's time without worries of coming back to a green pool.

I've thought about using an ORP/PH sensor to close the loop automatically. However, I'm not convinced that the hassle of calibrating and maintaning the ORP sensor is any less work than just taking a manual FC measurement every few days. From my understanding, there are also some vagaries of the ORP reading that requires "learning" before the result can be trusted. Considering it takes 2 minutes to do the FAS/DPD test and PH and there is always something else to do with the pool (check the skimmers, check for critters, skim the leaf crop off, etc), one can never truly just be completely hands off.

I plumbed the output of the bleach pump into the suction side of the pool circulation pump (for better or worse). It has the advantage of putting less stress on the bleach pump but the disadvantage of running the higher-strength oxidizer through the pump/filter and some additional valving. I'm not terribly worried about the later. At full speed, the bleach pump injects about 3.5 oz/minute. If my pool circulation pump moves 60 gallons/minute, that's an equivalent FC concentration of ~30ppm flowing through the plumbing. I could easily slow down the injection rate if I really wanted to.

Nicely done... Once you manually put in your results, I'm assuming you have some sort of algorithm that tells the system how much to put in, how much will be lost overtime due to sunlight, and therefore how much it needs to add each day to keep up the recommended amount? Is that basically how it works?

I'd love to do something like this too, but it's probably a little over my head and I really don't have the time right now. Maybe when I retire... in 40 years. :hammer:

Kevin
 
RIRSZ said:
Man, that is very cool! I've eyeing the pi for a few months now, but my wife will kill me if I bring home a new hobby!

The Raspberry Pi is actually a great hobby device because it's cheap to buy and cheap to play with... most components that you need for a project only cost a few dollars and since you're using Linux, everything is open-source.
 

Enjoying this content?

Support TFP with a donation.

Give Support
Another (simpler) approach: take a pool cover pump, hook it up to a wifi enabled powerstrip, put one end of the pool cover filter intake into the chlorine carboy, the other into the pool.

Or...

Get an automatic timer that merely runs said pump a few minutes a day, whatever is needed.

Although pool grade chlorine might wear out the pump fast, lol.

Still, it's an awesome idea, Foobert.
 
This looks really interesting, Foobert. I can only dream that I'd have enough time to do one of these myself. I'd like to try this out to regulate the pH and ORP of our pool, though being able to directly measure free and total chlorine would be nice (but expensive with existing probes). How does this interface with the pool main pump?
 
kodiak1120 said:
RIRSZ said:
Man, that is very cool! I've eyeing the pi for a few months now, but my wife will kill me if I bring home a new hobby!

The Raspberry Pi is actually a great hobby device because it's cheap to buy and cheap to play with... most components that you need for a project only cost a few dollars and since you're using Linux, everything is open-source.

Yeah it's cheaper than most of the PLC's and smart relays I see online, plus because it's a modern OS, the software is much more powerful.
 
Wow, a sudden burst of activity -- thanks for the comments. :-D

I'll try to answer some questions. Hope I got them all:

kodiak1120 said:
Once you manually put in your results, I'm assuming you have some sort of algorithm that tells the system how much to put in, how much will be lost overtime due to sunlight, and therefore how much it needs to add each day to keep up the recommended amount? Is that basically how it works?
Yup, that's perty much the algorithm!

weird_tolkienish_f said:
Hmmm... what about something like this? http://www2.emersonprocess.com/en-US/br ... index.aspx To fine tune it even more?
That'd be the ideal feedback solution, but, I see lots of dollar signs there when it's designed for water treatment plant applications :lol:

In all seriousness, if a reliable FC sensor can purchased for <$100, that doesn't suffer the vagaries of ORP, and can go several months between calibrations -- I'm all ears! :whoot:

Hawk said:
Can you provide any other info on getting/setting to buy from Hill Brothers? Is the carboy delivered to you by truck or do you pick up? Cost for 15 gallons?
Call the order desk and ask to setup a "COD account" (cash on delivery). They'll ask what company you are with; just say you are an individual. They DO handle end-user sales (i.e. collect sales tax), so, you don't need a business tax-id or any such stuff. But keep in mind, it's not a retail store. They are setup to handle commercial accounts, so, the process may seem a little awkward.

I do my own pickup at the local warehouse, which happens to be very conveniently located in my case. Once you have an account, you'll need to call ahead to the order desk to place your order and have it ready for pickup at will call. They will deliver, but the "fuel surcharge" is about as much as the bleach. I'm paying $3.95/gal, which works out to be $0.247/oz NaOCl -- a middle-of-the-road price. You can certainly find cheaper sources if you are willing to hunt around for sales on consumer grade bleach. The carboy is a $25, refundable deposit.

They also sell 31% HCl (muriatic acid) in 4x1gallon cartons. It's $8/gal, same as my local Home Despot.

CraigMW said:
How does this interface with the pool main pump?
The simplest way would be to purchase a double-pole, double-throw relay with contacts sufficiently (over) rated to handle the current of the main pump motor. Use the 12V output from the circuit I showed to energize the relay input of the high-current DPDT relay. With the Pi, you no longer need to have a timer to control your pump, since the Pi has far more capabilities for programming schedules than any commercially available timer solution.

That said, since I already had a digital timer box (the tan box to the right of the right of the Pi box), I reverse engineered the circuit in that. Thus, I used the 12V relay to close that circuit and energize my existing timer's relay circuit.
 
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.