Skip to content

Hardware Guide

Hardware Guide | Water Quality Monitor

This guide provides comprehensive information for building the Water Quality Monitor hardware, from selecting parts to assembling the complete device.

⚠️ Status: Under Development — This module is in the planning phase. Hardware specifications may change as development progresses.


✨ Overview

The Water Quality Monitor is designed to be a modular, extensible device for monitoring swimming pool water chemistry. The current design focuses on pH and chlorine monitoring, with the ability to add additional sensors in the future.

Design Goals:

  • Accuracy: Reliable measurements comparable to commercial test kits
  • Reliability: Robust operation in outdoor pool environments
  • Extensibility: Easy to add new sensor types
  • Affordability: Cost-effective compared to commercial systems
  • Integration: Seamless integration with Smart Swimming Pool ecosystem

⚡ Parts List (BOM)

⚡ Core Components

#ComponentQtyApprox. CostNotesRecommended Suppliers
1ESP8266 Development Board15–10€WeMos D1 Mini or NodeMCUAmazon, AliExpress
2pH Sensor with BNC Probe120–50€0-14 pH range, BNC connector14core, AliExpress
3pH Electrode Storage Solution15–10€For electrode storageAmazon
4pH Calibration Solutions210–20€pH 4.0 and pH 7.0Amazon

⚡ Optional Components

#ComponentQtyApprox. CostNotesRecommended Suppliers
5Chlorine Sensor130–80€For chlorine monitoringVarious suppliers
6Temperature Sensor15–10€DS18B20 waterproofAmazon
7External ADC Module12–5€ADS1115 for better precisionAliExpress
8OLED Display15–10€SSD1306 or SH1106AliExpress
9I2C Multiplexer12–5€For multiple I2C sensorsAliExpress

⚡ Enclosure & Installation

#ComponentQtyApprox. CostNotesRecommended Suppliers
10Waterproof Enclosure110–20€IP65+ ratingAmazon
11Cable Glands2–42–5€For waterproof cable entryReichelt
12Sensor Mount15–10€For pH/chlorine probe mountingAmazon
13Desiccant Packs22–5€Prevent condensationAmazon

⚡ Tools Required

ToolPurposeNotes
Soldering ironSoldering components320–350°C recommended
SolderElectrical connectionsLeaded for beginners, lead-free for RoHS
FluxImprove solder flowRosin-core recommended
Wire cutters/strippersCut and strip wiresFor hookup wire
MultimeterTest continuity and voltageEssential for debugging
Magnifying glassInspect solder jointsFor quality control
Calibration beakersSensor calibration50-100ml capacity
Distilled waterRinsing sensorsFor calibration and cleaning

⚡ Total Cost Estimate

ConfigurationApprox. CostNotes
Basic (pH only)40–80€ESP8266 + pH sensor + enclosure
Standard (pH + temp)50–100€Adds temperature sensor
Advanced (pH + chlorine + temp)100–200€Adds chlorine sensor and ADC
Complete (all sensors + display)120–250€All sensors, display, premium enclosure

⚡ Sensor Selection Guide

⚡ pH Sensors

We recommend the following pH sensors based on testing and community feedback:

✅ Recommended: 14core pH Sensor with BNC Probe

Specifications:

  • Range: 0-14 pH
  • Resolution: 0.01 pH
  • Accuracy: ±0.1 pH
  • Response Time: < 1 minute
  • Temperature Range: 0-60°C
  • Output: Analog voltage (0-3.3V or 0-5V)
  • Connector: BNC
  • Probe Type: Glass electrode with reference

Pros:

  • Affordable price
  • BNC connector for easy replacement
  • Good documentation and support
  • Compatible with ESP8266 ADC

Cons:

  • Requires regular calibration
  • Limited lifespan (1-2 years)
  • Sensitive to temperature changes

Resources:

⚡ Alternative: Atlas Scientific pH Sensor

Specifications:

  • Range: 0-14 pH
  • Resolution: 0.001 pH
  • Accuracy: ±0.01 pH
  • Interface: I2C or UART
  • Probe Type: Industrial glass electrode

Pros:

  • Very high accuracy
  • Digital interface (less noise)
  • Robust construction
  • Long lifespan

Cons:

  • Expensive
  • Requires specific circuit design

Resources:

⚡ Alternative: DFRobot pH Sensor

Specifications:

  • Range: 0-14 pH
  • Resolution: 0.1 pH
  • Accuracy: ±0.1 pH
  • Output: Analog voltage
  • Interface: Gravity 3-pin connector

