شحن مجاني للأوردرات فوق
1000 ج
رمضان كريم
High-Precision Weight Measurement for Load Cells and Strain Gauges
The HX711 is a precision 24-bit analog-to-digital converter (ADC) designed for weigh scales and industrial control applications. This module interfaces directly with load cells and strain gauges, providing accurate weight measurements with resolutions up to 1 in 16,777,216.

24-bit ADC with 16,777,216 counts
Channel A (128x gain) and Channel B (32x gain)
Serial communication with Arduino
Typical current: 1.3mA (active), <1μA (sleep)
| Resolution | 24-bit (16,777,216 counts) |
|---|---|
| Input Channels | 2 differential (A: 128x, B: 32x gain) |
| Data Rate | 10SPS or 80SPS (selectable) |
| Supply Voltage | 2.6V – 5.5V (3.3V or 5V compatible) |
| Interface | Serial (Clock + Data) |
| Operating Temp | -40°C to +85°C |

| Pin | Label | Description | Arduino Connection |
|---|---|---|---|
| 1 | VCC | Power (2.6-5.5V) | 5V |
| 2 | GND | Ground | GND |
| 3 | DT | Data Output | D3 |
| 4 | SCK | Clock Input | D2 |
| 5 | A+ | Channel A Positive | Load Cell Red |
| 6 | A- | Channel A Negative | Load Cell Black |
| 7 | B+ | Channel B Positive | Load Cell White |
| 8 | B- | Channel B Negative | Load Cell Green |

// Typical Load Cell Connections: // HX711 A+ → Load Cell Red // HX711 A- → Load Cell Black // HX711 B+ → Load Cell White // HX711 B- → Load Cell Green // E+ (Excitation+) → Load Cell Red (may vary) // E- (Excitation-) → Load Cell Black (may vary)
#include "HX711.h"
HX711 scale;
const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
// Calibration factor (adjust for your load cell)
scale.set_scale(2280.f);
scale.tare(); // Reset to zero
}
void loop() {
Serial.print("Weight: ");
Serial.print(scale.get_units(), 1); // 1 decimal place
Serial.println(" g");
delay(200);
}
// Calibration procedure
scale.set_scale(); // Reset scale
scale.tare(); // Reset to zero
Serial.println("Place known weight...");
delay(5000);
float reading = scale.get_units(10);
float known_weight = 100.0; // 100g test weight
float calibration_factor = reading/known_weight;
scale.set_scale(calibration_factor);
// Set data rate (10SPS or 80SPS)
scale.set_gain(128); // Channel A, 128x gain, 10SPS
// scale.set_gain(64); // Channel A, 64x gain, 80SPS
// Power saving modes
scale.power_down(); // Current drops to <1μA
delay(1000);
scale.power_up(); // Wake up and stabilize
// Interface multiple HX711
HX711 scale1, scale2;
scale1.begin(D3, D2);
scale2.begin(D5, D4);
float weight1 = scale1.get_units();
float weight2 = scale2.get_units();
No account yet?
Create an Account
Recent Comments