loading

Last year I had a pool built. It was exciting when the pool builder showed me that the pool industry had moved into the technology age and now offered application control over the internet. Being a computer junkie I jumped for joy. Then the quote... $10,000 for pool automation. Let me say that again... $10,000 for pool automation. Of course that was out of the budget... but not a lost desire.

I thought, let me purchase the components and I'll do the work. Researched and looking into the major builders hardware and it alone would have cost me near $5,000. Without install.

So I made it my mission to create my custom solution.

This is a brief overview of my project. To say I'm proud is an understatement! This project has taken months in planning and learning the software side and the labor to build has been at least 60 hours with an overall hardware cost around $1,000.

It will continue to mature. Better interface. More functionality. But for now it is live.

A word of caution, many of these components use 120V and 240V AC and they are dangerous if you don't have the training. That said... here we go.

Step 1: Drafting the Hardware

Step one, plan the project. Identify inputs (what you will monitor - i.e. water temp) and outputs (pumps, valves, LEDs, etc). Create a Pin-Out drawing for reference. (A lesson learned here was the pin-outs changed to enable cleaning wiring in a later phase). Measure the components. Draft them out to determine the size of the box needed.

A quick drawing is worth its weight in gold (use thin paper :-))

Parts List (links are examples):

1) Raspberry Pi: https://www.amazon.com/CanaKit-Raspberry-Complete-...

2) Raspberry Pi Relay Board: https://www.amazon.com/Elegoo-Channel-Optocoupler-...

3) 24V AC Transformer: https://www.amazon.com/Furnace-Control-Transformer...

4) 24V AC Relay: https://www.amazon.com/White-Rodgers-90-340-Replac...

5) Power Strip (note on this: I wanted to use the USB part of this strip to save my power supply, but it caused the Pi to reboot. Assuming it is under powered): https://www.amazon.com/gp/product/B015MF60O2/ref=o...

6) Project Box: https://www.amazon.com/gp/product/B005T57DF6/ref=o...

7) Terminals for easier connections: https://www.amazon.com/gp/product/B00G9IEMJM/ref=o...

8) Valve Actuator (non-name brand - works great. Can set it at any degree of rotation with cam settings: https://www.amazon.com/gp/product/B002ZPJVV2/ref=o...

9) LevelSmart water level (this cost was not in the original writeup - but is working very well!): https://konalabs.com/levelsmart/

10) Pool Components: Installed by pool contractors. All Pentair name brand except valves - they are Jandy, and the waterfalls, they are Brillian Wonders. For details on each component click on the picture and zoom in. The model is on the component.

11) Waterfall controllers - do not purchase the ones in this photo. You need the Brilliant Wonders Smart Sync. Found it for about $139 at American Best Pool Supply...http://www.americanbestpoolsupply.com/smart-sync-l... This allows the colors to sync with the LED colors from Pentair

12) If you need to integrate to the SPA heater I can help with this brand & model. Others would require additional investigation. I plan on improving this design when I get back to working the details of this project.

Step 2: Setting Up the Raspberry Pi

Setting up the webpage was new and a bit cumbersome, but this page followed step-by-step, will lay the ground work no matter how sizable your project.

http://forums.connectedly.com/raspberry-pi-f179/ho...

Don't miss the small line about making it "mobile enabled". It makes the phone operation look more professional.

Right now, I'm going to stay high level, but will come back later to add more detail. As a general rule, enter the name of each step below followed by raspberry pi into google and with some time you will find what you need. The one that took more time to figure out was 2c, so I've added a link to "patch" webiopi to a newer version.

Sub steps:

2a: Setup Static IP

2b: Setup Remote Desktop

2c: Setup Webiopi - there is a patch required - details here: https://www.raspberrypi.org/forums/viewtopic.php?f...

2d: Setup Apache Server - ensure it loads at startup.

2e: Setup WinSCP to transfer files to the Pi from your PC

2f: Setup No-IP DNS (or other free service) - Point web request to your webpage

2g: Setup port forwarding on your router

After you have this working and you can pull up a working page on your web-browser, your creative work is still to go. Referencing the pin-out you created in step two, set your HTML and Python script names to match the pins. Then, with some planning and trial and error, setup your macros to do the work for you.

Step 3: Wiring the Raspberry Pi Relays

Installing Relay boards. Refer to your relay pinouts in step 1. Label the relays... it helps assembly greatly when you have dozens and dozens of wires in a box.

As a design criteria, I chose to have the relay boards switch 24V AC. The small relays (blue boxes in the pictures) do say they are rated for 120V and 240V, however running "main pump current" through relays this small would likely lead to excessive heat and early failure. I used the low level relays to apply 24V to large relays to switch 120V/240V.

Another important consideration. You should design your system to have everything "off" when the power is not applied to the Pi. What this means is should the Pi reboot, purposefully or power outage, you want the relays to disconnect power to all components during boot. Otherwise, you will have random components turning on when the Pi is down... Maybe not a big deal in some cases, but not desirable in any case. In designing with this in mind, all of the HTML and Python code "seems" backwards. High settings = "off", and Low settings = "On".

Watch the video attached and you can see the relays turn on and off (the red light below each blue relay) when I press the button on my smartphone.

Step 4: Designing and Building the System

As I mentioned in the introduction, working with 120V and 240V is no joke. Don't do it unless you take time to educate yourself!

Determine System Voltages: In this case, the pool industry sets that precedence for our project. It is a mix of output voltages.

1) 120v/240v - Pumps, Chlorinator, Heater, Pool Lighting Transformers

2) 24vAC - Pool valve drive motors, Pool Heater Interface Voltage, Pool LEDs

3) 12vDC - Pool waterfall LEDs.

