Skip to content

Messure pressure (that equals water depth) using a Raspberry Pi with an ADC Pi shield

Notifications You must be signed in to change notification settings

manuel-rabade/adc_pi_mpx5050

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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               kpa             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.

About

Messure pressure (that equals water depth) using a Raspberry Pi with an ADC Pi shield

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages