I have been trying to work with a differential pressure sensor (MPXV7002DP) that outputs 0-5V. I have connected the sensor to a Node mcu V3 board. The pressure sensor has 3 pins: Pin1 goes to the Nodemcu 3.3v, Pin2 goes to Nodemcu Ground, and Pin3 goes to Nodemcu A0. When powering the sensor, I did a quick check and hooked a voltimeter to the sensor output, and I could see the ranges going from 0.300 mv to 5.18V (0 to 5V).
In my ESP Home (in Home Assistant), I configure my sensor with the following code:
I put the filter as “1” because I wanted to see what Nodemcu was seeing, and it sees 0.87 Volts. When I measure the voltage with a voltmeter, I get a reading of 2.7v. Since my expected voltage is 5v, then I put the filter as “5”, but then the ESPHome reads, 4.7.
I then tried multiplying by 5, but adding an offset of -1.8, however, the maximum value measured by the Nodemcu was 3.2v.
I am unsure what to do to just read the raw voltages of 2.7v at no pressure, then 5v for the value when maximum pressure is reached.
In the case of the Nodemcu, which has ain internal voltage divider, I would need to add two external resistors to step the voltage down from 5v to 3.3v.
so that inside the HomeAssistant values, 0-3.3v is actually 0-5v.
Interesting… Any help on the values for R1 and R2?
Hi mmatus1112, did this work out for you? Care to share some more info on the esphome code and reading measurements from the MPXV7002DP?
I’m planning on building an airflow sensor to check out the ventilation in my garage (speed and direction).
Thanks.