Every year around spring time my kids are asking when my parents in-ground pool is ready for swimming. Commercial pool temperature sensors are either local with a screen or expensive when you include wifi. The wifi versions are also likely a closed platform and reviews show they often fail from the elements. One of the main features I wanted was the ability for my kids to see what the temperature is daily. For that I will be using the Adafruit MagTag to display weather data but also the pool temperature using Adafruit IO via MQTT. The main body housing the electronics is a 1.5" PVC with a bottom cap and threaded top cap. I use steel BB's for ballast to keep it upright and a 3D printed piece with foam inside for floatation. I only had PLA+ in white for the float so it may need PETG in the future.
Two issues have cropped up recently with the Pool Temperature Monitor. The first one is related to my code. There have been two instances where it stopped sending updates to Adafruit IO but continues to work if reset. We are pretty sure the first time this happened my parents house lost internet overnight and obviously my code did not handle it well. I plan on pulling it out this week to try and fix that issue.
The second problem is related to moisture. The last time it stopped working I pulled it out and noticed condensation collecting on the top of the screw cap. There was also some additional liquid at the bottom which has slightly rusted the BB's. My parents said the last time my kids were swimming my son pulled it underwater so that may be the initial source of the moisture or it may just be naturally happening.
I used thread sealant that is really old so I also plan on cleaning it up and applying some fresh sealant. Some people have suggested adding a solar panel but waterproofing was the main reason I did not try this approach. There is obviously a way to do it well but I did not want that additional complexity.
The pool temperature monitor has continued to work great so I have moved on to the temperature display. Below is a picture of my first attempt. It should hopefully last almost 2 months on a full battery because I am only updating the display every 2 hours.
The pool temperature monitor has been in the pool on and off for a few weeks with mixed results. It would not always connect to wifi and even when it did there were issues publishing to Adafruit IO. After swapping in a new ESP32 board and some code enhancements, it is now updating regularly every 30 minutes. I will continue monitoring the battery usage to determine when the battery needs to be swapped out. The good news is so far, there have been no moisture issues inside the PVC and the 3D printed float piece seems to be holding up well to the chlorine/sun.
The battery voltage was optimized for the previous ESP32 which was underrepresenting the voltage. I'll need additional code changes to get it to be more accurate for this board.
The pool temperature monitor is currently deployed. I updated the code and set a longer wait for the Wifi connection for reliable temperature readings every hour. I will continue updating the log with the progress and how well it does in the elements. The gallery is also update with pictures of it floating in the pool and the internals. I used crude 3D printed parts to keep everything in place inside the pvc. I am still learning openscad so may improve on the design in the future.
The current state of this project is refinement. I have the physical and electronic design complete and have been tweaking the code. I am using Platform IO for development and now need to reduce the time it takes to connect to the wifi router. With the current code it does not always connect after waking from deep sleep because of the limit I created on the number of attempts to reduce battery drain. Hopefully using static IP and setting the channel will decrease the time it takes to connect.