ESPHOME -Water pressure sensor - do not get correct values

Water pressure sensor - do not get correct values

I’m trying to use esphome to measure the water pressure using sensors. Board is an ESP32-WROOM32 and the sensors are from DFRobot SEN0257 Analog Water Pressure Sensor.

But I always get negative values (even if the voltage at the analog port is positive) and can’t find out what I’m doing wrong or can it be that filters: calibrate_linear doesn't work?

ESPHome version 1.17.1

[18:30:25][D][adc:058]: 'Heizung "Wasserdruck Rücklauf"': Got voltage=0.35V
[18:30:27][D][adc:058]: 'Heizung "Wasserdruck Vorlauf"': Got voltage=0.34V
[18:30:27][D][sensor:099]: 'Heizung "Wasserdruck Vorlauf"': Sending state -0.72707 bar with 2 decimals of accuracy
[18:30:27][D][sensor:099]: 'Heizung "Wasserdruck bar Delta"': Sending state 0.02177 bar with 2 decimals of accuracy

[18:30:34][D][adc:058]: 'Heizung "Wasserdruck Warmwasser"': Got voltage=0.05V
[18:30:35][D][adc:058]: 'Heizung "Wasserdruck Rücklauf"': Got voltage=0.35V

[18:30:37][D][adc:058]: 'Heizung "Wasserdruck Vorlauf"': Got voltage=0.36V
[18:30:37][D][sensor:099]: 'Heizung "Wasserdruck Vorlauf"': Sending state -0.62694 bar with 2 decimals of accuracy
[18:30:37][D][sensor:099]: 'Heizung "Wasserdruck bar Delta"': Sending state -0.07837 bar with 2 decimals of accuracy

Pressure Values for DFRobot SEN0257 Analog Water Pressure Sensor
SKU-SEN0257_values

## #############################################
## ESP32 DEV  - HEIZUNG 2021 - SENSOREN
## #############################################
##  - Chip Family: ESP32
##  - Chip Model: ESP32D0WDQ6 (revision 1)
##  - Number of Cores: 2
##  - Max CPU Frequency: 240MHz
##  - Has Bluetooth: YES
##  - Has Embedded Flash: NO
##  - Has Factory-Calibrated ADC: YES
##  - Flash Size: 4MB
##  - Flash Frequency: 80MHz
##  - tftx =240 tfty =320
## #############################################

# https://community.home-assistant.io/t/water-filter-quality-and-water-softener-status/184071

## ----------------------------------------------------------------
## used PINS on ESP32 DEV
## ----------------------------------------------------------------
##
##   GPIO21: Rtttl Buzzer
##
##   GPIO05: ili9341 TFT_CS
##   GPIO04: ili9341 TFT_DC
##   GPIO15: ili9341 TFT_LED
##   GPIO22: ili9341 TFT_RST
##   GPIO23: ili9341 TFT_MOSI
##   GPIO18: ili9341 TFT_CLK
##   GPIO19: ili9341 TFT_MISO
##
##   GPIO17: ✔︎ DS18B20 4 x Digital temperature sensor
##   GPIO12: WATERMETER pulse_counter
##
##   GPIO37: MQ2 GAS SENSIR
##
##   GPIO34: DFRobot SEN0257 Analog Water Pressure Sensor
##   GPIO35: DFRobot SEN0257 Analog Water Pressure Sensor
##   GPIO32: DFRobot SEN0257 Analog Water Pressure Sensor
##
## ----------------------------------------------------------------

substitutions:
  device_id: "heizung2021"
  device_name: "heizung"
  device_name_upper: "Heizung"
  update_time: 10s
  publish_interval: 60s
  device_name_short: heizung2021
  platform: ESP32
  board: esp32dev
  # board: az-delivery-devkit-v4
  appversion: "1.0.0"
  topic_prefix: "ems-heizung"
  device_description: "Heizungssensoren Temperatur, Wasserdruck"

