Hi all,
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:
sensor:
- platform: adc
pin: A0
name: Pitot Tube
accuracy_decimals: 3
update_interval: 0.5s
filters:
- multiply: 1
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.
Please help!