Messure pressure (that equals water depth) using a Raspberry Pi with an ADC Pi shield
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
README.md
rpi_adc_pi_mpx5050.jpg

README.md

ADC Pi MPX5050

This an example to messure pressure (that equals water depth) using a Raspberry Pi, an ADC Pi shield and a couple of MPX5050 pressure sensors.

Wiring

  • Wire pin 1 of the first MPX5050 to A1 on the ADC Pi.
  • Wire pin 1 of the second MPX5050 to A2 on the ADC Pi.
  • Wire pin 2 of both MPX5050 sensors to GND on the ADC Pi.
  • Wire pin 3 of both MPX5050 sensors to 5V on the ADC Pi.
  • Wire pin A8 on the ADC Pi to a 5V source (i used a 5V address selection pin on the ADC Pi).

Prototype

Software

Just run bin/mpx5050, the expected output is:

# ./mpx5050
channel          v               pa              m
----------------------------------------------------------------
1               0.855210        7.167939        0.730930
2               0.351403        1.636162        0.166843
vcc             5.059726

Calibration

Since the MPX5050 sensors have a small offset error and linear output from Vcc to Vss that isn't exactly 5 V, the mpx5050 script can take that into account to give more precise output.

To calibrate your sensors follow this steps:

  1. Without applying pressure run mpx5050 and write down channel 1, 2 and vcc volts values.

  2. On the mpx5050 script set cal_on to 1 and fill vcc_cal, mpx_cal1 and mpx_cal2 with the values from step 1.

See the transfer function on the MPX5050 datasheet for more information.

Resources

Author

Manuel Rábade <manuel@rabade.net>

Based on adcpiv2.py demo by ABE Electronics UK.

License

This work is published under a Creative Commons Attribution 4.0 International License.