Skip to main content
HX711 Load Cell Amplifier.

Pins

VCC
power
Voltage supply (5V)
DT
data
Serial data
SCK
clock
Serial clock
GND
ground
Ground
The E+/E-/A+/A-/B+/B- pins are non-interactive and rendered based on attributes.

Attributes

type
string
default:"50kg"
Either “50kg” (default), “5kg”, or “gauge”

Examples

ResultAttrs
5kg scale{ "type": "5kg" }
50kg scale{ "type": "50kg" }
Gauge only{ "type": "gauge" }

Operation

The HX711 amplifier allows you to easily read load cells and evaluate changes in resistance. A Wheatstone bridge is used to connect load cells to the IC, which is in turn connected to the microcontroller via VCC, DT, SCK, and GND. Use begin() to initialize the scale and set_scale() and tare() to calibrate it. power_down() and power_up() can be used to bring the ADC into and out of low power mode. get_value() and get_units() are used to read the ADC minus tare and divided, passing an optional integer value to obtain that number of values, averaged. Refer to the HX711 Arduino library for more details on features and calibration.
This chip does not implement channel B or gain settings of 32/64/128. The raw readings are from 0-2100 for the "type":"5kg" type, and 0-21000 for the "type":"50kg".

Arduino code example

#include "HX711.h"

HX711 scale;

void setup() {
  Serial.begin(9600);
  Serial.println("Initializing the scale");
  scale.begin(A1, A0);
}

void loop() {
  Serial.println(scale.get_units(), 1);
  delay(1000);
}
Try this example on Wokwi

Automation controls

The HX711 can be controlled using Automation Scenarios. It exposes the following controls:
ControlTypeDescription
loadfloatSet the load value of the scale (in kg)

Simulator examples

Build docs developers (and LLMs) love