You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This HX710B air pressure sensor module uses a high-precision AD sampling chip, adopts a 0-40KPa air pressure sensor, can connect a 2.5mm hose, can detect water level, and other air pressure.
/* Source: https://www.electroschematics.com/pressure-sensor-guide/*/
#include"HX711.h"
HX711 scale;
voidsetup() {
Serial.begin(9600);
Serial.println("HX710B Demo with HX711 Library");
Serial.println("Initializing the scale");
// parameter "gain" is ommited; the default value 128 is used by the library// HX711.DOUT - pin #A1// HX711.PD_SCK - pin #A0
scale.begin(A1, A0);
Serial.println("Before setting up the scale:");
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC
Serial.print("get value: \t\t");
Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight (not set yet)
Serial.print("get units: \t\t");
Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight (not set) divided// by the SCALE parameter (not set yet)
scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare(); // reset the scale to 0
Serial.println("After setting up the scale:");
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC
Serial.print("get value: \t\t");
Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare()
Serial.print("get units: \t\t");
Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight, divided// by the SCALE parameter set with set_scale
Serial.println("Readings:");
}
voidloop() {
Serial.print("one reading:\t");
Serial.print(scale.get_units(), 1);
Serial.print("\t| average:\t");
Serial.println(scale.get_units(10), 1);
scale.power_down(); // put the ADC in sleep modedelay(5000);
scale.power_up();
}
The text was updated successfully, but these errors were encountered:
* Adds HX711 Issue #101
* Changes from PR comments
* Fixes more `Hx711Element` case to `HX711Element`
* Adds Load sensors and Gauge Pressure sensors to board HX711 board
* Updates HX711 so it resizes when different sensors are active
* HX711 Element, removes unused code and makes width and height not user selectable.
* HX711 Element changes text to not be selectable.
* HX711 Element, Removes more unused code
* HX711 Element, changed default type to 50kg
* HX711 Element changes width/height to number
* HX711 Element, extracts sensor type to function with default.
Co-authored-by: Chris Wilson <>
This HX710B air pressure sensor module uses a high-precision AD sampling chip, adopts a 0-40KPa air pressure sensor, can connect a 2.5mm hose, can detect water level, and other air pressure.
Technical Specifications
Pinouts
Documents
Code
The text was updated successfully, but these errors were encountered: