Pool Monitor Overview

Hydropi FaviconI started this project because I wanted to learn more about my Raspberry Pi and also create something that would be useful to me in the real world.  I ended up making this pool controller because, quite frankly pool maintenance is tedious work, so it was time to see if I could automate some of it with the Pi.

Given that I don’t have a background in coding or webpage design I wasn’t sure if I was even capable of doing it but with a bit of persistence and a lot of searching I managed to get it up and working. It has now been monitoring my pool since October 2015 and still seems to be going well.  I am hoping that in writing this blog I will achieve 3 things, firstly it will force me to go back over the code and make some changes and improvements, secondly give me a reference to look back on so I can remember how I put it together in case I want to make changes in the future and finally I hope that by writing it all down you may also find some of this useful with your projects.

So here is what I set out to achieve:

1.    Provide monitoring of 5 sensors

  • pH
  • ORP (Oxidation/Reduction Potential) – This can be used to measure chlorine levels
  • Salinity (Electrical Conductivity)
  • 2 x Temperature

2.    Record current sensor values and also graph long term readings.
3.    Send an email when the pool chemistry is incorrect and suggest corrective action to restore the balance.
4.    Control 4 x AC GPO’s that can be used for Pumps, Lights, Waterfalls etc. with multiple different timer settings.
5.    Create a Webpage and Phone App to access readings, settings, graphs and control the timers.

Here are a few pictures of the final unit.

Web based Control and Monitoring Panel

 

Main:

 

Raspberry Pi Pool Monitor Main Page

 

The Main page provides monitoring and control of everything that is attached to the HydroPi.

Graphs:

 

Raspberry Pi Pool Monitor Graphs Page

 

The graphs page presents a chart for each of the sensors that are connected and allows you to look back over a range of time periods by selecting from the menu above the graphs.

 

Timers:

 

Raspberry Pi Pool Monitor Timers Page

 

The Timers page provides access to each of the GPO outlets on the Hydropi and allows you to set multiple timers for each. Fill in just the number of timers that you require. Once you are happy select submit and all timers for that GPO will be updated. To clear all the timers simply select Submit with no entries in the form and all current timers will be removed.

The GPO’s are numbered 1 to 4 from left to right when facing the unit.

 

Dosage:

 

Raspberry Pi Pool Monitor Dosage Page

 

This page explains how to correct any water chemistry problems that exist in the pool and makes recommendations about the quantity of chemicals to add for chemicals that are not monitored by the sensors.

 

Settings:

 

Raspberry Pi Pool Monitor Settings Page

 

This page provides a simple way of deleting various amounts of historical data from the graphs, reboot and shutdown buttons and all the various other settings in the database.

Note: A Shutdown should always be performed before powering off the HydroPi to prevent damage to the SD card operating system.

The control software is written in python, the webpage in PHP and it’s all available on GitHub, if your curious on how to create this yourself, here I’ve collected all the relevant articles and a parts list.

If you have any suggestions or ideas please let me know in the comments below.