Pros:

  • Good documentation
  • Easy to use with Arduino/ESP8266
  • Affordable

Cons:

  • Lower accuracy than Atlas Scientific
  • Requires calibration

Resources:

⚡ Chlorine Sensors

Chlorine sensor selection depends on your requirements and budget:

⚡ Option 1: Electrochemical Chlorine Sensor

Specifications:

  • Range: 0-10 ppm (free chlorine)
  • Resolution: 0.1 ppm
  • Accuracy: ±0.5 ppm
  • Response Time: < 2 minutes
  • Interface: Analog voltage
  • Lifespan: 1-2 years

Pros:

  • Direct measurement
  • Real-time monitoring
  • Good accuracy

Cons:

  • Requires regular calibration
  • Limited lifespan
  • Sensitive to temperature and pH

Note: Many electrochemical chlorine sensors require specific calibration procedures and may have cross-sensitivity to other chemicals.

⚡ Option 2: Optical Chlorine Sensor

Specifications:

  • Range: 0-10 ppm
  • Resolution: 0.1 ppm
  • Accuracy: ±0.2 ppm
  • Interface: I2C or UART
  • Lifespan: 2-5 years

Pros:

  • No calibration needed (factory calibrated)
  • Long lifespan
  • Less sensitive to interference

Cons:

  • Expensive
  • Complex optical design
  • May require specific light sources

⚡ Option 3: DPD Colorimetric Method

Specifications:

  • Range: 0-10 ppm
  • Resolution: 0.1 ppm
  • Accuracy: ±0.2 ppm
  • Interface: Analog (color intensity)
  • Method: Chemical reaction with DPD reagent

Pros:

  • Standard method used in test kits
  • Good accuracy
  • Well understood chemistry

Cons:

  • Requires reagent tablets or powder
  • Manual process (unless automated)
  • Reagents have limited shelf life

Note: DPD method can be automated with a peristaltic pump and colorimeter, but this adds significant complexity.

⚡ Temperature Sensor (Optional)

Recommended: DS18B20 Waterproof Temperature Sensor

Specifications:

  • Range: -55°C to +125°C
  • Accuracy: ±0.5°C
  • Resolution: 9-12 bits (configurable)
  • Interface: OneWire
  • Waterproof: Yes (stainless steel probe)
  • Cable Length: 1m (standard)

Pros:

  • Affordable
  • Waterproof
  • Easy to use with ESP8266
  • No calibration needed

Cons:

  • Requires pull-up resistor
  • Limited to 12 sensors per OneWire bus

Resources:


⚡ Circuit Design

⚡ Basic Circuit (pH Only)

This is the simplest configuration for pH monitoring only.

ESP8266 Development Board (WeMos D1 Mini)
   
   3.3V [ pH Sensor VCC ]
   GND [ pH Sensor GND ]
   A0  [ pH Sensor Output ]
   
   pH Sensor Board (14core)
   
   BNC Connector [ pH Electrode Probe ]

Wiring Details:

ESP8266 PinWeMos D1 PinpH Sensor PinNotes
3.3V3V3VCCPower (3.3V)
GNDGGNDGround
A0A0OutputAnalog output

Important Notes:

  • Use 3.3V power, not 5V (most pH sensors are 3.3V compatible)
  • Keep wire lengths as short as possible to minimize noise
  • Use shielded cable for the analog signal if possible
  • Avoid running sensor cables parallel to power cables

⚡ Advanced Circuit (pH + Temperature)

This configuration adds temperature monitoring for pH compensation.

ESP8266 Development Board (WeMos D1 Mini)
   
   3.3V [ pH Sensor VCC ]
   3.3V [ DS18B20 VCC ] (via 4.7kΩ pull-up)
   GND [ pH Sensor GND ]
   GND [ DS18B20 GND ]
   A0  [ pH Sensor Output ]
   D2  [ DS18B20 DATA ] (OneWire)
   
   pH Sensor Board
   
   BNC Connector [ pH Electrode Probe ]
   
   DS18B20 Waterproof Sensor

Wiring Details:

ESP8266 PinWeMos D1 PinComponentNotes
3.3V3V3pH Sensor VCCPower
3.3V3V3DS18B20 VCCPower (via pull-up)
GNDGpH Sensor GNDGround
GNDGDS18B20 GNDGround
A0A0pH Sensor OutputAnalog input
D4D2DS18B20 DATAOneWire data (with 4.7kΩ pull-up to 3.3V)

DS18B20 Pull-up Resistor:

  • Value: 4.7kΩ
  • Connection: Between DS18B20 DATA line and 3.3V
  • Important: Required for OneWire communication

