Pressure Transducer readings 'stuck' after 2-6hrs

@tom_l thanks for your help.
Anti-hammer device, new (better) soldering/wiring, correctly oriented zenner, and new transducer … and I am up and running (for now).

I do get readings over 2.4v however maybe thats due to the attenuation setting?

[17:05:10][D][sensor:094]: 'House Pressure': Sending state 54.67500 PSI with 4 decimals of accuracy
[17:05:10][D][sensor:094]: 'voltage': Sending state 2.77600 v with 4 decimals of accuracy
[17:05:12][D][sensor:094]: 'House Pressure': Sending state 54.17500 PSI with 4 decimals of accuracy
[17:05:12][D][sensor:094]: 'voltage': Sending state 3.01200 v with 4 decimals of accuracy
[17:05:14][D][sensor:094]: 'House Pressure': Sending state 54.02500 PSI with 4 decimals of accuracy
[17:05:14][D][sensor:094]: 'voltage': Sending state 3.00900 v with 4 decimals of accuracy

Spoke too soon.
Worked for a bit now stuck at 3.18v (67.15 psi)

Similar to before, after approx 2hrs of functioning, sensor stopped working properly.

hi, I might have missed in earlier posts, but have you checked the output of the sensor with a voltmeter? Does it agree with the esp32 or does it read something different?

1 Like

Ok - I am back at it and made some progress.
I now have 2 resistors in series, as displayed below.
What is strange is that it seems the max the ADC will read (it’s a new board) is 1.045v even though I took a multimeter to the ground/signal after the voltage divider and it reads higher…

My math for converting the voltage to PSI is as follows:

#BELOW outputs voltage adjusted for attentuation of the voltage divider, converted to psi
  - platform: adc
    name: "Well Pressure"
    pin: 
      number: GPIO34
      allow_other_uses: true
    id: pressure
    update_interval: 2s
    unit_of_measurement: "PSI"
    accuracy_decimals: 4
    attenuation: 0db
    filters:
    #here we adjust for R1=4.7kΩ and R2=10kΩ, as well as set the max psi on the transducer.
    #then, since transducer outputs 0.5v at 0 and 4.5v at max psi, we multiply adjust accordingly for psi readout
    - lambda: float voltage = x * 1.469; float transducer_max_psi = 150.0; return (voltage - 0.5) * (transducer_max_psi / 4.0);

This is why:

See: https://esphome.io/components/sensor/adc.html#adc-esp32-attenuation

Thanks @tom_l !
FINALLY this is working.

Here is completed solution:
Materials:

  1. ESP32 of your choice. I used this one
  2. Pressure Transducer - after 5 different ones, this has held up well.
  3. Hammer Arrestor - just in case
  4. GHT/NPT fitting and 1/2" NPT to 1/8" NPT fitting - You may not need this, depending on your application.

Results:
image
image

Here is the wiring diagram:

Here is the final working code:

sensor:
#BELOW outputs raw voltage the ADC is reading after the voltage divider
  - platform: adc
    name: "raw_voltage"
    pin: 
      number: GPIO34
      allow_other_uses: true
    id: raw_voltage
    update_interval: 4s
    unit_of_measurement: "v"
    accuracy_decimals: 4
    attenuation: auto
#BELOW outputs voltage adjusted for reduction of the voltage divider
  - platform: adc
    name: "voltage_adjusted"
    pin: 
      number: GPIO34
      allow_other_uses: true
    id: voltage_adjusted
    update_interval: 4s
    unit_of_measurement: "v"
    accuracy_decimals: 4
    attenuation: auto
    filters:
    #here we adjust for R1=4.7kΩ and R2=10kΩ
    - lambda: return x * 1.469;
#BELOW outputs voltage adjusted for attentuation of the voltage divider, converted to psi
  - platform: adc
    name: "Well Pressure"
    pin: 
      number: GPIO34
      allow_other_uses: true
    id: pressure
    update_interval: 4s
    unit_of_measurement: "PSI"
    accuracy_decimals: 4
    attenuation: auto
    filters:
    #here we adjust for R1=4.7kΩ and R2=10kΩ, as well as set the max psi on the transducer.
    #then, since transducer outputs 0.5v at 0 and 4.5v at max psi, we multiply adjust accordingly for psi readout. I had another gauge and this one was a tad higher, so I adjusted another 0.98.
    - lambda: float voltage = x * 1.469 * 0.98; float transducer_max_psi = 150.0; return (voltage - 0.5) * (transducer_max_psi / 4.0);