The Amazon Alexa-Enabled Smart Pool System

Updated 31 March 2022

This project is to allow remote control of my pool and associated lights with a dedicated display in
the house, a phone application and Amazon Alexa. Any and/or all of these input devices may be used
to control the pool. The pool temperature and the status of the control devices are monitored as
additional information.

The base system installed by the pool company consisted of an AstralPools VX chlorinator and a
Viron P320 multispeed pump. To turn on the spa for example you had to go to the pool equipment
enclosure and manually change the pool mode from “auto” to “on”, turn the valve to direct water to
the spa, and manually set the pump speed to “high”.

It all runs from Arduino and an ESP8266!

All the code and extras are available on GitHub.

Parts List

Most of the parts I used for this project were collected from various online sources, you can find the full build of materials and links to the parts I used in the PDF that's attached to this project (down the bottom of the page).

However, there are some parts that you can pick up from Core Electronics:

The System

Smart Pool Project complete systems diagram

The schematic above shows the logical connectivity of the systems, which can be divided into three
fundamental categories being, the standard Astralpools functionality, the Modbus Slave local control
device and the Modbus Master remote display device.

Standard AstralPools Functionality 

The first stage of the project is to enable communication between the VX chlorinator and the Viron
multispeed pump. This is achieved by the addition of the Viron BLDC communications module.
Once installed you need to:

  1. Enable “Fast Comms” on the Viron pump.
  2. Enable “Fast Comms” on the VX chlorinator.
  3. Select “3 speed pump enable” on the VX chlorinator.

Once this is done additional configuration menus on the VX chlorinator are shown which enable the
operator to associate the desired pump speed with the mode of operation. In this case for normal
chlorination (pool mode auto), then a low speed 1 is desired, while when spa operation (pool mode
on) is requested, then high speed 3 is desired.

Note: The communications between the VX chlorinator and viron pump in Australia is not MODBUS.
Although Astralpools in Europe does support the viron pump with MODBUS, the Australian version is
a proprietary protocol.

MODBUS Slave Local Control Device

The local control device is installed in the pool equipment enclosure adjacent to the VX chlorinator
and viron pool pump. This device is essentially a Arduino Nano microcontroller which supports the
inputs (temperature and pool status) and the digital outputs for the valves and lights. The
microcontroller is also programmed as a Modbus slave for communication to the Modbus master
display controller.

The microcontroller is programmed using the Arduino IDE software on windows.

Rear panel view of the assembled Modbus Controller using Arduino gear

The microcontroller is programmed using the Arduino IDE software on windows.

  1. Arduino Nano microcontroller PCB
  2. 24VDC power supply (power for both local controller, interface module and remote display controller)
  3. 24VAC power supply for Jandy valve actuator
  4. 4 x Relay modules for the valve and lights control
  5. A standard 12 pole IP54 electrical enclosure with DIN rail mounting
  6. 2 x panel mounted electrical sockets for the light connections.

In addition there is a VX Chlorinator interface module PCB (below) which is installed into the
chlorinator itself to provide the local I/O control and connected to the Modbus slave local controller
via a standard RJ12 six core cable.

Top down photo of the Modbus Controller's accompanying Relay Board, using 4 different relays with a RJ connector visible

Below shows the interface module installed into the VX chlorinator

A rear panel photo of the Interface installed to the VX Chlorinator module

MODBUS Master Remote Display Device

The Remote display device is a 3.5 inch Nextion touch screen mounted into a custom 3D printed
enclosure to house the touch screen and the Modbus master PCB. Power and communications are
provided by a standard RJ45 CAT5e network cable connected to the Modbus slave controller.
Modbus communications are via one pair of the CAT5e cable using RS485 communication modules
with two pairs being used for the 24VDC power.

The display allows the remote monitoring and control of all the connected pool devices. In addition
the display also has two timers associated with the lights to enable automatic on/off control of the
lights. The timers in the VX Chlorinator are still used for the automatic control of the pool
chlorination.

The display allows the remote monitoring and control of all the connected pool devices. In addition
the display also has two timers associated with the lights to enable automatic on/off control of the
lights. The timers in the VX Chlorinator are still used for the automatic control of the pool
chlorination.

The Modbus master PCB has been sized to match that of the Nextion 3.5” display so that it can be
attached together via standoffs and mounted together into the custom 3D printed housing. The
housing is a similar size to a standard electrical outlet with identical mounting holes so that standard
electrical mounting plates can be used for fixing.

The microcontroller is programmed using the Arduino IDE software on windows.

The major components of the Modbus master display controller include:

  1. ESP8266 NodeMCU microcontroller PCB
  2. Nextion 3.5” touch display
  3. Custom 3D printed wall mount enclosure

Wall mounted controller panel with screen for Smart Pool

Screenshots of the home monitor for the smart pool application

Mobile Phone App

The ESP8266 NodeMCU microcontroller also runs a webserver to support the mobile phone
application client. This supports the same monitoring and control functionality as the dedicated
display with the exception of the additional automatic timers.

The mobile phone application was made using the MIT App Inventor 2 software, which supports
applications for android devices and can be added for download on the google playstore.
If the user wants an application for apple phones the same code can be used with the Thunkable
software (ie the same owner as MIT App Inventor 2). Thunkable applications can be used on both
android and apple phones.

Smart Pool Project mobile phone app screenshots

DIY with Amazon Alexa

The ESP8266 NoneMCU microcontroller also runs webservers / clients to support the Alexa
functionality. This is separated into two parts. The first part is a Belkin switch device emulator which
allows Alexa to directly control the spa, pool lights and garden lights. With the Modbus Master
controller powered and connected to the home wifi and internet, then upon Alexa device discovery
then the three above devices are automatically added to Alexa.

For example:
User asks:
“Alexa, turn the spa on”
Alexa Response:
“ok”, The spa valve will go to the spa position.

The second part of the Alexa functionality is for the reporting of the pool status information. This
status information is sent to the thingspeak IOT service every 1 minute (configurable) via the MQTT
publish service . The custom Alexa skill then interacts with the thingspeak IOT to respond to Alexa
requests for information. The Pool Mode commands are sent to the Modbus master controller via
the MQTT subscribe service.

For example:
User asks:
“Alexa, ask my pool, check the status”
Alexa Response:
“The temperature is 25.5 celsius. Mode is auto. Spa if off. Pump is on.”

The Amazon Alexa Echo

Configuration by the user of the local wifi SSID and password details, as well as the thingspeak
settings to enable the Alexa functionality is achieved via a dedicated wifi manager which is initiated
by a pushbutton at the back of the Modbus Master controller.

Configuration by the user of the local wifi SSID and password details, as well as the thingspeak
settings to enable the Alexa functionality is achieved via a dedicated wifi manager which is initiated
by a pushbutton at the back of the Modbus Master controller.

Note the Alexa functionality should only be enabled if the thingspeak account has been fully setup.

.Smart Pool System Login Page Mobile

Schematics

All of the schematics I designed are also available in the project PDF, linked at the end of the project (down the bottom of this page)

Final Project!

Smart Pool Project finished, app on phone with pool in the background

If you've got any questions, please let me know!

Attachment - Project Files

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.