⚡ Complete Circuit (pH + Chlorine + Temperature + ADC)

This configuration adds chlorine monitoring and uses an external ADC for better precision.

ESP8266 Development Board (WeMos D1 Mini)
   
   3.3V [ pH Sensor VCC ]
   3.3V [ Chlorine Sensor VCC ]
   3.3V [ ADS1115 VCC ]
   3.3V [ DS18B20 VCC ] (via 4.7kΩ pull-up)
   GND [ pH Sensor GND ]
   GND [ Chlorine Sensor GND ]
   GND [ ADS1115 GND ]
   GND [ DS18B20 GND ]
   
   SDA (D2) [ ADS1115 SDA ]
   SCL (D1) [ ADS1115 SCL ]
   
   ADS1115 Channel 0 [ pH Sensor Output ]
   ADS1115 Channel 1 [ Chlorine Sensor Output ]
   
   D4 [ DS18B20 DATA ] (OneWire)
   
   pH Sensor Board
   BNC Connector [ pH Electrode Probe ]
   
   Chlorine Sensor
   
   DS18B20 Waterproof Sensor

Wiring Details:

ESP8266 PinWeMos D1 PinComponentNotes
3.3V3V3All sensors VCCPower
GNDGAll sensors GNDGround
D2D2ADS1115 SDAI2C Data
D1D1ADS1115 SCLI2C Clock
D4D2DS18B20 DATAOneWire data (with pull-up)

ADS1115 Connections:

  • A0 → pH Sensor Output
  • A1 → Chlorine Sensor Output
  • A2, A3 → Available for future sensors

Benefits of External ADC:

  • 16-bit resolution (vs 10-bit on ESP8266)
  • Programmable gain (1x, 2x, 4x, 8x, 16x)
  • Differential inputs for better noise rejection
  • Multiple channels for multiple sensors

⚡ Pin Assignment (WeMos D1 Mini)

FunctionESP8266 PinWeMos D1 PinNotes
pH Sensor VCC3.3V3V3Power
pH Sensor GNDGNDGGround
pH Sensor OutputA0A0Analog input
Chlorine Sensor VCC3.3V3V3Power
Chlorine Sensor GNDGNDGGround
Chlorine Sensor OutputA0A0Analog (or use ADC)
DS18B20 VCC3.3V3V3Power (via pull-up)
DS18B20 GNDGNDGGround
DS18B20 DATAGPIO2D4OneWire data
I2C SDAGPIO4D2For ADC and I2C sensors
I2C SCLGPIO5D1For ADC and I2C sensors
OLED SDAGPIO4D2Shared with I2C
OLED SCLGPIO5D1Shared with I2C

Note: I2C is a shared bus, so multiple I2C devices (ADS1115, OLED, Atlas Scientific sensors) can share the same SDA/SCL pins.

⚡ Pinout Diagrams

WeMos D1 Mini:

WeMos D1 Mini Pinout

ESP-12E/12F:

ESP-12E Pinout


⚡ Assembly Instructions

⚡ Step 1: Prepare Components

  1. Gather all parts from the BOM
  2. Inspect sensors for damage
  3. Test pH electrode (if new, it may be dry; soak in storage solution for 24 hours)
  4. Prepare tools and workspace

⚡ Step 2: Breadboard Prototyping (Recommended)

Best for: Testing before permanent installation, learning the circuit.

  1. Place ESP8266 on breadboard

    • Straddle the center gap
    • Ensure all pins are properly inserted
  2. Connect pH sensor

    • Connect VCC to 3.3V rail
    • Connect GND to GND rail
    • Connect Output to A0
  3. Add DS18B20 (optional)

    • Connect VCC to 3.3V rail (via 4.7kΩ pull-up resistor)
    • Connect GND to GND rail
    • Connect DATA to D4 (WeMos D1 Mini)
  4. Add ADS1115 (optional)

    • Connect VCC to 3.3V rail
    • Connect GND to GND rail
    • Connect SDA to D2
    • Connect SCL to D1
    • Connect pH sensor to A0
    • Connect chlorine sensor to A1
  5. Verify connections

    • Use multimeter to check continuity
    • Ensure no short circuits
    • Verify all connections are secure

⚡ Step 3: Test Sensors

  1. Test pH sensor:

    • Upload test firmware
    • Calibrate with pH 7.0 solution
    • Test with pH 4.0 and pH 7.0 solutions
    • Verify readings are stable and accurate
  2. Test DS18B20 (if installed):

    • Upload test firmware
    • Place sensor in water
    • Verify temperature readings
  3. Test ADS1115 (if installed):

    • Upload test firmware
    • Verify analog readings from both channels

