How to use pressure transducer sensor

how to use pressure transducer sensor ? i want to know if there is any water flow in my pipe ?

https://www.amazon.in/Generic-Pressure-Transducer-Sensor-Diesel/dp/B019EVA1GS?tag=googinhydr18418-21&tag=googinkenshoo-21&ascsubtag=k_EAIaIQobChMI6KKWm5CP4gIVhZKPCh3P8g5BEAYYASABEgLfrfD_BwE_k&gclid=EAIaIQobChMI6KKWm5CP4gIVhZKPCh3P8g5BEAYYASABEgLfrfD_BwE

2 Likes

will it work with tasmota or esphome ?

On an american listing for a similar product, it says:

  • Working Voltage: 5VDC
  • Output Voltage: 0.5-4.5 VDC

If that’s the case, you could use the ADC sensor in ESPHome, though you might need a voltage divider to scale down that input voltage depending on what ESP board you use and what input voltage range it can read.

I want to get this going too and use ESPHome.io but I am having difficulty figuring out exactly what the equation should be. I originally used the Arduino IDE to upload a simple equation from a youtube video I found, it seemed to work very well and gave me the pressure I’d expect.

I’m currently using this equation that I calculated manually using a theoretical voltage range of 0.5-4.5 and it seems to be close but not perfect:

  - platform: adc
    pin: A0
    name: "Incoming Water Pressure"
    update_interval: 10s
    unit_of_measurement: "psi"
    icon: "mdi:gauge"
    accuracy_decimals: 1
    filters:
      - multiply: 5.0
      - lambda: return x*43.75-21.875;

image

I’m very interested if anyone has an accurate equation for this. When I get it installed as a last-ditch effort I’ll use empirical data correlating values with my fixed gauge pressure but it’ll be a little while before that happens. :-/

EDIT: Oh, by the way, my pressure sensor is 1.2MPa max (174psi) from aliexpress

Hello, I also interested on this. Have you find a solution for the equation? Thank you

@malesci, since I cared more about precision and less about accuracy for comparison between two sensors, I ended up using empirical data and a 4th degree polynomial fit. See the resulting ESPHome equation here: Water filter quality and water softener status

Hello I’m using a wemos D1 mini and ads plantform on esphome.
The sensors wire are connected on 5vcc, gnd and pin 0. Unfortunately I received always fixed value from the sensor, always 1V. Became 3.3 if I multiply for 3.3 of course.
Can you help me to understand configuration and wire connections? Maybe I need some resistors?
Thank you in advance

@malesci, how are you changing the pressure when expecting different voltages? My device is 0-175psi (0-1.2MPa) which is a significant range. If you’re blowing into it, expecting a change in voltage it’ll be within the noise, you can probably only generate about 1 or 2psi by mouth. If you look at my picture above, it’s really simple:

RED = 5V
BLACK = GND
YELLOW = A0

If you’re getting a constant 1V while varying the actual pressure significantly then your sensor is damaged.

Good luck!

But.
Does the Wemos d1 Mini read more than one volt?

I am trying to use this sensor with this chip, but from what I read Wemos D1 Mini, ESP8266 can only distinguish between 0-1v
And the sensor transmits from 0.5 to 4.5

How do you convert this?

I’ve found a digital level switcher but that one steps it down from 5V to 3v

Hi @alnavasa, I just did this as a proof of concept. When I built the final solution, I used an ads1115 which gives you 4 analog inputs and each one can have a range of -0.3V-5.5V. Along with that there are more bits to represent the actual analog voltage (higher resolution). Best of all it’s supported by ESPHome. You might be able to go with a resistor divider to knock the voltage down cheaply… good luck!

Ill get a ads1115, they are not that expensive, and if that gives me less trouble I’ll go that way. Thanks

Replying in case anyone else finds and follows this old thread… So I did something similar to this post, attaching a pressure transducer to a D1-mini. I attached directly without a separate ADC.


sensor:
  - platform: adc
    pin: A0
    name: "Heating Pressure"
    id: "HeatWaterPressure"
    unit_of_measurement: "psi"
    icon: "mdi:gauge"
    filters:
    - offset: 0
    - lambda: return ((x * 3.3 -0.5) * 25);  
    update_interval: 60s

My pressure transducer is a 100psi model from aliexpress, powered directly from the 5V pin on the D1-mini.

I’m able to get away with this, because I’m never expecting pressures that will give a voltage over 3.3V (which would burn out the D1 mini).

The above comments about ‘The D1 mini can only take voltages from 0-1V’ are technically true, but misleading. There is a built in divider that scales down 0-3.3V to 0-1V before presenting it to the ADC. (You can see this in the raw values you get from the pin). The (x*3.3) part scales up the value to the real input voltage. The -0.5 is because 0 psi corresponds to 0.5V on the raw input voltage. The x25 is because 1V of input voltagw corresponds to 25psi (voltage range from 0.5V @ 0psi to 4.5V @ 100 psi).

So as long as my input pressure stays below 70psi/3.3V I’m golden. (Typical pressures for my system are about 25-30psi)

4 Likes

never mind this cleared it up for me

1 Like

How would I make this work with the originally stated transducer?

Use the code I posted with esphome and hook up vcc to 5V and ground to ground and the remaining wire to A0.

Does it make a differ which esp board is used together with the ads1115? And are you willing to share your yaml file of the code?

It does not matter which ESP board you use – so long as it supports i²c. I’ve used Wemos D1 Mini, NodeMCU, and ESP32s in my house and they all support i²c.

Take a look at the “Water filter quality…” link in this post: How to use pressure transducer sensor - #6 by SpikeyGG

There’s a ton of detail in there and I posted my complete YAML file. Be warned though, the logic is pretty in-depth and you likely don’t need all of it.

Thanks, I missed that link in the posts. In that case I will also go for the wemos D1 mini with ads so I don’t need the voltage divider.