esphome:
  name: $device_name_short
  comment: ${device_description}
  platform: ${platform}
  board: ${board}
  arduino_version: latest

  # If buzzer is enabled, notify on api connection success  
  on_boot:
    priority: -10
    then:
      - logger.log: API is connected!
      - rtttl.play: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b"

logger:
  level: DEBUG
  logs:
    mqtt.component: ERROR
    mqtt.client: ERROR

<<: !include common/wifi.yaml
<<: !include common/mqtt.yaml

# ----------------------------------------------------------------
# Display ili9341: Ok is working
# ----------------------------------------------------------------
<<: !include common/inludes/ili9341_heizung.yaml

# ----------------------------------------------------------------
# Rtttl Buzzer: Ok is working
# ----------------------------------------------------------------
output:
  - platform: ledc
    pin: GPIO21
    id: rtttl_out
rtttl:
  output: rtttl_out

# ----------------------------------------------------------------
# GPIO02: used for temperatur sensors data wired
# Ok is working
# ----------------------------------------------------------------
dallas:
  pin: GPIO17
  update_interval: 30s

# ----------------------------------------------------------------
# Sun component: Ok is working
# see: https://esphome.io/components/sun.html
# ----------------------------------------------------------------
sun:
  id: sun_sun
  latitude: !secret home_latitude
  longitude: !secret home_longitude

# ----------------------------------------------------------------
# Time component: Ok is working
# ----------------------------------------------------------------
time:
  - platform: sntp
    id: sntp_time
    timezone: Europe/Zurich
    servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org
      - 2.pool.ntp.org

# ----------------------------------------------------------------
# ALL SENSORS
# ----------------------------------------------------------------
sensor:
  # -------------------------------------
  # GPIO12: warm water meter...
  # -------------------------------------
  - platform: pulse_counter
    pin: GPIO12
    unit_of_measurement: "m3"
    name: ${device_name_upper} "Warmwasser 12"
    id: heatingwater_meter
    accuracy_decimals: 3
    state_topic: ${topic_prefix}/heatingwater_meter_current
    filters:
      - multiply: 0.06
    total:
      unit_of_measurement: "m3"
      name: ${device_name_upper} "Warmwasser gesamt"
      id: heatingwater_meter_total
      accuracy_decimals: 3
      filters:
        - multiply: 0.001

  # -------------------------------------------------------------------------------
  # Gravity: Analog Water Pressure Sensor DFRobot SEN0257 
  # -------------------------------------------------------------------------------
  # On the ESP32 pins GPIO32 through GPIO39 can be used.
  # ADC1_CH0 (GPIO 36)
  # ADC1_CH1 (GPIO 37)
  # ADC1_CH2 (GPIO 38)
  # ADC1_CH3 (GPIO 39)
  # ADC1_CH4 (GPIO 32)
  # ADC1_CH5 (GPIO 33)
  # ADC1_CH6 (GPIO 34)
  # ADC1_CH7 (GPIO 35)
  # ADC_CHANNEL_0, // GPIO36
  # ADC_CHANNEL_3, // GPIO39
  # DC_CHANNEL_4, // GPIO32
  # ADC_CHANNEL_5, // GPIO33
  # ADC_CHANNEL_6  // GPIO34

  # --------------------------------------------------------------------
  # MQ2 Gas Sensor Methane, Butane, LPG, smoke
  # --------------------------------------------------------------------
  # - GND, + 5V, A0 --> GPIO33
  # (Digital --> GPIO2) ???
  # see: https://community.home-assistant.io/t/esphome-based-smoke-alarm/110221/15
  # -----------------------------------------------------
  - platform: adc
    pin: GPIO33
    name: ${device_name_upper} "Gas Sensor"
    id: mq2_gas
    state_topic: ${topic_prefix}/gasmelder
    update_interval: ${update_time}
    filters:
      - multiply: 100
    unit_of_measurement: "%"

  # ------------------------------------------------------------------------
  # DFRobot SEN0257 water pressure sensor 1 GPIO 34
  # ------------------------------------------------------------------------
  - platform: adc
    name: ${device_name_upper} "Wasserdruck Vorlauf"
    pin: GPIO34
    id: outgoing_water_pressure
    update_interval: 10s
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    attenuation: 11db
    state_topic: ${topic_prefix}/wasserdruck_vorlauf
    on_value:
      then:
        - component.update: delta_water_pressure
    filters:
      - calibrate_linear:
        - 0.5 -> 0.0
        - 4.0 -> 16.00
      - throttle: 10s
      - or:
          - heartbeat: 300s
          - delta: 0.04
    
    # ------------------------------------------------------------------------
    # DFRobot SEN0257 water pressure sensor 2 GPIO 35
    # ------------------------------------------------------------------------
  - platform: adc
    pin: GPIO35
    id: incoming_water_pressure
    name: ${device_name_upper} "Wasserdruck Rücklauf"
    state_topic: ${topic_prefix}/wasserdruck_ruecklauf
    update_interval: 10s
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    attenuation: 11db
    filters:
      - calibrate_linear:
        - 0.5 -> 0.0
        - 4.0 -> 16.00
      - throttle: 10s
      - or:
          - heartbeat: 300s
          - delta: 0.04

  # ------------------------------------------------------------------------
  # DFRobot SEN0257 water pressure sensor 3 GPIO 33
  # ------------------------------------------------------------------------
  - platform: adc
    pin: GPIO33
    id: boiler_water_pressure
    name: ${device_name_upper} "Wasserdruck Warmwasser"
    state_topic: ${topic_prefix}/wasserdruck_warmwasser
    update_interval: 10s
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    attenuation: 11db  
    filters:
      - calibrate_linear:
        - 0.5 -> 0.0
        - 4.0 -> 16.00
      - throttle: 10s
      - or:
          - heartbeat: 300s
          - delta: 0.04
  
  # ------------------------------------------------------------------------
  # Templates water pressure sensors
  # ------------------------------------------------------------------------
  - platform: template
    name: ${device_name_upper} "Wasserdruck bar Delta"
    id: delta_water_pressure
    update_interval: never
    unit_of_measurement: "bar"
    icon: "mdi:kettle-alert"
    accuracy_decimals: 2
    state_topic: ${topic_prefix}/wasserdruck_delta
    lambda: |-
      return ((id(incoming_water_pressure).state - id(outgoing_water_pressure).state));

  # ------------------------------------------------------------------------------
  # PIN GIPO17: DS18B20 Digital temperature sensor 1
  # For this, connect a resistor of about 4.7KΩ (values around that like 1KΩ will, 
  # if you don’t have massively long wires, work fine in most cases) 
  # between 3.3V and the data pin.
  # Found sensors:
  # [17:37:16][D][dallas.sensor:082]:     0x2300000C8683F828
  # [17:37:16][D][dallas.sensor:082]:     0x943C01B556E7A428
  # [17:37:16][D][dallas.sensor:082]:     0x8C00000C8681BB28
  # [17:37:16][D][dallas.sensor:082]:     0x7900000C8579C728
  # ------------------------------------------------------------------------------
  - platform: dallas
    #index: 0
    address: 0x2300000C8683F828
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    icon: mdi:thermometer"
    name: ${device_name_upper} Vorlauf
    id: heating_temp_outgoing
    state_topic: ${topic_prefix}/temp_vorlauf

  # -----------------------------------------------
  # PIN D2: DS18B20 Digital temperature sensor 2
  # -----------------------------------------------
  - platform: dallas
    #index: 1
    address: 0x943C01B556E7A428
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    name: ${device_name_upper} Rücklauf
    id: heating_temp_incomming
    state_topic: ${topic_prefix}/temp_ruecklauf
    on_value:
      then:
        - component.update: delta_heating_water_temp 

  # -----------------------------------------------
  # PIN D2: DS18B20 Digital temperature sensor 3
  # -----------------------------------------------
  - platform: dallas
    #index: 2
    address: 0x8C00000C8681BB28
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    name: ${device_name_upper} Warmwasser
    id: heating_temp_warmwater
    state_topic: ${topic_prefix}/temp_warmwasser

  # -----------------------------------------------
  # PIN D2: DS18B20 Digital temperature sensor 4
  # -----------------------------------------------
  - platform: dallas
    #index: 3
    address: 0x7900000C8579C728
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    name: ${device_name_upper} Raumtemperatur
    id: heating_temp_room
    state_topic: ${topic_prefix}/temp_heizungsraum

  # -----------------------------------------------
  # Delta temperature outgoing to incomming
  # -----------------------------------------------
  - platform: template
    name: ${device_name_upper} Temperatur Spreizung
    id: delta_heating_water_temp
    update_interval: never
    unit_of_measurement: "°C"
    icon: "mdi:gauge-low"
    accuracy_decimals: 2
    state_topic: ${topic_prefix}/temp_spreizung
    lambda: |-
      return (id(heating_temp_outgoing).state - id(heating_temp_incomming).state);

  # -----------------------------------------------
  # additional sensors
  # -----------------------------------------------
  - platform: wifi_signal
    name: ${device_name_upper} WiFi Signal
    id: heating_wifi_signal
    update_interval: 60s

  - platform: uptime
    name: Uptime Sensor
    id: uptime_sensor
    update_interval: 60s
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            state: !lambda |-
              int seconds = round(id(uptime_sensor).raw_state);
              int days = seconds / (24 * 3600);
              seconds = seconds % (24 * 3600);
              int hours = seconds / 3600;
              seconds = seconds % 3600;
              int minutes = seconds /  60;
              seconds = seconds % 60;
              return (
                (days ? String(days) + "d " : "") +
                (hours ? String(hours) + "h " : "") +
                (minutes ? String(minutes) + "m " : "") +
                (String(seconds) + "s")
              ).c_str();