I had a question for a wiring schematic which I wanted to reply too. Although it is possible to put one together the time investment is just too great. The best wording descriptions I can add are as follows:

1) Each component comes with their own wiring diagram. Each component has an input and an output. The inputs and outputs will be one of the 3 voltages above. Each component requires a particular input to create the correct output.

a. Raspberry Pi - 120v AC- power supply

b. Raspberry Pi - 5v DC- fed from Raspberry Pi

c. 24v Transformer - 120v AC to 240v AC input (refer to schematic provided with the transformer for wire color) - 24v AC Output

d. Control Relays - 24v AC Input to relay connectors - any output voltage to the relay connectors

e. Pool Pump (240v AC) - Chlorinator (240v AC) - Heater (240v or 120v AC) - LED Transformer (120v AC) - Waterfall Transformer (120v AC) - SPA Blower (240v or 120v AC - based on model). Switched with the control relays in step D.

In construction I used plexiglass from Lowes. Lots of sawing, drilling, measuring... you get the jest. I had to make two boxes. One for my pump room. One for my greenhouse where all of the lighting and the spa blower is located. I chose a cabinet with door to prevent prying hands from contacting high voltage.

Take your time and remember one lesson, before turning on the main power ALWAYS ohm between the source and ground to ensure there is NO DIRECT SHORT. Miss this step and you may have unexpected fireworks and burned components.

Step 5: Working With Macros

Referencing the top link in Step 2, creating macros with Python and calling them with HTML does multiple clicks with one button. This creates a set of instructions that will set each pin to the desired state. See the attached "pool setup" macro that is in the "python script" file.

Step 6: Wrapping Up... Watch the Videos

This is a fully functional replacement for some very high end consumer products. It was admittedly a massive undertaking, but in the end, fun and rewarding.

By the way - as you may notice in the videos, the time to pull up the webpage is very slow. The cause has been identified as a defective wireless router. It has been replaced and my controls are fast and have been up for over 2 weeks straight without a single minute of downtime!

When I show it to people, it blows them away! I hope it does you as well.

Good luck with your pool controls!

<p>This is great. You should enter this in the Internet of Things contest.</p>
I tried... they kicked it out for some reason... I appreciate it...
<p>Pretty cool. You could have used a arduino and Smartthings to simplify your life. No only that but then you could have used schedules &amp; home automation to turn things on/off based on if your home or not.</p>
I like the thought of making it easier! Tell me more about the scheduler? Will it work with RPi? <br><br>I will definitely look into arduino for future projects.<br><br>That said, most of the heavy lifting (learning and development) is complete. My next project... outside lighting for my house will be a breeze. <br><br>Thanks for the advice!
<p>You don't have to go with an arduino . If you are comfortable with Pi , add a new one with home assistant on it , you will need some learning but you looked like you can manage it </p><p>Home assistant is an automation open source software with great possibilities :) </p><p>Thanks for the automation tips for the pool , I was looking for this type of automation as a diy since as you said, the vendors prices are crazy </p><p><a href="https://home-assistant.io/" rel="nofollow">https://home-assistant.io/</a></p>
<p>A few comments on the topic. Since your only controlling the on/off of the devices, you only need a arduino. Arduino is really good for logic like this and RPI is more of a system if you need processing power. In this case, its not necessary.</p><p>Using Smartthings-</p><p>You can schedule things without a single bit of code. Its a native feature in their application.</p><p>You can also use it on your phone and have it detect when you arrive home and turn on/off the pool.</p><p>Using a Arduino with a zigbee shield, you can attach to the wireless (more or less) and you won't need a web server since this is all on IOT.</p><p>They also have a API interface so you will have to write the buttons and handle the actual arduino.</p><p>Personally, I did my water sprinklers for fun and used all my existing in ground system. All I had to do was convert 110 to 13v, use the 4 port relays, write the arduino code and then write the buttons.... My buddy also wrote the app to work on any platform - windows, android, apple... its pretty darn cool.</p><p>Question on the cost of materials. So no less than $5,000 for the equipment and install huh? I'm actually willing to write and design this if I can sell it for even $2500. I'll likely buy a 3D printer too for the pool case that needs to be built. I assume the $5000 was also for the water pumps...etc? This was all part of the quote? I have three buddies that have a pool and at least one getting ready to build a pool.</p>
<p>I think I read your sprinkler project. Nice.</p><p> I've heard of a commercial app for Android/ the other one that can control pool equipment that costs $1000. I assumed it came with sending/receiving logic and relays to control the existing equipment, but maybe not. I will look into this and post back (it's Sunday).</p><p>$2500 sounds like more than necessary, if you can sell enough systems.</p>
<p>I know it's too late now, but sometimes they do make this mistake. If it happens again, try submitting it again!</p>
Hi and thanks! I am just at the point of wiring up a similar project for just the spa. Couple of questions...<br><br>1. did you do a good wiring schematic for the whole system? <br>2. do you have a materials list of the electrical products that you used?<br><br>thanks for posting! great work!
<p>I added some material and wiring descriptions. Hope it helps.</p>
<p>thanks! i think i have all my items and will get going soon. will probably post on the openhab site as i intend to integrate with openhab. not sure if you have checked it out but you might find it fun to work with.</p>
<p>Would love to the see the openhab front end. That is the first time Ive seen it, but it does look nice! Look forward to your project. Let me know when you have it wrapped up!</p>
<p>Awesome IoT Pool Controller! I never thought of automating my pool. You should be very proud of this - it is not every day I see an <strong>entirely</strong> <strong>new</strong> automation project on Instructables! Nice job!</p>
<p>Thanks DylanD581!</p>

About This Instructable

8,973views

138favorites

More by thedawnsc:Web Enabled Pool Control - Raspberry Pi 
Add instructable to: