Hello - I have a pressure sensor with the hx710b ADC chip on it. It is similar to the hx711 chip and that library seems to work. I am using it with an arduino mini pro. I have both a 3.3v and a 5v. I plan on placing the sensor in a tube sealed on one end and putting the open end of the tube in a tank of water. As the fluid rises, the pressure should rise, I am not sure if this would be linear, but I doubt it since are will decrease in size 1/2 for about every 33 ft of submersion, so 66 feet is 1/4 the original volume.
When I hook the unit up, I am using a code designed for a load cell. I get readings that of course the code says are in pounds. I would like to calibrate this sensor but I am kind of at a loss how to do that. One thing I was considering was to just empirically calibrate it. So what I would do is put the tube in a tank with no liquid, take a reading, add an inch of liquid and take a reading and so on until I reach about 48 inches for my tank. I think this would work but I can see a couple of issues:
-
As atmospheric pressure changes, would this effect my readings? I could use a second sensor but since they are not really calibrated to a true stand, I don't think I can just subtract them especially since it is probably not linear.
-
If I want to duplicate the setup for another similar take but with a new sensor, none of the calibrations would apply, I don't think, because it is not calibrated to a standard.
Here is the board I am using:
https://www.aliexpress.com/item/3-3-5V-Digital-Barometric-Pressure-Sensor-Module-Liquid-Water-Level-Controller-Board-0-40KPa-for/32881974588.html?spm=a2g0s.9042311.0.0.27424c4dpjouCP
Here is my initial code with no empirical calibration and basically unchanged from sparkfun's website for a load cell. Like I said, I get reading that change as I move a plunger.
/*
Example using the SparkFun HX711 breakout board with a scale
By: Nathan Seidle
SparkFun Electronics
Date: November 19th, 2014
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your
specific load cell setup.
This example code uses bogde's excellent library: https://github.com/bogde/HX711
bogde's library is released under a GNU GENERAL PUBLIC LICENSE
The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge
based load cell which should allow a user to measure everything from a few grams to tens of tons.
Arduino pin 2 -> HX711 CLK
3 -> DAT
5V -> VCC
GND -> GND
The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
*/
#include "HX711.h"
#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch
#define DOUT 3
#define CLK 2
HX711 scale;
void setup() {
Serial.begin(9600);
Serial.println("HX711 scale demo");
scale.begin(DOUT, CLK);
scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0
Serial.println("Readings:");
}
void loop() {
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
Serial.println();
}
Any thoughts and comments would be appreciated. I cannot find anything really specific to this sensor.
Anthony