Become a TFP Supporter Pool Math Forum Rules Pool School
Results 1 to 18 of 18

Thread: DIY automation build

  1. Back To Top    #1
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    DIY automation build

    And, so begins the build of my automation system. Intended features:

    • Valve control for intake, returns, sweep, and solar.
    • Pump control of the 4 programmable speed presets.
    • Solar temperature controller
    • Heater control and temperature modulation.
    • Mobile friendly web-enabled control w/manual overrides (ala, kick on spa for 45 minutes at 100˚).
    • Salt-water generator run-time control through FC sample data input.
    • PH control via acid pump controlled through PH sample data input.
    • Water chemistry history record and at-a-glance problem identification.
    • Filter pressure monitoring to identify back-flushing time.
    • Lighting control


    This will be based off a Raspberry PI (happens to be an older Rev 2 version). It has plenty of GPIO handle this. Best of all, it can easily be a web-server, run a database back-end, and can be programmed through just about whatever programming language you want. This will be a mix of PHP for the web-interface, python for the guts of the logical control. Sample history, temperature data, and run states will be stored in mysql database.

    I know I'm not the first to do this. But, I haven't seen a DIY job that ties all this together in an moderately easy to use open source package (am I missing it?). I will share full code and want to streamline the setup for any others that want to duplicate this.

    Let's get started. A quick floor plan layout of the hardware in the enclosure.


    The major parts list:


    Excluding the valve actuators, the hardware for this is quite simple and cheep.

    I'm choosing not to automate the sensing (ala, ORP + PH). It's certainly technically feasible, but, seems more trouble than it's worth from a cost/benefit/maintenance standpoint.

    This will be a phased approach. First part is basic pump control, chlorination, valves, and heater. Second phase will be the web-UI. Pressure monitoring will happen later. Solar control once I have solar panels installed to bother with. Acid injection when I get tired of pouring acid in
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  2. Back To Top    #2
    Isaac-1's Avatar
    Join Date
    May 2010
    Location
    SW Louisiana
    Posts
    6,709

    Re: DIY automation build

    Sounds interesting, do keep us posted on how this develops, I am wondering if you have a plan for sealing the Dallas Semi 1-wire serial temperature sensors against moisture, as I recall they can be effected by physical strain on the packaging, so mounting them in a blob of epoxy is out.
    Indoor 20x40 35,000 gallon vinyl pool with 1.5 HP 2 speed Jandy FloPro pump, Hayward EC75 Perflex DE filter, 11 4x12 Techno-Solis solar panels w/ Aquasolar controller, Aquabot Turbo T Robot Cleaner. Also LMI metering chlorine dispenser pump and HotSpring Jetsetter
    I use and endorse TFtestKits TF-100 from http://tftestkits.net
    ~Remember TFP counts on your donations to keep this site ad free~

  3. Back To Top    #3
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    I have 3 that I epoxy blobbed several years ago and they have since been in service outdoors. Still work great and appear to have held accuracy just fine (although I haven't checked calibration since they were deployed).

    For measuring the pool temps, they'll be inside a thermowell, so, I don't need them to be submersible.
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  4. Back To Top    #4
    Isaac-1's Avatar
    Join Date
    May 2010
    Location
    SW Louisiana
    Posts
    6,709

    Re: DIY automation build

    After posting that I went and did some digging, it appears that the earlier designs of the Dallas Semi temperature sensor (up until about 2001) suffered from a design flaw that caused mechanical pressure on the housing to translate to a change in temperature, the later ones used a self compensating design which greatly lowered this effect.
    Indoor 20x40 35,000 gallon vinyl pool with 1.5 HP 2 speed Jandy FloPro pump, Hayward EC75 Perflex DE filter, 11 4x12 Techno-Solis solar panels w/ Aquasolar controller, Aquabot Turbo T Robot Cleaner. Also LMI metering chlorine dispenser pump and HotSpring Jetsetter
    I use and endorse TFtestKits TF-100 from http://tftestkits.net
    ~Remember TFP counts on your donations to keep this site ad free~

  5. Back To Top    #5
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    I'm a bit annoyed at the relay board. At a glance, it has all the right features: opto-isolation, buffered drivers for the relays, and indicating LED's for on/off status. With all that, I figured they must have wired it together intelligently w/ solid principles and flexible input voltages.

    Sadly, they force 5V down your throat by hard-wiring the opto-isolators to an on board 5V supply (LDO driven from 12V input). The Pi is a 3.3 volt device. It's bad form to force the clamping diodes on the Pi's IO buffer to absorb the over-voltage from directly wiring the GPIO to this relay input.

    But, the real kicker is that the input to the relay board is inverse logic -- hold the pin to ground to energize the relay. Since the Pi's GPIO defaults to hi-impedance input at boot up, this isn't such a big deal. However, the default state of the output is '0'. Since I don't want to glitch the output from low-to-high when transitioning to output mode, I'm going the extra mile an using an inverting buffer circuit to drive the relay board. If the relay board had been designed better, this would be completely unnecessary. Ohh well, I have it now...



    For the electronically less-inclined, the NPN transistor (Q1) passes current when the base (middle connection) is at a "high" voltage. When Q1 passes current, that lights the LED inside the opto-isolator (U1), which then energizes the rest of the relay circuit. Resistor R2 is needed to hold the transistor base at low voltage while the Pi's GPIO is in high-impedance input mode (ala, when the Pi is off, or booting up). R3 limits the source current from the Pi to <1mA (its rated for 20mA, so, this is very conservative).

    Tonight, I'll do a quick breadboard sanity check, just to be sure.

    Then, I'll make up a connecting board to bridge between the Pi and the relay board. It'll have 16 copies of the above. The board will have the added benefit of giving me a place to mount the I2C analog-to-digial converter for the pressure transducer, as well as some 1-wire interface headers.
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  6. Back To Top    #6

    Join Date
    Jul 2011
    Location
    Las Vegas, NV
    Posts
    45

    Re: DIY automation build

    I thought about doing something similar, so definitely keeping an eye on this. Are you worried about operating temperature at all on the Pi? I know you have much milder weather than I do in the desert, but in an enclosed box it's always a concern

  7. Back To Top    #7
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    I've had this Pi in a much small sealed box, outside in partial sun for the last 2 years -- hasn't been a problem. I will admit, now that I have all new pump pad equipment, I plan to put a roof over it all to keep the sun and weather off.
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  8. Back To Top    #8

    Join Date
    May 2016
    Location
    Troy IL
    Posts
    428

    Re: DIY automation build

    I too have had something like this on my to do list since we bought our house a year ago. I'll be watching this thread for motivation now doubt.

    17,500 gallon IG Vinyl
    Pentair Tagelus TA60D Sand filter
    Pentair Challenger 1.5HP pump CFII N1 1.5A
    Taylor K-2006-A, Stenner 45MPHP10 auto chlorine feed

  9. Back To Top    #9
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    Bread-boarding was completely successful. Now just need my parts order to arrive to build out the bridge board.

    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  10. Back To Top    #10

    Join Date
    Oct 2016
    Location
    Perth/Australia
    Posts
    1

    Re: DIY automation build

    This looks like a great project, can't wait till you get to the python and php code. I've just installed something similar on my pool and started blogging about it. Looking forward to seeing this all come together.

  11. Back To Top    #11
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    Ya remember this project? Yeah, I hardly do either

    Quite a few moons ago, I hand-wired a board with 16 copies of the above circuit, and actually had it all working! Alas, as I was taking things apart after that test, an alligator clip got away from me and shorted something out which fried my older model Raspberry Pi. The older Pi has a different pin-out than the newer ones. Yeah, I probably could have found and purchased and older Pi to match, but, I really wasn't happy with how the hand-wired bridge board looked. For a host of other reason, I just decided to spin my own PCB:


    ~$30 later, I have a stack of a dozen boards sitting on my desk. Going to try to build one out in the nearish future and get this project going again...
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  12. Back To Top    #12
    JoyfulNoise's Avatar
    Join Date
    May 2015
    Location
    Tucson, AZ
    Posts
    8,758

    Re: DIY automation build

    Too bad you don't have a pick & place tool as well as a reflow furnace...makes building a board so much faster!! Nice board design!

    Good luck.


    Matt
    16k IG PebbleTec pool, 650gal spa, spillway and waterfall, 3HP IntelliFlo VS / 1.5HP WhisperFlo, Pentair QuadDE-100 filter, IC40 SWCG, MasterTemp 400k BTU/hr NG heater, KreepyKrauly suction-side cleaner Dolphin S300i robot, EasyTouch controls, city water, K-1001, K-2006 and K-1766 test kits, Mannitol test for borates

  13. Back To Top    #13
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    It's not a big deal to do by hand -- except for the I2C A-D converter, it's mostly 0805 packages, which are quite easy to place by hand. Cut a solder mask on the vinyl cutter, place the parts, and reflow it on a hot plate. Easy peasy for a couple of boards
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  14. Back To Top    #14
    JoyfulNoise's Avatar
    Join Date
    May 2015
    Location
    Tucson, AZ
    Posts
    8,758

    Re: DIY automation build

    Careful, don't make it sound too easy or else you'll start getting orders
    Matt
    16k IG PebbleTec pool, 650gal spa, spillway and waterfall, 3HP IntelliFlo VS / 1.5HP WhisperFlo, Pentair QuadDE-100 filter, IC40 SWCG, MasterTemp 400k BTU/hr NG heater, KreepyKrauly suction-side cleaner Dolphin S300i robot, EasyTouch controls, city water, K-1001, K-2006 and K-1766 test kits, Mannitol test for borates

  15. Back To Top    #15

    Join Date
    Mar 2008
    Location
    Los Angeles, Ca
    Posts
    190

    Re: DIY automation build

    By coincidence, I just decided I want to add some DIY automation to my pool and spa. They have completely separate pump/heater/control systems, so would be pretty costly to buy an off the shelf system for both.

    Probably going to tackle spa first.

    Wondering if you ever shared your code?

    Might be interested in a bare PCB too, if you want to sell one.

    Really want to tie into my existing domoticz system, will be looking into that too.

    Randy
    25,000 gal fiberglass pool, Raypak 200k BTU H200FDN gas heater, Pentair CCP520 520 sq ft Cart filter, Max-Flo VS2303VSP pump. iWave wireless remote,

    seperate spa, with own pump, cartridge filter, Hayward H200FDN heater

  16. Back To Top    #16
    foobert's Avatar
    Join Date
    Jul 2013
    Location
    Bay Area, CA
    Posts
    139

    Re: DIY automation build

    I don't have any code to share yet, but, it will one day be posted when it's in a state that is self contained enough to make sense of. Once I have validated the PCB, yes, I'd be happy to get rid of the extras
    ~john
    24.5K G, pebble, SuperFlo VS 1.5, 48sq DE filter, Hayward H250FDN, Autopilot RC-52, Poolvergnuegen & 3 daily swimmers in season.

  17. Back To Top    #17

    Join Date
    Nov 2016
    Location
    Orlando, FL
    Posts
    3

    Re: DIY automation build

    I did something similar here, maybe some of the code will be helpful to you. Particle now supports the RPi, so you'd be able to use the webhook stuff I used as well.

    GitHub - Here-Be-Dragons/Pool-Controller: Cloud-based pump speed, solar collector controls, and temperature monitoring for your pool

  18. Back To Top    #18

    Join Date
    May 2012
    Location
    Toronto, ON
    Posts
    409

    Re: DIY automation build

    Let us know how this turns out. You might want to even change the computer to a Pi -Zero W as they are cheaper and sufficient CPU wise as they are about the same speed as the original RPi that you started with.

    I started a similar project a few years ago that I called PoolPi. My plan was to have a floating pool monitoring computer in my pool sealed in a tupperware-like container. It would have a solar panel on the top to charge batteries to power the pi. The pool water should also help to moderate the temperatures. I had a temperature sensor and was hoping to use a pH sensor as well - but those are expensive. I was also going to add a motion sensor so this could work as a pool occupancy alarm. And I was also thinking about putting a Pi camera in it so that I could get a live video feed, or at least snapshots, of my pool (live video would such too much power). V1 got shorted out by my salty pool water but I hope to get back to this in the future.
    Vinyl 18'x36' in-ground 100,000 L, Jandy Aquapure 1400 SWCG, Jandy Lite2 heater, StaRite System3 filter, Evac tube solar heating panels

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •