How to make my pool heating system smart

MicroController
Posts: 1706
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: How to make my pool heating system smart

Postby MicroController » Fri Oct 20, 2023 4:25 pm

Are you powering the sensor over the DQ line ("parasitic power")?

https://www.analog.com/en/technical-art ... works.html

Things to try:
1. changing the sample timing of the 1-wire signals
2. lower the slew rate ("drive strength") of the ESP's IO pin (gpio_set_drive_capability(...))
3. lower the value of the data line's pull-up resistor; you can try down to about 1kOhm or so.
4. create an "active pull-up" via an extra GPIO pin (and a resistor)
5. power the sensor from a dedicated power line instead of via DQ.

I don't know which, if any, of 1, 2 & 4 are directly supported in esphome.

icebrian
Posts: 13
Joined: Wed Jul 12, 2023 4:56 pm

Re: How to make my pool heating system smart

Postby icebrian » Fri Oct 20, 2023 5:20 pm

Yay, figured it out!

Gave it 5v instead of 3.3 and all is working now!

Will go into deeper analysis in final results and post back with a final wiring diagram for reference purposes!

MicroController
Posts: 1706
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: How to make my pool heating system smart

Postby MicroController » Fri Oct 20, 2023 9:13 pm

Glad you got it working :)

I'd caution against sending 5V into an ESP's IO pins though as this may cause issues on the 3.3V power rail and/or damage the ESP over time.

icebrian
Posts: 13
Joined: Wed Jul 12, 2023 4:56 pm

Re: How to make my pool heating system smart

Postby icebrian » Sat Dec 02, 2023 4:30 pm

Hi,

Sorry for delay in with my final reply. Autumn arrived, and with it pool usage diminished and will to get everything up and running quickly also diminished, anyways have finally completed everything and have final result.

So firstly, let me summarize what happened in the meantime in bullets:
  • When I changed to 5v, even thou it seemed to work, readings ended up being random, with most of the times not having a correct reading
  • At a later stage I also started getting other problems with connecting to wifi with "Auth Expired"
  • Eventually I changed my wiring setup (see bellow), which fixed the "Auth Expired", however, readings from the pool where mostly still not working
  • Changed power supply to one I knew for sure was a good power supply
  • Also changed platform from "dallas" to "dallasng"
  • Now everything is working great, with the 30m cable and thus getting readings from the pool
Here is final wiring diagram:
final diagram.png
final diagram.png (346.9 KiB) Viewed 5262 times
Here is final esphome code:

Code: Select all

esphome:
  name: pool-sensors
  on_boot:
    priority: 200  
    then:
      - wait_until:  
          condition:
            wifi.connected: 
          timeout: 30s

esp32:
  board: nodemcu-32s
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: "REMOVED"

wifi:
  ssid: "SSID"
  password: "REMOVED"
    
external_components:
  - source: github://nrandell/dallasng
    
dallasng:
  - pin: GPIO17
    
sensor:
  - platform: dallasng
    address: 0x876c6ef6442c7628
    name: "Pool Dallas Temperature Sensor"
    resolution: 10
    filters:
      - filter_out: NaN
  - platform: adc
    pin: GPIO33
    name: "Pool Voltage Sensor"
    update_interval: 60s
    accuracy_decimals: 0
    raw: true
    filters:
      - multiply: 0.095238
      - lambda: !lambda |-
          if (x < 6) {
            return 0;
          } else {
            return 220;
          }
output:
In term of components here is my final list: and to you MicroController, many thanks for supporting me through this journey! Its been a great learning experience!

Thank you and all the best!

Who is online

Users browsing this forum: Bing [Bot] and 69 guests