Pool Automation with ESP32 and Arduino

During the COVID pandemic in 2020 we decided to purchase a pool. With my love for technology I wanted a way to fully automate all pool functions through our phones using Home Assistant, HomeKit, Alexa, MQTT and NodeRed. Pool automation is not something the local pool builders are used to in our area and I wasn’t willing to spend big money on one of the big brands; Jandy (iAquaLink), Hayward, Pentair – especially without having knowledge of installing them. I have never worked with microcontrollers before but have had years of experience with programming and integration. This was enough to give me a project through the winter while we were spending our time isolating.

I did my research and purchased a few ESP8266 and ESP32 development boards from Amazon. I ultimately went with the ESP32 due to the increased memory and GPIOs available. Next was to determine which IDE to use and because I have knowledge of c# I felt Arduino would be the easiest to work with. I did get the Visual Micro plugin for Visual Studio as it just streamlined the development process.

ESP8266 – https://www.amazon.com/dp/B081CSJV2V/ref=cm_sw_em_r_mt_dp_8VXX29SDKAKVQHX2BZG7?_encoding=UTF8&psc=1

ESP32 – https://www.amazon.com/gp/product/B086MLNH7N/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I’ve installed remote starters, car stereos, soldering and other various things but I had never worked with electronics to this level. I really need to create a proof of concept to make sure I could actually do this. I also purchased an eight channel relay board from Amazon, miscellaneous jumpers, LED’s, momentary buttons, resistors and diodes.

I was able to prove out the basics of what I would need. Next I wanted to have a touch panel interface and came across Nextion screens. These screens are very easy to use, full support for Arduino and has a GUI builder. I used a Photoshop to mock up some screens and continued the proof of concept.

Now the next challenge was figuring out how to make it all work with my pool equipment. I had various voltage requirements that were necessary to control everything and I wanted a simplified design that looked professional and was reliable. As you can see from the circuit diagram I drew below, I needed:

  • 5V DC for the ESP32 and Nextion screen
  • 12V DC for the momentary LED switches
  • 24V AC for the valve actuators, to control deck jets and waterfall
  • 110V AC to control the pump, pool lights and landscape lights

I headed over to Fiverr and spoke to a few people that specialized in electrical design with microcontrollers and Arduino. One gentlemen I came across, Mithira Udugama, seemed to be newer to Fiverr but we really connected and he seemed genuinely interested and confident in helping me build an electrical circuit and PCB.

After a lot of conversation back and forth understanding the requirements, he built a full electrical schematic, provided a BOM (build of materials), designed the PCB and even helped me print it. Mithira is extremely talented and did such an amazing job that I asked him to put his name on the PCB as well. I HIGHLY recommend him to anyone looking for electrical or PCB design.

Since this was going to be outside I needed to make sure that it could handle the elements and found a NEMA IP67 enclosure with a clean front panel so I could see the touch screen panel and LED buttons.

I started to assemble and wire everything in the enclosure, attempting to keep a clean and professional appearance. I’m happy to report that has been running for a few months now without any issues.

Pool Automation with ESP32 and Arduino Read More »