<<: !include common/textsensor.yaml
3 Likes

You could try to

    filters:
      - multiply: -1

Thanks, now I get positive values, but they can’t be correct because I have no water pressure and the values always fluctuate.

# -----------------------------------------------------
  # DFRobot SEN0257 water pressure sensor 3 GPIO 33
  # -----------------------------------------------------
  - platform: adc
    pin: GPIO33
    id: boiler_water_pressure
    name: ${device_name_upper} "Wasserdruck Warmwasser"
    state_topic: ${topic_prefix}/wasserdruck_warmwasser
    update_interval: 10s
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    attenuation: 11db  
    filters:
      - calibrate_linear:
        - 0.5 -> 0.0
        - 4.0 -> 16.00
      - multiply: -1 
      - throttle: 10s
      - or:
          - heartbeat: 300s
          - delta: 0.04

The 2nd linear calibration you have set is like multiplying by 4. Can you comment out that filter and see what you get . If it’s not too hard disconnect the power to the other sensors just to rule out some type of power fluctuation.

About the linear calibration.

You have defined it that 0.5 volt should result in 0 bar.
But then the adc measures 0.34. The will then be a negative number.

So the question is why you get a value below 0.5 volt out.

Two suggestions:
The first:
The adc in esp32 is VERY noisy compared to an arduino uno.

When I use esp3286 which also has a crappy adc I sample alot more and the filter the values.
with filter

  - exponential_moving_average:
      alpha: 0.01
      send_every: 100

This means that it make an avarage on aproximate the latest 100 values and send the value to the next filter or output every 100 value.

But that means that you have to decrease update_interval to 0.1 s.
But due to the filter it will send a value every 10 s.

I would skip the linear calibration until you know that you get good data out.

If you don’t get proper adc values. I suggest is to buy a ads1115 adc.The ADS1115 can measure 4 adc signals.

I have used it when I needed to measure the difference between two analog signals.

The second theory.
I also saw that you have a resistor in your wiring diagram. According to the pdf from dfrobot there should not be any there. The sensor output a voltage which should go directly to the adc.

I hope you get it to work.
/Mattias

Great, thanks for the help.

oops, yes this is true - got it thanks.
Now i use my one filter.

Yes it was for me only for testing. Now i use the sensor w/o a resistor.

New test between ESP ADC and ADS1115:

ADC PORT GPIO35

  # ---------------
  # ADC PORT GPIO35
  # ---------------
  - platform: adc
    name: "SEN0257 39"
    pin: GPIO35
    id: pressure
    icon: "mdi:gauge-low"
    update_interval: 5s
    state_topic: ${topic_prefix}/wasserdruck_vorlauf
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    filters:
      - offset: -0.25 # Calibration
      - lambda: return ((x * 5.00) / 1024.00) * 40.00 ;

ADS1115 PORT A0_GND

  # --------------------
  # ADS1115 PORT A0_GND
  # --------------------
  - platform: ads1115 
    multiplexer: 'A0_GND'
    gain: 6.144
    update_interval: 5s
    name: "Wasserdruck Vorlauf"
    id: outgoing_water_pressure
    state_topic: ${topic_prefix}/wasserdruck_rücklauf
    unit_of_measurement: "bar"
    icon: "mdi:gauge"
    accuracy_decimals: 2
    filters:
      - offset: -0.99 # Calibration
      - lambda: return ((x * 5.00) / 1024.00) * 40.00 ;

Both signals are not very constant and fluctuate. I’m still looking for how I can smooth it out and find a better method to calibrate the sensors.

But think that it is in the tolerance range.
I still have to test the whole thing with all sensors, in this case I only did a simple test to rule out other sources of error.

The ADS1115 has lower noise level. It fluctuate 0.02 compare to the adc that fluctuate 0.15.
So it almost 7 times less noisy.

Are the pressure meters not tested in air pressure or installed?
If i air maybe the dont work as good in air.

I’m not sure about the scaling you have done. It seems that it comes from the arduino uno example.
The analog read on uno gives a value between 0-1023 on the range of 5 volts. So to calculate the voltage you do (x/1024.0)*5.0 = x in volts.

The value you get here in esphome is already in volts i think.
The scaling factor should something more like (x- offset)* 4.0 to get it in bar.

/Mattias

Thanks Mattias, that with the calculation of the water pressure in bar is correct.

I have expanded my test and I can’t get any further.

# I²C Bus
i2c:
  - id: bus_b 
    scl: 26
    sda: 25
    scan: True  

ads1115:
  - address: 0x48    

sensor:
  # ---------------------------
  # SEN0257 on ADC PORT GPIO35
  # The nominal output voltage offset of the sensor is 500mV, but due to the 
  # zero-drifting of the internal circuit this may varies and an initial calibration setup is 
  # required. For calibration, connect the sensor’s 3 pin cable (VCC, GND, and SIGNAL) to the 
  # Arduino (+5V, GND, and A0) without attaching the sensor to the water pipe and run your demo program for once. 
  # Write down the lowest voltage value through the serial monitor and revise the “const float offset” value to complete calibration. 
  # After calibration, the sensor is ready for the intended purpose!
  # see: https://www.codrey.com/arduino-projects/how-to-play-with-a-water-pressure-sensor/
  # ---------------------------
  - platform: adc
    name: "SEN0257 ADC GIPO35 pressure"
    pin: GPIO35
    id: outgoing_water_pressure_raw
    icon: "mdi:gauge-low"
    update_interval: 5s
    state_topic: ${topic_prefix}/SEN0257_ADC_GPIO35
    unit_of_measurement: "bar"
    accuracy_decimals: 2
    attenuation: 11db
    filters:
      - lambda: |-
           if(x-0.41<0) return 0.00;
           return (x-0.41) * 4.00;


  # -------------------------------
  # SEN0257 on ADS1115 PORT A0_GND
  # -------------------------------
  - platform: ads1115 
    multiplexer: 'A0_GND'
    gain: 6.144
    update_interval: 5s
    name: "SEN0257 ADS1115 A0_GND"
    id: incomming_water_pressure_A0_GND
    state_topic: ${topic_prefix}/SEN0257_ads1115_A0_GND
    unit_of_measurement: "bar"
    icon: "mdi:gauge"
    accuracy_decimals: 2
    filters:
      - lambda: |-
           if(x-0.429188<0) return 0.00;
           return (x-0.429188) * 4.00;

  # -------------------------------
  # TRIM POT on ADS1115 PORT A0_GND
  # -------------------------------  
  - platform: ads1115 
    multiplexer: 'A1_GND'
    gain: 6.144
    update_interval: 5s
    name: "TRIM POT ADS1115 A1_GND"
    id: incomming_water_A1_GND
    state_topic: ${topic_prefix}/TRIM_POT_ads1115_A1_GND
    unit_of_measurement: "bar"
    icon: "mdi:gauge"
    accuracy_decimals: 2    
    filters:
      - lambda: |-
           if(x<0) return 0.00;
           return (x) * 4.00;

