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

Thread: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

  1. Back To Top    #1
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Hey Everyone -

    I thought I would share some information about a project that I have been working on with our pool here. Basically I have designed an automatic pool fill system that monitors the level of our pool and then fills it automatically when needed, but based on some very specific criteria.

    I know what you are thinking...why not just by a little float thing and have it fill that way...well we had one of those and it broke in such a way that we would have to tear up the existing system where it was mounted (in cement) in order to replace the part that had broke. Since we have a bunch of monitoring and automation within our home already, I decided to automate this process as well.

    The project is broken into two parts: monitoring the level, and filling the pool.

    The first part uses a product called eTape from milonetech.com. It is a resistive based liquid level sensor. This is connected to a little Moteino (lowpowerlab.com) microcontroller (~$20) and two AA batteries. The Moteino is an Arduino clone. The Moteino gets the level of the pool and transmits it via 433Mhz to a database once per minute. At this rate, the batteries will last about two years.

    The second part utilizes a Raspberry Pi 3 ($35), a microUPS and battery backup unit called MightyBoost (~$20) (lowpowerlab.com) which provides the Pi with another microcontroller, a 4400mAh battery for power backup (about ~3 hours) and another 433Mhz radio (~$7) for transmitting sensor data. I have two weatherproof buttons on the Pi, one to boot/reboot and powerup the Pi and the other to handle manual filling of the pool if needed.


    I have written the control software for the Moteino using the Arduino IDE and the control software for the Pi in Python.



    The basic premise of the system was if the pool falls below a certain level, the Pi will open a sprinkler valve to fill the pool. Since in AZ we are required to have vacuum breakers on all irrigation connections, I choose to add an additional sprinkler valve to my irrigation system. This valve is connected to a relay on the Pi and when the software tells the valve to open, the relay fires and operates a 24VAC sprinkler valve. This valve is connected to my pool plumbing on the output side and so includes a backfill valve to prevent pressure from the pool pump heading back to the irrigation system.

    Because I am running this from my irrigation system, I wanted to make sure that the pool would not attempt to fill while my sprinklers were running. Within the python script, I check for this in one of two ways. First, I have a generic "blackout' period where you simply set the times your sprinklers are running and we won't fill the pool during that time. The second was is via an API call to my Rachio sprinkler system. This call tells me if the sprinklers are currently running or not.

    Second, I wanted to make sure that the pool would not attempt to fill if my pool pump were running as I do not want to try and fill against the pressure form my pool pump. I manage this by monitoring the power utilization on the circuit going to my pool panel. If I am using more than 30 watts, I know my pool pump is running as my monitoring and autopilot system consume only 12 watts of power. Anything over that means my pump is running and we should not fill the pool. If I want to prevent the system from running for any other reason, I have a toggle switch that shuts off connectivity from the relay to the sprinkler valve, or I can ssh into my Pi and shut down the software. I wanted at least one hardwired interrupt to the process in case the software went bonkers!

    In the event that I want to manually fill my pool, I have another momentary push button with a nice LED that allows me to fill my pool by just pushing the button. It checks to see if the pool is already filling or if the pool pump is running before it will allow a manual fill.

    In order to prevent an overfill, I have a timer built into the script that monitors the fill time and will force shutoff the valve if you go over whatever you set your max runtime to in the settings. For example, I know my pool will take about 1.5 hours to go from low to where I like it, but it would take about 6 hours to overfill, so I set my timeout to 180 minutes. It will be more full than normal, but not overfull.

    Due to the nature of the manual fill button, this will run until you shut it off regardless of the pool level or pool fill timer!!!

    I use pushbullet (free) for all of my notifications (which can be toggled on or off in the settings) and use Python's builtin logging for tracking what the system is doing.

    I have attached a screen shot of everything that I am using, I am just waiting for my NEMA3R enclosure to arrive to get it all mounted.

    If anyone is interested in the actual code I have attached everything to this post including the Arduino sketch and the full python code. Both are documented pretty well.

    I will post more pictures once I have it fully mounted.

    Cheeers
    Attached Images Attached Images
    Attached Files Attached Files
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  2. Back To Top    #2


    TFP Guide

    cowboycasey's Avatar
    Join Date
    Jul 2013
    Location
    Fletcher, OK
    Posts
    3,346

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    That is awesome, I really wish I knew more about all this.. looks fun
    Pool: Intex 16x32 15000 gal, 2 speed 340042, Pentair CC320 Filter, CircuPool SJ45 Salt System, Intermatic PE653RC; Hot Tub: 650 Gal SWG Megachlor
    links: pool school * Recommended-Levels * SLAM * CYA chart * Test kits * How To Post Pictures * Poolmath * OCLT ** Support your website if we helped you :) **

  3. Back To Top    #3
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Thanks...it is a lot of fun to work on, that is for sure....screen 2016-05-30 at 1.52.15 PM.jpg
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  4. Back To Top    #4

    Join Date
    May 2016
    Location
    Tallahassee
    Posts
    71

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    There is a system that currently does this by Konalabs called LevelSmart.... I have it in my pool and the thing works extremely well.....

    LevelSmart Wireless Swimming Pool Auto-Fill by Kona Labs

    Amazon.com : LevelSmart(tm) Wireless Level Control: Automatically Fills: Save Time - Save Water - Save $$$ : Patio, Lawn Garden

  5. Back To Top    #5

    Join Date
    Aug 2014
    Location
    Near Montgomery, AL
    Posts
    20

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Thanks for posting your project, that's a great idea. I use a Raspberry Pi based system to schedule my pool pumps and monitor the pool temperature. I've never seen the eTape sensor before, now that I have, I may consider adding water level monitoring.
    11,500 gallon 14x28 IG vinyl pool, 3/4 HP FloPro Pump, CS200 cartridge filter, Polaris 280 with booster pump. Testing with Taylor K-2600 test kit and adding liquid chlorine with a Beta DR-2000 peristaltic pump.

  6. Back To Top    #6
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    The eTape is pretty cool stuff and works like a charm. I needed a custom size and they made it for me and had it to me in less than a week. Neat stuff.

    What pump are you running? I have the variable speed pentair and I would love to figure out how to control it myself as opposed to having to walk out to the little interface that is on it.




    Quote Originally Posted by tmobileguy View Post
    There is a system that currently does this by Konalabs called LevelSmart.... I have it in my pool and the thing works extremely well.....

    LevelSmart Wireless Swimming Pool Auto-Fill by Kona Labs

    Amazon.com : LevelSmart(tm) Wireless Level Control: Automatically Fills: Save Time - Save Water - Save $$$ : Patio, Lawn Garden

    I saw this system (and a couple of others like it) but none of them really integrated things like pool pump monitoring, overfill alerting, sprinkler monitoring (since I use my sprinkler system) and manual fill control. Plus I think I have about $200.00 total tied up in my system...a lot cheaper than $600! Since I love to tinker, this was a great project for me!



    =-=-=-=-=-=-=-


    Version 2.4 of my software, schematics and code (and some pictures) are now up on github:

    GitHub - rjsears/Pool_Fill_Control: Raspberry Pi / Arduino / Python Project to automate filling of swimming pool.


    Added 5 system status LEDs, updated logging, added a bunch more debug logging (if needed).
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  7. Back To Top    #7
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Version 2.5 (updated code and schematics) now up on github.

    GitHub - rjsears/Pool_Fill_Control: Raspberry Pi / Arduino / Python Project to automate filling of swimming pool.

    Added a manual switch to physically interrupt the sprinkler fill circuit. This is done with a DPDT switch and an additional LED along with new functions to manage error logging, notifications, and system functions when the switch is thrown!
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  8. Back To Top    #8

    Join Date
    May 2016
    Location
    Tallahassee
    Posts
    71

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Quote Originally Posted by lovemyazpool View Post
    I saw this system (and a couple of others like it) but none of them really integrated things like pool pump monitoring, overfill alerting, sprinkler monitoring (since I use my sprinkler system) and manual fill control. Plus I think I have about $200.00 total tied up in my system...a lot cheaper than $600!
    One smart thing that the level smart does it make it impossible to overfill your pool by only opening the valve for 7 min at a time max for every hour. Even if the unit loses power while filling (via power outage, power failure of device, etc etc) the valve will still close so the pool doesn't overfill... I agree the price is steep. I guess not that many people want to pipe a system directly from their house into their pool plumbing so they can't exactly sell on quantity.....Neat project though....

  9. Back To Top    #9

    Join Date
    Aug 2014
    Location
    Near Montgomery, AL
    Posts
    20

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Quote Originally Posted by lovemyazpool View Post
    The eTape is pretty cool stuff and works like a charm. I needed a custom size and they made it for me and had it to me in less than a week. Neat stuff.

    What pump are you running? I have the variable speed pentair and I would love to figure out how to control it myself as opposed to having to walk out to the little interface that is on it.
    I just have a single speed pump and a booster pump for the polaris, no variable speed yet. I'm just turning the power to the pumps on or off using solid state relays. I've considered a variable speed pump, but my energy cost is fairly low, so I'll probably just go with a two speed replacement when the one I have fails.

    Russ
    11,500 gallon 14x28 IG vinyl pool, 3/4 HP FloPro Pump, CS200 cartridge filter, Polaris 280 with booster pump. Testing with Taylor K-2600 test kit and adding liquid chlorine with a Beta DR-2000 peristaltic pump.

  10. Back To Top    #10
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Quote Originally Posted by tmobileguy View Post
    One smart thing that the level smart does it make it impossible to overfill your pool by only opening the valve for 7 min at a time max for every hour. Even if the unit loses power while filling (via power outage, power failure of device, etc etc) the valve will still close so the pool doesn't overfill... I agree the price is steep. I guess not that many people want to pipe a system directly from their house into their pool plumbing so they can't exactly sell on quantity.....Neat project though....
    Yeah I really tried to design mine the same way. If I lose power, I have the UPS which will run the entire system for three hours before it shuts everything down automatically. The relay for the sprinkler requires power to stay closed, if we lose power to the Pi, the relay opens and no more water. In addition, if we lose power to the house, the 240v feed to my pool pump area will fail and regardless of the relay position, the sprinkler valve will close. I guess the program itself could fail, but I am running a watchdog on it every 90 seconds and if it fails then systemd restart the script.

    I guess I could move the operation/management/monitoring of the relay to something like a Ruggeduino, a microcontroller is a lot less likely to have a software glitches....I'll have to look into that to see if I can make the system more robust!
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  11. Back To Top    #11
    JesseSchmidt's Avatar
    Join Date
    Jun 2015
    Location
    Fairfield Twp, OH
    Posts
    206

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    This is very cool! Have you actually implemented yet? Can we see pics of the setup poolside?
    26k Gal IG vinyl, Hayward Super 1HP, Hayward Pro Series S244T Sand Filter, TFTestkits TF-100 w/ Speedstir
    Links: TFPC for Beginners / ABCs of Pool Water Chemistry / GETTING STARTED / PoolMath / SLAM / TFTestkits / Chlorine/CYA Chart

  12. Back To Top    #12
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Quote Originally Posted by JesseSchmidt View Post
    This is very cool! Have you actually implemented yet? Can we see pics of the setup poolside?

    I'm still waiting on my NEMA enclosure with fans to arrive to put everything in on the pool side, once I get it in, I will post a bunch more pictures!
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  13. Back To Top    #13
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    I did put up version 2.7 of my code today. I added Atlas Scientific pH & ORP probes to the system. In my case these are for logging only since I have an autopilot system in place that manages my SWG and Acid.

    GitHub - rjsears/Pool_Fill_Control: Raspberry Pi / Arduino / Python Project to automate filling of swimming pool.

    I also put on a water pressure sensor although I have not yet added it to the code!

    psi-filter.jpg
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  14. Back To Top    #14
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    V2.9 uploaded to github today. Made a lot of changes to DEBUG output to STDOUT if set, also integrated alerting.py and pooldb.py together and added a temperature compensation function to the pH probe reading.

    V2.9 (2016-06-18)
    - Eliminated alerting.py file, added contents to pooldb.py file.
    - Added a lot of DEBUG printing to STDOUT if DEBUG == 1 is set.
    - Moved pool_level and pump_running_watts table defs to pooldb.py
    so that you do not have to modify table definitions in main script.
    - Added in temperature compensation function for pH readings if you
    have a pool water temp probe. Configuration is done in pooldb.py


    https://github.com/rjsears/Pool_Fill_Control
    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

  15. Back To Top    #15
    lovemyazpool's Avatar
    Join Date
    Nov 2015
    Location
    Phoenix, AZ
    Posts
    78

    Re: Automatic Pool Fill Control (Moteino, Pi3, MySql/Python, Sprinkler Valve, eTape)

    Got the pool fill valve installed yesterday! The meter is a smart meter and records all water usage so we can tract how
    much water the pool is using as opposed to the rest of the house and irrigation.







    33,000 Gallon, IG Plaster
    Taylor 2006 Test Kit
    Pentair Triton II TR100 Sand Filter
    Pentair IntelliFlo Pump
    AutoPilot SWG & Chemical Controller

Posting Permissions

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