Hello,
This is my first Arduino project.
The aim of the project is to measure vacuum pressure to control a vacuum pump such that it is switched on and off according to a predetermined logic so that the pressure remains between approximately 7 psia and 8 psia.
I am using:
Arduino Uno R3
HX711 amplifier
MD-PS002 pressure sensor
Breadboard & jumper wires.
Jumper wires are soldered to the MD-PS002.
Schematic and setup photos attached.
The pressure sensor is housed inside a brass fitting, which is then connected to the vacuum chamber. I also have a manual vacuum gauge to be used as verification / calibration.
The idea is to use the HX711 reading to trigger a relay, switching the vacuum pump on or off as desired.
I know I could use a mechanical regulator to control the pressure the chamber is exposed too, but wanted to learn something new.
This is the problem:
The average readings I achieve are erratic. At atmospheric pressure, the average reading ranges from -1 or 0 to circa -43,000. When I apply a vacuum of around 6 psia the reading remains erratic and does not really change, still ranging from 0 to circa 10's of thousands.
I expected to see a difference in the average readings when the pressure in the vacuum chamber decreases.
Before posting this I have searched around and not found an example of fixing this issue.
I have also tried altering the number of readings for the average, the offset and scale and the gain I have tried both 64 and 128
By using a multi meter set on 200mV range I have tried to measure a voltage across combinations of the A+, A-, E+, E- pins. I never got a reading other than zero.
Here is the code
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = A2;
const int LOADCELL_SCK_PIN = A3;
HX711 scale;
void setup() {
Serial.begin(57600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
byte gain = 64;
long average = scale.read_average(10); //Reads the average (how many times)
scale.set_scale (1.f); //Sets the scale to convert raw data to human readable data (psia). What does 1.f mean?
float get_scale(); //Reads the current scale
scale.set_offset (100);
//This section should print once
Serial.println("START");
Serial.print("OFFSET: ");
Serial.println(scale.get_offset()); //Serial Print OFFSET: Value
Serial.print("AVERAGE: ");
Serial.println(average); //Serial Print AVERAGE: Value
Serial.print("CURRENT SCALE: ");
Serial.println(scale.get_scale()); //Serial Print CURRENT SCALE: Value
delay(10000);
}
void loop() {
if (scale.is_ready()) {
long reading = scale.read();
long average = scale.read_average(10); //Reads the average (how many times)
byte gain = 64; //Sets the Gain on Channel A
// This section should print continuously
Serial.print("AVERAGE: ");
Serial.println(average); //Serial Print AVERAGE: Value
} else {
Serial.println("HX711 not found.");
}
delay(1000);
}
My questions / help required areas are:
- Why might the average readings be erratic?
- What can be done to smooth the readings?
- Is there another question I should be asking?
- Should I be able to measure a voltage across combinations of the A+, A-, E+, E- pins?
- Am I wasting my effort with this sensor / load amp combination?
- What may be a better sensor to use?
Thank you
hx711_english.pdf (160 KB)