Result Testcase

  • Using the sensor on the ADC GIPO35 does not work because it has too high an error rate.

  • The sensor on the ADS115 works better, but here too the error is in the range of 0.15.

  • To make sure that the calculation is correct, I connected a potentiometer to the A1 port of the ADS115 and set the voltage to 1.2 volts. But I see that this does not remain constant either. This fluctuates between 960 mV and 1.02 V.

It looks like it is due to the 5V voltage of the ESP32 DEV which is not constant and therefore the fluctuations occur.

I am now looking for a solution to stabilize the 5V voltage for the sensors.

Hi.

I am no good on trying to stabilize the power. So I cannot help you there.

Do you know nature of the noise. If it is high frequency noise you can just sample with higher speed and use a sliding window filer or the exponential filter I mentioned earlier.
The sensor type of piezo resistance sensor has quite low signal to noise ration according to google. Maybe it what you going to expect?
The accuracy of the sensor is 0.5% so that means at 16 bar that is 0.08 bar accuracy at the sensor.
I think that it all depend on what you are going to use it for. How high accuracy do you need and how fast must it react to change. If you want high accuracy use a mean filter. But then you loose that ability see fast changes.

I hope you succeed to get the accuracy you need.

/Mattias

Hi Mattias,

Thanks for your Information.

I have now tried the attempt with an esp3286 and ADS1115.
Everything worked out perfectly with one sensor.

But if I connect all 4 sensors to the ADS1115, then the esp3286 behaves the same as the ESP32-WROOM32.

The problem is the signal on the data channel, which fluctuates too much if the sensor is used without it being mounted on the pipe.

Filter

- exponential_moving_average:
      alpha: 0.01
      send_every: 100

I also tried that with the filters, but when I insert this, I don’t get any more data.

I’m not sure that I followed.

The problem is the signal on the data channel, which fluctuates too much if the sensor is used without it being mounted on the pipe.

Does this mean that If you connect all sensors to the pipe. The fluctuations will be less or is it that you see problems when you have connected them all three sensors the adc that they interfere with each other.

About the filtering:

These settings send only every 100 values. That it means it will take quite a long time to get any data in your case 500s. Thats almost a value every 8 minutes.

Try to change the update interval to 1s instead of 5 for your sensors and use the filter below.
This should result in a value every 10 sec if you have change the update interval 1 s.

- exponential_moving_average:
      alpha: 0.1
      send_every: 10

The alpha is set to 0.01 that means that is approximate a mean of the last 100 values.
So If you want a mean of the last 10 values it becomes 1/10 =0.1.

The signal from the ocilloscope seems rather periodic. Do you see that same when you connect the sensor to the scope directly with out any esp connected. You could also compare it to the power supply voltage ripple. If you have a ocilioscope than you could measure things independent.

/Mattias

Hi Mattias,

Thanks for your help and time.

Negativ not on pipe, connected on ESP.

Yesterday I spent most of the day investigating the cause.

  • Filter works now (Thanks)
  • Power pack and power supply

If I use a high-quality power supply, it works better and it makes no difference whether I use the ESP32 with ADC or an ESP8266 with ADS1115.

But I only get 4.85V to the 5V connection and the SEN0257 is very sensitive to the supply voltage. If I use a potentiometer, the signals are correct and there are no errors in the measurement.

I now have to find a solution, the supply voltage for the ESP and the sensors with which I can work.

Hi

Great that you seems to understand the cause of issue.
Then you have a way forward.

