Pool monitoring water values

Hello,

I just wanted to publish my project here. Maybe it will help one or the other.

It’s about pool monitoring/water quality.
The display takes place in HomeAssistant.
The whole thing runs on ESP-Home and that in turn was used/played in HomeAssistant.

I actually created all the sensors using the page “https://esphome.io/index.html”. I looked closely at what an analog sensor looks like AND what filters are available.

Hardware:
ESP32-WROVER-E

Pressure sensor https://www.amazon.de/dp/B07T5CSWHL?ref=ppx_yo2ov_dt_b_product_details&th=1

PH-sensor https://www.amazon.de/dp/B07QKK1XB6?psc=1&ref=ppx_yo2ov_dt_b_product_details

Calibration solution https://www.amazon.de/dp/B06XPX11L4?psc=1&ref=ppx_yo2ov_dt_b_product_details

TDS pollution https://www.amazon.de/dp/B08DGLY3J2?psc=1&ref=ppx_yo2ov_dt_b_product_details

temperature DS18B20 https://www.amazon.de/AZDelivery-digitaler-Temperatursensor-Temperaturfühler-wasserdicht/dp/B07KNQJ3D7/ref=sr_1_6?keywords=ds18b20+wasserdicht&qid=1697968258&sr=8-6

Code

esphome:
  name: esphome-xxxxxxxxx
  friendly_name: ESPHomePool

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "xxxxx"
    password: "xxxxx"

captive_portal:

dallas:
  - pin: GPIO25
    update_interval: 60s

sensor:

#TDS Sensor
# Temperature In °C
  - platform: dallas
    address: xxxxxxxx
    name: "Pool Temperatur"
    id: probe01

# Raw TDS Reading
  - platform: adc
    pin: GPIO36
    name: "TDS 01 Raw"
    attenuation: 6db # only for ESP32
    id: tds01_raw
    update_interval: 60s
    unit_of_measurement: "v"
    accuracy_decimals: 3
    internal: true
  
# Temperature Compensated Voltage
  - platform: template
    name: "TDS 01 TCV"
    id: temp01_comp_v
    unit_of_measurement: 'v'
    accuracy_decimals: 3
    lambda: 'return ((id(tds01_raw).state) / (1 + (0.02 * ((id(probe01).state) - 25.0))));'
    update_interval: 60s
    internal: true

# Temperature Compensated TDS
  - platform: template
    name: "TDS-01"
    unit_of_measurement: "PPM"
    state_class: "measurement"   
    accuracy_decimals: 0
    update_interval: 60s    
    lambda: return (133.42*(id(temp01_comp_v).state)*(id(temp01_comp_v).state)*(id(temp01_comp_v).state) - 255.86*(id(temp01_comp_v).state)*(id(temp01_comp_v).state) + 857.39*(id(temp01_comp_v).state))*0.5;

#PH Sensor
  - platform: adc
    pin: GPIO35
    name: "pH Sensor"
    update_interval: 60s
    attenuation: auto
    device_class: ""
    unit_of_measurement: "pH"
    filters:
      - calibrate_linear:
          - 1.145 -> 6.88
          - 1.319 -> 9.22

#Druck Sensor
  - platform: adc
    pin: GPIO34
    name: "Pumpe Druck"
    update_interval: 60s
    attenuation: auto
    device_class: ATMOSPHERIC_PRESSURE
    state_class: "measurement"
    unit_of_measurement: "bar"
    filters:
      - calibrate_linear:
          - 0.4 -> 0
          - 0.85 -> 0.5
          - 1.45 -> 1 
          - 2.1 -> 1.5
          - 2.9 -> 2    



#Voltlesen
#  - platform: adc
#    pin: GPIO35
#    name: "Flex 0"
#    update_interval: 1s
#    attenuation: auto

Maybe that will help someone.

1 Like

It helped me! [But, see edit, below]

I already have temperature sensors in my spa (hot tub) and wanted to expand. The next step would be a PH sensor. That’s the one value I have to check daily. There’s also Bromine, but I can pretty much estimate when I need to add more.

With a PH sensor, I wouldn’t need to go open the spa for daily checks. I didn’t realize such an easy solution existed, all wired and ready to connect to the GPIO pins of an ESP. Thanks!

Edit: I started reading more on the PH monitoring probe. Unfortunately it isn’t designed for continuous use. It’s intended to be kept dry in between measurements. Oh well. Looks like the old-fashioned test strips are still going to be the best way to monitor PH for me.

Hello,
yes, that’s really the case with the PH sensor, unfortunately it’s not intended for continuous use.