About the linear calibration.
You have defined it that 0.5 volt should result in 0 bar.
But then the adc measures 0.34. The will then be a negative number.
So the question is why you get a value below 0.5 volt out.
Two suggestions:
The first:
The adc in esp32 is VERY noisy compared to an arduino uno.
When I use esp3286 which also has a crappy adc I sample alot more and the filter the values.
with filter
- exponential_moving_average:
alpha: 0.01
send_every: 100
This means that it make an avarage on aproximate the latest 100 values and send the value to the next filter or output every 100 value.
But that means that you have to decrease update_interval to 0.1 s.
But due to the filter it will send a value every 10 s.
I would skip the linear calibration until you know that you get good data out.
If you don’t get proper adc values. I suggest is to buy a ads1115 adc.The ADS1115 can measure 4 adc signals.
I have used it when I needed to measure the difference between two analog signals.
The second theory.
I also saw that you have a resistor in your wiring diagram. According to the pdf from dfrobot there should not be any there. The sensor output a voltage which should go directly to the adc.
I hope you get it to work.
/Mattias