⚡ Step 4: Permanent Assembly

Best for: Final installation, outdoor use, long-term operation.

Option A: Perfboard

  1. Plan component layout on perfboard
  2. Solder ESP8266 with pin headers for easy removal
  3. Solder sensor modules with sufficient spacing
  4. Add screw terminals for:
    • Power input (3.3V/GND)
    • Sensor connections
  5. Solder resistors directly between pins
  6. Add test points for debugging

Option B: Custom PCB

For production or multiple units, consider designing a custom PCB:

  1. Design schematic using KiCad or Eagle
  2. Create PCB layout
  3. Order PCB from manufacturer (JLCPCB, PCBWay, etc.)
  4. Solder components to PCB
  5. Test thoroughly

⚡ Step 5: Enclosure Assembly

  1. Prepare enclosure:

    • Drill holes for:
      • Sensor cables (use cable glands)
      • Power input
      • Optional: Display window
    • Add mounting points for PCB/perfboard
  2. Install electronics:

    • Mount PCB/perfboard in enclosure
    • Connect sensor cables
    • Add desiccant packs
  3. Install sensors:

    • Mount pH electrode in sensor holder
    • Position chlorine sensor (if applicable)
    • Route cables through cable glands
  4. Seal enclosure:

    • Ensure all cable glands are tight
    • Check for waterproof integrity
    • Test with water spray (if possible)

⚡ Sensor Installation

⚡ pH Sensor Installation

Location:

  • Place sensor in pool water, away from returns and skimmers
  • Depth: 30-50 cm below surface
  • Avoid placing near pump intakes or heaters
  • Ensure good water circulation around sensor

Mounting Options:

  1. Floating Mount:

    • Sensor floats on surface
    • Easy to install and remove
    • May be affected by surface debris
  2. Wall Mount:

    • Sensor mounted to pool wall
    • Stable position
    • Requires drilling
  3. Weighted Base:

    • Sensor rests on pool floor
    • Stable position
    • May collect debris

Cable Routing:

  • Use waterproof cable for external installations
  • Keep cable runs as short as possible
  • Use cable ties for strain relief
  • Avoid sharp bends or pinching cables
  • Route cables away from pool edges to prevent damage

⚡ Chlorine Sensor Installation (if applicable)

Location: Similar to pH sensor

Considerations:

  • May need separate enclosure if using DPD method
  • Protect from direct sunlight
  • Ensure good water flow around sensor
  • Avoid chemical feed points (can cause false readings)

⚡ Temperature Sensor Installation (if applicable)

Location:

  • Same location as pH sensor (for temperature compensation)
  • Or in return line for average pool temperature

Mounting:

  • Use sensor holder or weighted base
  • Ensure sensor is fully submerged
  • Protect from direct sunlight

⚡ Power Supply

⚡ Power Requirements

ComponentVoltageCurrentNotes
ESP82663.3V~80mA (active)~20mA (sleep)
pH Sensor3.3V~10mA
Chlorine Sensor3.3V~10mAVaries by sensor
DS18B203.3V~1mA
ADS11153.3V~1mA
OLED Display3.3V~20mA
Total (Active)3.3V~120mA
Total (Sleep)3.3V~30mAWithout display

⚡ Power Options

OptionProsConsRecommended
USB PowerSimple, widely availableRequires outlet nearby✅ For indoor/testing
USB Power BankPortable, no wiringLimited runtime✅ For temporary setup
5V Power SupplyStable, continuousRequires wiring✅ For permanent install
Solar PowerAutonomous, no wiringComplex, weather dependent⚡ For advanced users
Battery + SolarBest of both worldsMost complex⚡ For remote locations

⚡ Solar Power Option

For autonomous operation, consider solar power:

Components:

  • Solar Panel: 5V/2W (for continuous operation)
  • LiPo Battery: 3.7V/2000mAh (for night operation)
  • Charge Controller: TP4056 module
  • Boost Converter: MT3608 (3.7V to 5V)

Circuit:

Solar Panel (5V) [ TP4056 Charge Controller ]
                                  |
LiPo Battery (3.7V) [ MT3608 Boost Converter ]
                                  |
ESP8266 (5V input) [ AMS1117 3.3V Regulator ]
                                  |
All Sensors (3.3V)

