Hello, I need help for the calibration of the HX710B pressure sensor. The readings of the ADC value is a non-zero pressure even without applying a pressure to the MPS20N0040D. How can I make it to a zero or near zero pressure? I'm using Arduino mega as the microcontroller.
#include <Q2HX711.h>
const byte MPS_OUT_pin =46; // OUT data pin
const byte MPS_SCK_pin =44; // clock data pin
int avg_size = 10; // #pts to average over
const float ADC_mV = 4.8828125;
const float sensitivity = 4.413;
const float mmh2O_kpa = 0.00981;
Q2HX711 MPS20N0040D(MPS_OUT_pin, MPS_SCK_pin); // start comm with the HX710B
void setup() {
Serial.begin(9600); // start the serial port
}
void loop() {
float avg_val = 0.0; // variable for averaging
for (int ii=0;ii<avg_size;ii++){
avg_val += MPS20N0040D.read(); // add multiple ADC readings
delay(50); // delay between readings
}
avg_val /= avg_size;
Serial.println(avg_val,0); // print out the average
float mmHg = ((avg_val - ADC_mV) / sensitivity )/ mmh2O_kpa;
Serial.println(mmHg, 2); // print out the converted value with 2 decimal places
}