I am trying to connect my differential pressure sensor (MPX53DP) to my raspberry pi. To do so i need an ADS1115.
I got it connected like this:
The spec sheet:
The spec sheet says:
VOUT = VOFF + (sensitivity x P)
Vout is measured with ADS1115
Voffset is 20 mV
Sensitivity is 1.2 mv/kPa
P is the desired value we need to calculate (in kPa)
So I thought the formula is:
P=((V_out-20)/1,2)
But there is something missing.
In the back of my head, I hear a tiny voice saying that I need to do something with the value 1023.0 but i have no clue why I think that nor why I would need that (I am quite new to this all so maybe that explains)
I was also wondering if i could better use my nano for reading the sensor (would be able to skip the ADS1115 then)
You don't say what language this is, so I will assume it is python. But in every programming language I have ever used, decimal places are separated with a "." and not a ",".
When calculating the voltage of a signal connected to the analog pin of many types of Arduino, it is necessary to divide by 1023 and then multiply by the voltage at Vcc (normally 5V but 3.3V for some Arduino models). This is because the ADC on many types of Arduino is "ratiometric" by default, meaning an ADC value of zero means 0V and 1023 means 5V (or 3.3V). The 1023 value is because most Arduino ADC have 10-bit resolution.
However, the ADC in ADS1115 is not ratiometric, it returns a value which corresponds to an absolute voltage. So there's no need to divide by 1023.
However, you may still need to apply a factor to the raw value from the ADS1115 to turn it into an absolute voltage. This depends on the library (either C++ or python) you are using, which you don't give any details about.
I don't think using your Nano in place of the ADS1115 is a good idea. It only makes things more complicated, plus the Nano's ADC is less accurate than the ADS1115.
Quick overview. Your formula is correct, once you have the V of the sensor in mv. However, what are you receiving from the ADS1115 for a value? Is it counts, volts, milliVolts, ???
Hint - it is usually expected that you will also show us your code... If something is wrong, we may also want a schematic.
Does this look familiar (follow the link!):
The ADS1115 is an absolute ADC, not ratiometric. To correctly convert the output of the pressure sensor, you need to know the pressure sensor supply voltage, which you get by measuring using a third channel on the ADS1115.
Set the ADS1115 to 16 X gain, the reading you get with zero pressure (both MPX53 ports open to atmosphere) will be your OFFSET value. Connect the ports to your pressure source, subtract OFFSET from the new reading, then divide the result by 128. That should get you in the ball park.
As jremington said, the ADS1115 is the wrong choice for a ratiometric pressure sensor.
If you use that A/D chip, then you also need to compensate for supply variations.
The HX710 would have been a much better choice. Complete board with sensor here.
That MPX53 sensor also is not temp compensated.
Why didn't you buy a sensor with I2C output.
Then no external parts would have been needed.
Leo..
Interesting, do you know which differential pressure sensor has that?
The one in your link, is there an option for differential measurements too? (Or jusy buy 2 of them XD)
Thank you for your feedback
Try the search engines of the large parts suppliers (Digikey, Mouser, etc.)
The link was an example with a HX710 chip.
I have never seen then with dual ports (the DP behind some model numbers).
Why do you need the second port. Single port sensors (gauge) could use atmospheric pressure as reference.
Leo..