DIY Digital Pool Pump Control

DIY Digital Pool Pump Control

Most of the motivation behind my projects comes from being cheap. There are usually easy solutions out there to problems I want to solve, but they are expensive. For this blog post, I want to talk about my pool pump. (and yes, Alexa will be mentioned in this post - again!)

Most pool pumps out there use a mechanical timer to start and stop the pump at a set period of time. The common one found in most equipment boxes is made by Intermatic.


That's a shot of my timer in my equipment box. It's a solid device. I have only had to replace 1 minor part in 10 years (the motor for the timer in the back). It uses a couple of metal trippers labeled as "on" and "off" to push that orange lever to the right and turn on the system. While it is solid, it's very basic. It turns off, it turns on, it keeps time. I can't do anything with it beyond that and it's not hooked up to my "smart home."

There are solutions out there like these:

But, they are way too expensive. I am a fan of Z-wave (in that picture above, I actually use a Z-wave switch to power my pool lights), but there is a cheaper way to do this. Just like my cheap wall sconces, we just need a few cheap items:

  • ESP8266 powered device like my favorite, NodeMCU: This is a great device as it has everything integrated: a serial to USB port, headers pre-soldered, reset/flash buttons, and a 5v/3v regulator. You can find them really cheap if you buy direct from China too at ~ $3.00 or so. A Raspberry Pi Zero W works well too, but ESP8266 devices are cheaper and smaller.

  • A couple of solid state relays. These worked well for me: These are high amp (40) relays. I need 2 because my pool pump, chlorinator, and heater are powered from a 2-pole 30-amp breaker. So, each leg is split into 15-amps and each leg goes into 1 relay. The trigger for the relay can be as low as 3v, which is perfect for GPIO output signals.


  • My favorite software to run ESP8266 devices, Espurna (FREE!)

This all works for under $30.

The wiring is simple. Feed one line from the breaker into the relay's switching terminal (the line). The other terminal outputs to your equipment (the load). When the relay is activated, the line will power the load. To trigger the relay, we attach the GPIO signal from the ESP8266 to (+) on the input. The common/ground is attached to the (-) side.


Here is an ugly shot of things wired up, but before I put it neatly in the box.


The software/firmware is configured just like how it's described in my cheap sconce post. The difference here is to configure 2 relays in the hardware.h header file. I chose to use GPIO 15 and 16, so the relay definitions look like this:

    // Relays
    #define RELAY1_PIN          16
    #define RELAY1_TYPE         RELAY_TYPE_NORMAL
    #define RELAY2_PIN          15
    #define RELAY2_TYPE         RELAY_TYPE_NORMAL

After configuring the basics, I set the Switches to all be synchronized. Both legs of power will always be turned on at the same time.


Before I slapped everything in the box neatly, I gave it a quick test. Forgive the blurry video and my use of the word "Alexa" - alexa isn't in play yet here.

Now, just slap the thing in neatly.

Image Description

I had a concern about the nodemcu device getting a wi-fi signal in that metal box when closed. After I closed things up, there were no issues.

This solution provides:

  • An easy way for my family to turn on the pool pump when they want to go swimming. Since it runs Espurna, I just have Alexa detect it and it can be turned on/off with a simple "Alexa, turn on the pool pump" command.

  • I can have multiple schedules for the timer. Previously, I only had 1 set of off/on triggers.

  • I don't have to go outside to change the schedule.

  • Since it can be controlled via REST API, I could make this pump "smarter" and have it turn off when unnecessary or turn on when the temperatures are high (you need to circulate and chlorinate your water more as temps increase).

After putting this all together, I just realized that I should have wired up a button to toggle the relays at the box. This is if I don't have my phone near me and I want to activate the pump. This should be a simple fix - I just need to make a momentary pushbutton, wire it up, and update the Espurna to take that as an input that toggles the relays. When I get this done, I'll update this post.