Help with pressure sensor MD-PS002

Default is 10SPS. With 80SPS you trade accuracy for speed. Most boards have a link you can cut, and/or solder bridge. Leo..

Does anybody have a code snippet or proof of concept of how to get the MD-PS002 and HX711 to work? Ive tried everything I can dig up and have not yet been able to get any data from this sensor. Ive triple checked the wiring, tried multiple libraries, multiple sensors, etc.

addennis: Ive triple checked the wiring, tried multiple libraries, multiple sensors, etc.

So why don't you show us what you have done, and what did/didn't work. Only then you might have a chance of getting help. Read the "how to post" guidelines first. Leo..

Hi everybody,

I am making a vacuum meter. It works pretty well, but I don’t understand how I can calculate it.

maybe someone knows how to handle that.
I have an arduino Nano with an HX711 with dar to an MD-PS002 sensor.
I want to read the Psi data on an Oled display 128X32.
I am now guessing what the Psi should be. I do that with an auto vacuum analog meter.
But that is not the right way.

I have the code for the Arduino here:

#include “HX711.h”
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

float analog_pot=0;
#define DOUT 2
#define CLK 3

HX711 scale;

//float calibration_factor =5.1714924102396; // 1 Psi is 5.1714924102396 cm Hg
float calibration_factor =51714; // maby

Adafruit_SSD1306 display(OLED_RESET);
#if (SSD1306_LCDHEIGHT != 32)
#error(“Height incorrect, please fix Adafruit_SSD1306.h!”);
void setup() {
scale.begin(2, 3);
scale.tare(); //Reset the scale to 0
long zero_factor = scale.read_average(); //Get a baseline reading

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Clear the buffer.

void loop() {
scale.set_scale(calibration_factor); //Adjust to this calibration factor


//display.print(scale.get_units()*0.0000, 2);
display.print(scale.get_units()*0.135, 2);
display.println(" Psi");
display.print(scale.get_units(), 2);
display.println(" £");
display.setTextColor(BLACK, WHITE); // ‘inverted’ text



if anyone can help me with that i will appreciate it very much.


Hi, If you want to read real psi from the sensor, you need to do some sort of calibration in Your code. I'm not familiar with HX711, so I can't point you exact functions. I would suggest You using a function to take "raw" readings from MD-PS002, and Serial.print those values. Then put the sensor in Your ?tank?. Here are two alternatives (first is easier, second more accurate):

1) Take two readings at min and max pressure that could be in your ?tank? At both pressure levels you should measure it with Your trusty analog meter and print arduino reading. You would end up with two points: (arduino reading, psi) Then implement map() function to map arduino reading extremes to psi value extremes. This function should calculate everything in Your pressure range. Example:

real_psi = map(reading, min_reading, max_reading, min_psi, max_psi)

2) Take a few readings at different pressure levels in the ?tank?. At each pressure level you should measure it with Your trusty analog meter and print arduino reading. You would end up with table of points (example): psi | arduino reading 5 | 1321 10 | 2652 15....

Then enter those points (x = arduino reading, y = psi) into some maths graphing software (I used geogebra) which can draw a "straight line that mostly matches all of those points". Then get a equation and embed it in Your code (if using integers do it carefully to balance precision and to avoid roll over).

BTW: Those sensors don't like attaching silicon hoses to them (I damaged seal in mine while doing so). I've also used MD-PS002, but rated for 700kPa. I was using ina333 instrumentation amp and analogReading sensor.