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 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. :-/
@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.
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!
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.
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)
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.
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.