Considerations:

  • Panel size: 2W panel provides ~400mA in full sun
  • Battery capacity: 2000mAh lasts ~16 hours at 120mA
  • Deep sleep: Use deep sleep to extend battery life
  • Enclosure: Ensure panel and battery are protected

⚡ Maintenance

⚡ Regular Maintenance Schedule

TaskFrequencyNotes
Clean pH electrodeWeeklyRinse with storage solution
Calibrate pH sensorMonthlyUse pH 4.0 and 7.0 solutions
Check chlorine sensorMonthlyVerify readings with test strips
Inspect enclosureMonthlyCheck for water ingress, condensation
Test MQTT connectionMonthlyVerify data is being published
Replace pH electrodeAnnuallyOr when readings become unreliable
Replace calibration solutionsEvery 3-6 monthsOr when contaminated
Check power supplyQuarterlyVerify stable voltage
Inspect cablesQuarterlyCheck for damage or wear

⚡ pH Sensor Maintenance

Cleaning:

  1. Remove sensor from pool
  2. Rinse with distilled water
  3. Gently clean electrode with soft cloth
  4. Soak in storage solution for 1 hour
  5. Recalibrate if necessary

Storage:

  • Short-term (< 1 week): Store in pH 7.0 buffer solution
  • Long-term (> 1 week): Store in storage solution
  • Never store dry (will damage electrode)

Troubleshooting:

  • Readings unstable: Clean electrode, check for air bubbles
  • Readings inaccurate: Recalibrate, check for contamination
  • Readings drift: Replace electrode (typically lasts 1-2 years)
  • No response: Check connections, verify power

⚡ Chlorine Sensor Maintenance

Maintenance depends on sensor type:

Electrochemical:

  • Calibrate monthly or as needed
  • Replace annually or when readings become unreliable
  • Store dry when not in use

Optical:

  • Clean optical window monthly
  • Verify calibration quarterly
  • Replace every 2-5 years

DPD Colorimetric:

  • Replace reagent tablets as needed
  • Clean colorimeter window monthly
  • Calibrate with known standards

⚡ Troubleshooting

⚡ Common Issues

IssuePossible CauseSolution
pH readings unstableDirty electrodeClean electrode with storage solution
pH readings inaccurateNeeds calibrationRecalibrate with pH 4.0 and 7.0
pH readings driftOld electrodeReplace electrode
No MQTT messagesWiFi connection issueCheck WiFi credentials and signal
MQTT connected but no dataSensor wiring issueCheck sensor connections
Sensor not respondingPower issueCheck power supply to sensor
Condensation in enclosurePoor ventilationAdd ventilation or desiccant
ESP8266 not startingPower issueCheck USB cable, power supply
Analog readings noisyLong wires, no shieldingUse shielded cable, shorten wires

⚡ Debugging Steps

  1. Check power:

    • Verify 3.3V at ESP8266
    • Verify 3.3V at sensors
    • Check for short circuits
  2. Check connections:

    • Verify all wires are properly connected
    • Check for cold solder joints
    • Use multimeter to test continuity
  3. Test sensors individually:

    • Test pH sensor with known solutions
    • Test DS18B20 with known temperatures
    • Test ADS1115 with simple voltage input
  4. Check serial output:

    • Upload debug firmware
    • Monitor serial output for error messages
    • Verify sensor readings in serial monitor
  5. Test MQTT:

    • Verify WiFi connection
    • Test MQTT with simple client
    • Check broker logs

⚡ Safety Considerations

⚠️ Electrical Safety

  • Use low voltage (3.3V/5V) for all electronics
  • Keep electronics dry — Use waterproof enclosures
  • Use waterproof connectors for all outdoor connections
  • Ground all metal parts if possible
  • Use RCD/FI protection for any mains-powered components
  • Avoid working on circuit when connected to power

⚠️ Chemical Safety

  • Handle calibration solutions with care — Some may be corrosive
  • Wear gloves when handling sensors and solutions
  • Avoid skin contact with calibration solutions
  • Rinse with water if solution contacts skin
  • Dispose of old solutions properly — Follow local regulations
  • Store chemicals properly — In original containers, labeled

⚠️ Pool Safety

  • Do not rely solely on this monitor for pool safety
  • Regularly test water manually with test strips or kits
  • Follow local health department guidelines for pool water quality
  • Keep pool chemicals properly stored and labeled
  • Never mix chemicals — Can cause dangerous reactions
  • Ensure proper ventilation when handling chemicals

⚡ Additional Resources

⚡ Datasheets

⚡ Pinout References

⚡ External Resources


Happy building! ✅\n \n Made with ❤️ by the Smart Swimming Pool community

Last updated on