The HX711 module, manufactured by YOUMILE with the part ID HCMODU0073, is a precision 24-bit analog-to-digital converter (ADC) designed for weigh scales and industrial control applications. It is specifically tailored for interfacing with a bridge sensor, such as a load cell, which is commonly used in electronic weighing systems. The HX711 provides a simple and effective solution for obtaining high-resolution measurements of pressure, force, and weight.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (2.6V to 5.5V) |
2 | GND | Ground |
3 | DT | Data output from HX711 to microcontroller |
4 | SCK | Serial clock input |
5 | E+ | Excitation+ for load cell |
6 | E- | Excitation- for load cell |
7 | A- | Channel A negative input |
8 | A+ | Channel A positive input |
9 | B- | Channel B negative input (optional) |
10 | B+ | Channel B positive input (optional) |
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}
void loop() {
if (scale.is_ready()) {
long reading = scale.read();
Serial.print("Reading: ");
Serial.println(reading);
} else {
Serial.println("HX711 not found.");
}
delay(1000);
}
Q: Can the HX711 be used with any load cell? A: The HX711 is compatible with most strain gauge load cells. Ensure the load cell's rated output matches the HX711's input requirements.
Q: How do I calibrate my scale using the HX711? A: Calibration involves recording the raw output from the HX711 with a known weight on the load cell and then calculating a conversion factor to convert raw readings to weight units.
Q: What is the purpose of the gain selection option? A: The gain selection allows you to set the amplification factor for the signal coming from the load cell, which can be adjusted based on the load cell's sensitivity and the required resolution.
Q: How can I increase the sampling rate? A: The HX711 has two selectable data rates: 10SPS and 80SPS. The rate can be set by controlling the SCK pin according to the HX711 datasheet.
Q: Can I use the HX711 for applications other than weighing scales? A: Yes, the HX711 can be used in any application that requires high-resolution analog-to-digital conversion of a differential input signal, such as pressure sensors or force sensors.