35 Comments

  1. Dean

    Great work, I really like this project and am considering building one for my own pool, to save time I’m wondering if you have a part listing of what is required to build the kit?

    Reply
    • Dominic

      Hi Dean

      I have made a list of the parts I used to build this project here but as you can imagine with AC power involved it can get quite country specific. Anyway I hope this helps and at least points you in the right direction.

      Dom

  2. Blake Miller

    I would just like to add a water level sensor as well. I have so much evaporation in the summer I can easily lose an inch within a week, and I often forget to go out to fill the pool often enough. Without doing a lot of work to the yard, there is no means to retrofit an automatic filler to the pool, so at least a reminder would be helpful. Just not sure how I would get wiring from the sensor over to the pool controller equipment. I imagine the sensor could be in the area where the suction is located or maybe just hang over the edge of the pool.

    Reply
    • Dominic

      Hi Blake

      Sounds like a good addition, let me know how it works out.

      Dom

    • Mike

      Looking at doing this same project, GREAT website you have here! I will be referring to it a lot!

      FYI, my pool is the same way – there is no auto-filler. What you could do is once you can accurately measure the level have the RaspberryPi control a water valve plumbed into the return line to the pool. Or if you don’t want to do that, just hook the valve up to one of the “spitting frog” type fountain spitters to fill it.

  3. Ganesh

    Really great project, I like HW arrangement and Web design…

    Reply
    • Dominic

      Thanks, glad you found it interesting, this was about my 3rd attempt at getting a webpage that I liked, the 1st was pure HTML and looked pretty bad. Slowly learning more

  4. karime

    Really good project. impressed.

    Good job!!!

    Reply
    • Dominic

      Thanks

  5. JW

    Brilliant project. Thanks for sharing! Do you have a forum for group topics and discussions for others who want to build what you’ve documented?

    Reply
    • Dominic

      Thanks JW, sorry no forum but if you have any questions I’m more than happy to try and help, you can reach me via contact page.

  6. Jeff Field

    Hello Dom,
    My Hydropi project is progressing along quite nicely. I’m designing up a custom case to hold all the components, which I will then 3d print. I’ve customized it quite a bit, with 3 temp sensors, and control of my heater too. One thing I have added is a pressure sensor, which I can use to monitor the filter outlet pressure, I will have it send me an email when the filter needs to be backwashed. I used the method and parts shown here: http://www.rototron.info/raspberry-pi-analog-water-sensor-tutorial/
    Thought maybe you would be interested in this, give you something to do in your off season!

    Jeff

    Reply
    • Dominic

      Great idea, i’ll have to look into it.

  7. kazanjig

    Would it be possible to provide push-button control of each pool system (either via momentary switch or a keyboard) for control at a service panel by a pool maintenance person or non-techie?

    Reply
    • Dominic

      Hi
      You could connect some buttons to provide manual control of the relays instead of using the webpage another option would be to add a touchscreen to the enclosure that houses the Raspberry Pi to allow for easy accesses for others.

  8. Bill Skeen

    Best DIY pool controller project I’ve been able to find to date. Ordering parts now.

    Reply
    • Dominic

      Thanks Bill, really appreciate that.

  9. Ron Tanner

    Quick question. I am having a new pool installed and working on the piping diagram with the pool builder. In your photo showing the sensors I do not see any check-valves. How do you keep the ORP and pH sensors wet after turning off the pump or cleaning the pump screen?

    Great Project.

    Reply
    • Dominic

      Hi Ron
      The pool uses a sand filter so cleaning generally just involves back-washing, as for the check valves the system doesn’t really need them as it is air tight and so when the pump is turned off the water just stays in place. If I know that the sensors are going to be out of the water for a long period of time I simply remove them and put them back in the storage solution they came in.

    • Ron

      Thanks for the response. Makes sense. I will be using a cartridge filter and the inlet and outlet are not on top and I do not know how much water will stay between the filter and the pump. I think I will have the pool builder put a length of pipe with two unions on the output side of the filter using 45’s to create a dip in the line prior to returning to the pool. This would remove the need for the check valves and also filter the water. This should keep the sensors cleaner and wet all the time.

      Thanks for creating this project.
      I know it took a lot of time and sharing with the world is a great way to give back.

      Kind Regards
      Ron T.

    • Dominic

      Thanks Ron

  10. Ross

    Do you have a wiring diagram for your project?

    Reply
    • Dominic

      Sorry Ross

      I don’t have a circuit schematic that I can upload

  11. Brian Brandaw

    I love the project! I plan on adding some features from this project to my existing Pi that is monitoring temperature and salt level in my water softener.

    I’m interested in the fittings you used to insert the probes into the pipe. The tee looks like a standard reducing tee with a threaded outlet, but where did you find the threaded insert that holds the probe into the pipe?

    Reply
  12. Jason

    Great project! I have been looking for something like this as a jumping off point. I will probably combine this with some other code to control my pool pump and salt water generator via RS-485.

    I notice on the parts list you call out 2 of the Atlas Scientific voltage isolators, but your pictures appear to use three. Can you confirm this? i.e. are you using one for each sensor?

    Also, I noticed your articles on connecting the sensors do not mention the voltage isolators. Do you consider this optional or was this added later? I can see using these if the voltage reference were different between the sensors, is this the case? I have never worked with the Atlas Scientific probes so I was curious about the reasoning behind the isolators.

    Thanks
    Jason

    Reply
  13. Enrico

    Hi,
    great project. your code run also without power relay? for the beginning i dont want to connect relays to my version.

    You connected the sensors (like PH) direct to filter cycle or you use a bypass for a controlled water flow level?

    Enrico

    Reply
    • Dominic

      Hi Enrico

      The easiest way I can think of is to set the output pins variable to an empty set {}, this should mean that the relay code won’t execute. If that doesn’t work then you will need to remove the relay code from the program completely. I have connected my sensors directly into the incoming plumbing of the filter, no bypass.

  14. Jason Yates

    Hi Dominic,

    Are you using this on a salt water pool? I am guessing you are since you are checking for salinity? It looks like you are converting EC to PPM by multiplying by 0.67. I have read that .55 is better for saltwater pools.

    I am certainly no chemist, I just was curious if this was something you have already looked at determined .67 was the way to go. I have the sensors installed and functioning and am using .55 as a multiplier and it matches closer to the water testing I have performed at my local pool store. The place I got this info from was here:

    https://www.researchgate.net/post/Hi_is_there_any_way_one_can_estimate_salinity_from_EC_TDS_and_chlorinity_chloride_concentration_in_freshwater

    Thanks for posting all of this info. It has been a great help.

    Reply
    • Dominic

      Hi Jason

      Glad you’re finding the info helpful.
      I was working off the formula TDS (mg/L)= EC(us/cm) x 0.67 that I found while researching. In the beginning, I also played with the conversion factor a bit to try an get more accurate readings but in the end, this worked for my pool.
      If you’ve found that .55 works for you, that’s great.

  15. Zazie

    Hi Dominic,

    Very impressed by all the work you’ve done and shared, impressive!

    I realize you already shared info on the probe pipe fittings from https://www.atlas-scientific.com/product_pages/components/pipe_fitting.html, however their website only references 1/2″ and 3/8″ pipe size. Looking at your pictures it looks to me that your pipes are 1 1/2 “, is that correct? If so which size from Atlas Scientific did you use? thanks a lot!

    Reply
    • Dominic

      In the end, I just used the black sensor mounts from Atlas Scientific and the pipe fittings I got from a local plumbing store.

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This