Very interesting that the power supply had so much impact on the output signal/measured value for the SEN0257.

If you find a good solution to have clean power supply let me know how you did it.

Great work.
/Mattias

From the ads link you posted

continuous_mode (Optional, boolean): Set if the ADS1115 should continuously measure voltages or only measure them when an update is called. Please enable this for the CT Clamp Current Sensor integration. Defaults to off.

It sounds like you need continuous measurements, I believe you need to set this to true.

ads1115:
  - address: 0x48  
    continuous_mode: True

@Mikefila

Negative, when i use continuous_mode: True on ESP32 : Reading ADS1115 timed out

## continuous_mode: True
[08:32:00][I][mqtt:210]: MQTT Connected!
[08:32:00][I][app:059]: setup() finished successfully!
[08:32:00][W][ads1115:116]: Reading ADS1115 timed out
[08:32:00][W][ads1115:116]: Reading ADS1115 timed out
[08:32:00][W][ads1115:116]: Reading ADS1115 timed out
[08:32:00][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][I][app:105]: ESPHome version 1.18.0b3 compiled on May 15 2021, 08:31:24
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][I][main:126]: Raw Value A3: 0.490875
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:01][I][i2c:033]: Scanning i2c bus for active devices...
[08:32:01][I][i2c:040]: Found i2c device at address 0x48
[08:32:01][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out
[08:32:02][W][ads1115:116]: Reading ADS1115 timed out

## continuous_mode: False 
08:34:12][I][mqtt:210]: MQTT Connected!
[08:34:12][I][app:059]: setup() finished successfully!
[08:34:12][I][app:105]: ESPHome version 1.18.0b3 compiled on May 15 2021, 08:33:36
[08:34:13][I][i2c:033]: Scanning i2c bus for active devices...
[08:34:13][I][i2c:040]: Found i2c device at address 0x48
[08:34:13][I][main:195]: Raw Value A0: 0.046875
[08:34:13][I][main:126]: Raw Value A3: 0.490687
[08:34:13][I][main:150]: Raw Value A2: 0.494437
[08:34:13][I][main:171]: Raw Value A1: 0.487500
[08:34:14][I][main:126]: Raw Value A3: 0.491062
[08:34:14][I][main:150]: Raw Value A2: 0.494437
[08:34:14][I][main:171]: Raw Value A1: 0.487500
[08:34:15][I][main:126]: Raw Value A3: 0.490875
[08:34:15][I][main:150]: Raw Value A2: 0.494063
[08:34:15][I][main:171]: Raw Value A1: 0.487500
[08:34:16][I][main:126]: Raw Value A3: 0.491062
[08:34:16][I][main:150]: Raw Value A2: 0.494250
[08:34:16][I][main:171]: Raw Value A1: 0.487500
[08:34:17][I][main:126]: Raw Value A3: 0.490875
[08:34:17][I][main:150]: Raw Value A2: 0.494250
[08:34:17][I][main:171]: Raw Value A1: 0.487500
[08:34:18][I][main:195]: Raw Value A0: 0.047063
[08:34:18][I][main:126]: Raw Value A3: 0.490312
[08:34:18][I][main:150]: Raw Value A2: 0.494250

Hi petsie,
i’m encountering the same problem you faced an year ago. I have no stable voltage supply, and causes fluctuation on ADC wich is sampling voltabe from a CT Clamp. The fluctuation is more visible at voltage near 0.
Did you find a solution to filter out noise from ADC or to stabilize voltage supply?

Not 100%, if I use a good power supply then it gets better but I gave up because the sensors broken after 3 months.

1 Like

Same here. I’ve tried at least 3 sensors. They work for like 5 mins (enough to calibrate) and then they become very inconsistent. I’ve tried on both ESP8266 and ESP32s

Same here, 3 sensors broken after 3 months, only one is working.

I’m using one of these df robot sensors It kinda works. I get consistent readings over the last 6 months. The problem is that it reads about 240psi when it is actually 140.

I only use it to see if there is pressure not as limiter. It’s also connected to the adc on the esp.