| title | Quick Start Guide |
|---|---|
| summary | Step-by-step guide to set up your Smart Swimming Pool Controller from scratch. Perfect for beginners with basic electronics knowledge. |
| type | docs |
| weight | 10 |
Target audience: DIY enthusiasts with basic electronics knowledge (soldering, GPIO, MQTT). Time required: ~4\u20136 hours (including parts sourcing). Cost: ~45\u201375\u20ac (excluding pumps and pool infrastructure).
This guide walks you through every step to get your Pool Controller up and running, from ordering parts to integrating with your smart home.
⚠️ WARNING: This project involves 230V AC mains voltage!
- Only proceed if you have basic electronics knowledge.
- Always use a Residual Current Device (RCD/FI circuit breaker) for the pump circuit.
- Disconnect power before working on the circuit.
- Keep low-voltage (sensor) wiring separate from mains wiring.
- If in doubt, consult a qualified electrician.
- This project is NOT certified (no CE/UL mark). For personal use only!
Important Safety Resources:
Use the following table to order all required components.
Recommended shops: Amazon, AliExpress, Reichelt, Pollin, Conrad (DE/AT/CH).
| # | Component | Qty | Approx. Cost | Notes | Recommended Links |
|---|---|---|---|---|---|
| 1 | ESP32 Development Board (e.g., ESP32 DevKit V1, NodeMCU-32S) | 1 | 10\u201315\u20ac | Must have 4MB+ flash | Amazon DE, Reichelt |
| 2 | DS18B20 Temperature Sensor (waterproof, stainless steel, 1m cable) | 2 | 8\u201312\u20ac | One for pool, one for solar collector | Amazon DE, AliExpress |
| 3 | 2-Channel 5V Relay Module (with optocoupler isolation) | 1 | 5\u20138\u20ac | Must be active-high trigger! (relay activates when GPIO signal is HIGH) | Amazon DE, Reichelt |
| 4 | Resistor 4.7k\u03a9 (\u00bcW, metal film) | 2 | < 1\u20ac | Pull-up for OneWire data lines | Reichelt, Conrad |
| 5 | Breadboard + jumper wires (for prototyping) OR Perfboard + pin headers (for permanent build) | 1 | 3\u20138\u20ac | Breadboard for testing, perfboard for final build | Amazon DE, Reichelt |
| 6 | USB Power Supply 5V/\u22651A (e.g., phone charger) | 1 | 5\u201310\u20ac | Powers ESP32 + relay module | Any USB charger |
| 7 | Hookup wire (0.14\u20130.5mm², various colors) | — | 3\u20135\u20ac | For permanent wiring | Reichelt |
| 8 | Enclosure (IP54+ for outdoor use) | 1 | 5\u201310\u20ac | Optional but recommended | Amazon DE, Reichelt |
| 9 | Screw terminals (2-pin, 5mm pitch) | 4\u20136 | 2\u20133\u20ac | For removable connections | Reichelt |
| Total | ~45\u201375\u20ac | Without pumps/pool infrastructure |
ℹ Note: The relay module must be active-high (relay ON when GPIO = HIGH). Many cheap modules are active-low by default but have a jumper to switch the logic. Verify this before permanent installation!
Recommended boards:
- ESP32 DevKit V1 — Most common, widely available
- NodeMCU-32S — Similar to DevKit, good compatibility
- ESP32-WROOM-32 — Any board with this module
Avoid:
- ESP32-S2, ESP32-S3, ESP32-C3 — Different architecture, not currently supported
- Boards with < 4MB flash — Insufficient for firmware
Verification: Check that your board has the ESP32-WROOM-32 module and 4MB+ flash memory.
Critical: The relay module must have optocoupler isolation for safety and active-high logic for compatibility with the firmware.
How to verify active-high logic:
- Connect relay VCC to 5V and GND to GND
- Connect IN1 to 3.3V (from ESP32)
- Measure between COM1 and NO1 — should show continuity when IN1 = HIGH
Recommended modules:
- Songle SRD-05VDC-SL-C — Active-high, optocoupler isolated
- Any module labeled "High Level Trigger" or "Active High"
⚠️ Important: If your module is active-low, you can either:
- Find a module with a jumper to switch between active-high/active-low
- Modify the firmware to invert the relay logic (change
RELAY_ONfromHIGHtoLOWinConfig.hpp)
| Tool | Purpose | Notes |
|---|---|---|
| Soldering iron | Soldering components | 320\u2013350\u00b0C for leaded solder |
| Solder | Electrical connections | Leaded recommended for beginners |
| Flux | Improve solder flow | Rosin-core flux |
| Wire cutters/strippers | Cut and strip wires | For hookup wire |
| Multimeter | Test continuity and voltage | Essential for debugging |
| Magnifying glass | Inspect solder joints | For quality control |
| Third hand tool | Hold components | Optional but helpful |
Best for: Testing before permanent installation, learning the circuit.
ESP32 Development Board
3.3V --[4.7kΩ]-- GPIO32 -- DS18B20 Solar (DATA)
3.3V --[4.7kΩ]-- GPIO33 -- DS18B20 Pool (DATA)
GPIO25 -- Relay IN1 (Pool Pump)
GPIO26 -- Relay IN2 (Solar Pump)
VIN (5V) -- Relay VCC
GND -- Relay GND
GND -- DS18B20 GND (both sensors)
USB Power (5V) -- ESP32 VIN
USB Power (GND) -- ESP32 GND
-
Place ESP32 on breadboard
- Straddle the center gap of the breadboard
- Ensure all pins are properly inserted
-
Add pull-up resistors
- Insert 4.7k\u0019 resistors between 3.3V rail and GPIO32, GPIO33
- These are required for DS18B20 sensor communication
-
Connect DS18B20 sensors
- Red wire (VDD) → 3.3V rail
- Black wire (GND) → GND rail
- Yellow/White wire (DATA) → GPIO32 (Solar) and GPIO33 (Pool)
- Important: Each sensor needs its own pull-up resistor
-
Connect relay module
- VCC → 5V rail (from USB power)
- GND → GND rail
- IN1 → GPIO25 (Pool pump control)
- IN2 → GPIO26 (Solar pump control)
-
Connect power
- USB Power 5V → ESP32 VIN pin
- USB Power GND → ESP32 GND pin
-
Verify connections
- Use multimeter to check continuity
- Ensure no short circuits
- Verify all connections are secure
ℹ Tip: Use different colored jumper wires for different signals to avoid confusion.
Best for: Final installation, outdoor use, long-term operation.
- Plan component placement on perfboard
- Solder ESP32 with pin headers for easy removal
- Solder relay module with sufficient spacing
- Add screw terminals for:
- Power input (5V/GND)
- Sensor connections (DATA/GND for each DS18B20)
- Relay outputs (COM/NO/NC for each relay)
- Solder resistors directly between 3.3V and GPIO pins
- Add test points for debugging with multimeter
- Tin your iron before starting
- Use flux for better solder flow
- Heat both pad and wire before applying solder
- Avoid cold solder joints — should be shiny, not dull
- Check for bridges between pins with magnifying glass
- Test continuity with multimeter after soldering
ℹ Tip: Use sleeve or heatshrink tubing on wire connections for insulation and strain relief.
⚠️ WARNING: Mains voltage! Disconnect power before wiring!
Relay terminals:
- COM — Common (input from mains)
- NO — Normally Open (output to pump when relay is ON)
- NC — Normally Closed (output to pump when relay is OFF)
For each pump (Pool and Solar):
Mains L (Phase) --[ Fuse ]--[ RCD/FI Circuit Breaker ]-- Relay COM
Mains N (Neutral) -------------- Relay NO
Relay NO ----- Pump L (Phase)
Relay COM ----- Mains L (Phase)
Important:
- Use RCD/FI circuit breaker (30mA) for each pump circuit
- Use appropriate wire gauge for pump current (typically 1.5mm² for pumps up to 2kW)
- Keep low-voltage wiring (ESP32, sensors) physically separate from mains wiring
- Use cable glands for outdoor installations
Pool Sensor:
- Place sensor in pool water, away from direct sunlight
- Use waterproof cable gland for entry into enclosure
- Ensure sensor is fully submerged (at least 10cm below surface)
- Avoid placing near pump intakes or heaters
Solar Collector Sensor:
- Place sensor at highest point of solar collector
- Use heat-resistant cable if collector gets very hot
- Ensure good thermal contact with collector pipe
- Protect from direct weather exposure if possible
Cable Routing:
- Use outdoor-rated cable for external installations
- Keep cable runs as short as possible (DS18B20 works up to ~100m with proper pull-ups)
- Use cable ties for strain relief
- Avoid sharp bends or pinching cables
-
Install PlatformIO
- VS Code Extension: PlatformIO IDE
- CLI:
pip install platformio
-
Install USB drivers (if needed)
- CP210x: Silicon Labs Driver
- CH340: WCH Driver
-
Clone repository
git clone https://github.com/smart-swimmingpool/pool-controller.git cd pool-controller
-
Connect ESP32 to computer via USB cable (data-capable, not charge-only)
-
Check that device is detected:
- Windows: Device Manager → Ports (COM & LPT)
- Linux:
ls /dev/tty*(look for/dev/ttyUSB0or similar) - macOS:
/dev/cu.*or/dev/tty.*
-
Note the serial port for the next step
# Navigate to project directory
cd pool-controller
# Build the firmware (downloads dependencies on first run)
pio run
# Flash to device (replace COM3 with your port)
pio run --target upload --upload-port COM3
# Monitor serial output
pio run --target monitor --upload-port COM3- Open the project folder in VS Code
- Click PlatformIO icon in activity bar
- Select your environment (e.g.,
esp32dev) - Click ▶ Build (checkmark icon)
- Click ↩ Upload (arrow icon)
- Click → Monitor (plug icon) to view serial output
After flashing, you should see in the serial monitor:
20:12:34.567 [I] PoolController: Starting up...
20:12:34.568 [I] PoolController: Homie for ESP8266/ESP32 v2.0.0
20:12:34.569 [I] PoolController: Firmware version: 3.3.0
20:12:34.570 [I] PoolController: Connecting to WiFi...
If the device doesn't start or shows garbled output:
- Check USB cable (try a different one)
- Check serial port selection
- Check baud rate (should be 115200)
- Try pressing BOOT button while powering on
-
Wait for WiFi AP mode
- On first boot, the device creates a WiFi hotspot:
Pool-Controller-Setup - Password: not required (open network)
- On first boot, the device creates a WiFi hotspot:
-
Connect to hotspot
- On your phone/computer, connect to
Pool-Controller-Setup - Open browser to:
http://192.168.4.1
- On your phone/computer, connect to
-
Configure WiFi
- Enter your WiFi SSID and password
- Click Save & Connect
-
Configure MQTT
- Enter your MQTT broker hostname/IP
- Enter MQTT port (default: 1883)
- Enter MQTT username/password (if required)
- Click Save & Restart
-
Device reboots and connects to your WiFi and MQTT broker
- Open serial monitor (baud rate: 115200)
- Wait for configuration prompts or send commands:
# Set WiFi credentials
AT+WIFI=SSID,password
# Set MQTT broker
AT+MQTT=broker.example.com,1883
# Set MQTT credentials (if needed)
AT+MQTTUSER=username,password
# Save and restart
AT+SAVE
AT+RESTART
Note: Serial commands are only available in AP mode (when not connected to WiFi).
-
Ensure MQTT broker is running
- Install Mosquitto Add-on or use external broker
-
Enable MQTT Discovery
- In Home Assistant: Settings → Devices & Services → MQTT
- Ensure Discovery is enabled
-
Pool Controller auto-discovers
- After connecting to MQTT, devices appear automatically in Home Assistant
- Go to: Settings → Devices & Services
- Look for Pool Controller devices
-
Add to Dashboard
- Create a new dashboard or add entities to existing one
- Recommended entities:
- Temperature sensors (Pool, Solar)
- Switches (Pool Pump, Solar Pump)
- Select (Operation Mode)
- Number (Temperature thresholds)
Complete MQTT Guide: MQTT Configuration
Since v3.3.0 the controller uses Home Assistant MQTT Discovery exclusively. openHAB does not support HA Discovery natively, so you need to manually add the controller as MQTT Things using the raw topic structure.
-
Add your MQTT broker in openHAB (openHAB 3+: Settings → Things →
+→ MQTT Broker). -
Create a New Thing from the MQTT Binding and subscribe to the topic:
homeassistant/# -
Restart openHAB or refresh the MQTT Binding:
sudo systemctl restart openhab
-
Discover & Configure Things
After the broker is set up, the controller's entities should appear as discoverable Things under
homeassistant/#. If they don't appear automatically, you can manually create Things by subscribing to the individual state/command topics.
See the openHAB Configuration Guide
for ready-to-use .things and .items examples.
- Install Node-RED
- Add MQTT Input Nodes for Pool Controller topics
- Add Dashboard Nodes for visualization
- Deploy flow
-
Verify WiFi connection
- Check serial monitor for:
WiFi connected, IP: 192.168.x.x - Or check your router's client list
- Check serial monitor for:
-
Verify MQTT connection
- Check serial monitor for:
MQTT connected - Subscribe to
#topic with MQTT client to see all messages
- Check serial monitor for:
-
Verify temperature readings
- Check serial monitor for temperature updates
- Or check MQTT topics:
smart-swimmingpool/pool-controller/temperature/pool
-
Test relay control
- Use Home Assistant/openHAB to turn pumps on/off
- Listen for relay clicking sounds
- Verify pumps start/stop
| Issue | Possible Cause | Solution |
|---|---|---|
| Device doesn't start | Power issue | Check USB cable, power supply, connections |
| No WiFi connection | Wrong credentials | Reconfigure via AP mode or serial |
| No MQTT connection | Wrong broker settings | Verify broker IP/port, check firewall |
| No temperature readings | Sensor wiring issue | Check DS18B20 connections, pull-up resistors |
| Relays don't switch | Wiring issue | Check relay connections, verify active-high logic |
| Pumps don't start | Mains wiring issue | Check relay wiring, RCD, pump power |
Complete Troubleshooting: FAQ and Troubleshooting Guide
-
Choose enclosure
- IP54+ rating for outdoor use
- Sufficient size for ESP32, relay module, and wiring
- Ventilation for heat dissipation (if not waterproof)
-
Mount components
- Use standoffs for ESP32 and relay module
- Use cable glands for external connections
- Keep mains wiring separate from low-voltage wiring
-
Label connections
- Label all screw terminals
- Create a wiring diagram for future reference
-
Choose power supply
- USB phone charger (5V/\u22651A) for indoor use
- Outdoor-rated power supply for external installation
- USB power bank for temporary setup
-
Power protection
- Use surge protector for outdoor installations
- Consider UPS for power failure protection
-
Indoor installation (recommended)
- Protect from weather
- Easy access for maintenance
- Within WiFi range
-
Outdoor installation
- Use IP65+ enclosure
- Use outdoor-rated cable
- Protect from direct sunlight and rain
- Ensure adequate ventilation
Now that your Pool Controller is up and running, explore these advanced features:
- Set up automation rules in Home Assistant/openHAB
- Temperature-based control: Turn on solar heating when pool is cold
- Time-based control: Run circulation pump during off-peak hours
- Weather-based control: Disable solar heating on cloudy days
Example Home Assistant Automation:
automation:
- alias: "Enable solar heating when pool is cold"
trigger:
- platform: numeric_state
entity_id: sensor.pool_controller_pool_temp
below: 25
condition:
- condition: state
entity_id: switch.pool_controller_solar_pump
state: "off"
- condition: numeric_state
entity_id: sensor.pool_controller_solar_temp
above: 30
action:
- service: switch.turn_on
entity_id: switch.pool_controller_solar_pump- Set up Grafana dashboard for historical data
- Configure alerts for abnormal conditions
- Monitor energy usage of pumps
Grafana Dashboard: smart-swimmingpool/grafana-dashboard
- Adjust temperature thresholds for your climate
- Configure circulation schedules based on pool usage
- Set up multiple operation modes (Auto, Manual, Boost, Timer)
- Enable state persistence for power failure recovery
Complete Configuration Guide: Users Guide
- Start with breadboard prototyping before permanent installation
- Test each component individually before connecting everything
- Use multimeter to verify all connections before powering on
- Label all wires for easy troubleshooting
- Keep a wiring diagram for future reference
- Test in AP mode first before configuring WiFi/MQTT
- Monitor serial output during initial setup
- Active-low vs active-high relays — Verify your relay logic!
- Missing pull-up resistors — DS18B20 sensors won't work without them
- Insufficient power supply — Use 5V/\u22651A for ESP32 + relay
- WiFi range issues — Ensure good signal at installation location
- MQTT broker not running — Verify broker is accessible from ESP32
- Mains wiring errors — Always use RCD and verify with electrician
- Regularly check connections for corrosion or loose wires
- Clean DS18B20 sensors periodically (especially pool sensor)
- Update firmware when new versions are released
- Monitor system health via MQTT or web interface
- Backup configuration before making changes
If you encounter issues:
- Check this guide again — Most issues are covered above
- Read the FAQ — Common problems and solutions
- Search GitHub Discussions — Community support
- Open a GitHub Issue — Include:
- Detailed description of the problem
- Screenshots (serial monitor, web interface)
- Your hardware setup (ESP32 model, relay module, sensors)
- Firmware version (from web interface or serial monitor)
- Steps to reproduce the issue
- Hardware Guide — Detailed assembly instructions
- Users Guide — Operation modes and web interface
- MQTT Configuration — Complete topic reference
- State Persistence — Settings survival across reboots
- OTA Updates — Remote firmware updates
- Software Guide — Development and build process
- PlatformIO Documentation — Build system
- ESP32 Datasheet — Microcontroller
- DS18B20 Datasheet — Temperature sensor
- MQTT Protocol — Message Queuing Telemetry Transport
- Home Assistant MQTT Discovery — Smart home integration
- Electrical Safety — General safety guidelines
- GitHub Discussions — Ask questions, share ideas
- Home Assistant Community — Smart home discussions
- Reddit r/homeassistant — Home automation community
✅ Congratulations! You now have a smart swimming pool! ✅\n \n Made with ❤️ by the Smart Swimming Pool community