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




Raspberry Pi Pool Monitor Main Page


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



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.




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.




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.




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.


  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?

    • 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.


  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.

    • Dominic

      Hi Blake

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


    • 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…

    • 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!!!

    • Dominic


  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?

    • 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!


    • 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?

    • Dominic

      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.

    • 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.

    • 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?

    • 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?

  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.


  13. Enrico

    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?


    • 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:


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

    • 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!

    • 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.

  16. Thomas

    How would you modify the code so there are user input set points for the pH, ORP, and when the sensor reading falls outside of that value it triggers a relay. Great program but am looking more at creating a chemical controller opposed to a pool automation system

    • Dominic

      Hi Thomas
      You could modify the code around the section that sends an email, that way you could monitor the sensor readings and then trigger a relay instead of sending an email. This would involve quite a few modifications however as the email is sent only periodically (eg. every 2 days).

  17. Jeff Richard

    Love the site, great ideas. I’ve been building something similar for indoor environment management. Was looking to start introducing the PH and ECC sensors into the system I have. Was wondering how you like the Atlas Scientific probes now that you have been using them for a while? Any problems? Surprises? Thanks again for sharing your work, truly inspiring!

    • Dominic

      Hi Jeff
      The sensors have actually gone quite well, in the time that I have been running the system the only thing that has failed is one EC circuit board, it just stopped taking reading one day, not sure why. I just replaced it and the system was working again.

  18. Gregg Palmer

    Hi there. My wife and I have recently moved into an older home that has a pool. I have been working on automating the home. The pool has an old remote control system and I got to thinking about changing out the control for something a bit more modern and flexible. I recently started playing around with a Raspberry Pi and Home Assistant and got to thinking if I could change out the control with something along that line and ended up on your website. Amazing job. I was wondering if your pool has a variable speed pump and how you implemented that? If not, have any ideas on a controller?

    • Dominic

      My pump is variable speed but is controlled manually so it’s not something that I have looked to integrate, depending on your remote you could look at perhaps controlling your pump with an RF Transmitter like this.

  19. Nick xaritos

    Hello, your project is excellent. The email alerts are totally blank without a text body. Can you help me?

    • Dominic

      Hi Nick
      Make sure that you are importing the correct file to fill the text body, read this article for a more detailed process.

  20. Sean

    Awesome and inspiring project! I already have an AquaRite T-Cell-15 salt water pool chlorine generator. I was wondering if your current setup would work w/ this kind of cell? If not, what cell do you recommend? Is your current relay setup/sw set up to control a chlorine generator for salt pools? I looked at your parts list and don’t see any chlorine generators. If I can figure out how to use my current cell and figure out how to control my variable speed pump (or at least have two different fixed speeds) then I am ready to do this.. ?

    • Dominic

      Sorry Sean
      This is a fairly simple program that really just monitors the pool conditions rather than actively managing it, it doesn’t provide any control over multi-speed pumps or automatically increase/decrease the output of a chlorine generator.

  21. Stephane Beausoleil

    Hi, Just skimmed over you project. And this is exactly what I am looking for. Thanks for all the hard work. How much did you spend on this project so far? I want to plan my work and a budget. and where did you buy all your parts. (Except the pi of course)

    • Dominic

      The parts were purchased from various online electronics and hardware stores, the sensors I bought directly from the Atlas Scientific website.

  22. Chris

    Just came across this website when searching for a raspberry pi project to manage pool chems etc.. I have an extra rpi3b. I think I just found my next project.

    thanks for all the leg work you already put into building this and sharing how you did it!

    Thanks a Ton!



Submit a Comment

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


Pin It on Pinterest

Share This