Reading a strain gauge directly with a microcontroller is impossible due to the microvolt-level signals involved. The HX711 load cell amplifier bridges this gap, acting as the critical interface between the physical sensor and your ESP32 or Arduino. This guide breaks down the exact sensor circuit diagram for the HX711, provides the raw-to-gram conversion math, and delivers a decision framework to select the right load cell for your specific precision requirements.

The HX711 Sensor Circuit Diagram and Sensing Principle

A strain gauge load cell relies on a Wheatstone bridge circuit where four resistive elements are bonded to a deformable metal spring element (usually aluminum or steel). When physical force is applied, the metal deforms microscopically. This deformation changes the electrical resistance of the gauges, unbalancing the bridge and producing a differential voltage strictly proportional to the applied force.

Because this differential output is exceptionally small—typically 1mV to 3mV per volt of excitation (1mV/V to 3mV/V)—it cannot be read by a standard 10-bit or 12-bit microcontroller ADC. The HX711 chip solves this by integrating a 24-bit delta-sigma analog-to-digital converter (ADC) with a programmable gain amplifier (PGA). It amplifies the microvolt signal by a factor of 128 or 64, digitizes it, and outputs a 24-bit digital integer via a custom two-wire serial protocol.

Wiring Table and Power Supply Constraints

The most common failure mode in HX711 sensor circuit diagram implementations is frying the microcontroller's GPIO pins. The HX711 can operate from 2.6V to 5.5V. If you power the HX711 with 5V, its data output (DOUT) will swing to 5V, which will permanently damage the 3.3V logic pins on an ESP32 or Raspberry Pi Pico. Always power the HX711 from the 3.3V rail when using 3.3V microcontrollers.

HX711 to ESP32 and Load Cell Wiring Specification
HX711 Pin Connects To Wire Color (Typical) Notes & Constraints
VCC ESP32 3V3 Red Supply range: 2.6V - 5.5V. Use 3.3V for ESP32.
GND ESP32 GND Black Must share common ground with MCU.
DOUT ESP32 GPIO 4 Yellow Digital Output. 3.3V logic level max.
PD_SCK ESP32 GPIO 5 Orange Power Down / Serial Clock input.
E+ (Excitation+) Load Cell Red Red Bridge positive excitation.
E- (Excitation-) Load Cell Black Black Bridge negative excitation.
A+ (Signal+) Load Cell White White Signal positive. Verify with multimeter.
A- (Signal-) Load Cell Green Green Signal negative. Swapping A+/A- inverts reading.
Callout Tip: Verify Before Powering. Cheap import load cells frequently swap the White (A+) and Green (A-) wires. Before applying power, use a multimeter in resistance mode. You should read roughly 1kΩ across Red/Black (E+/E-) and 1kΩ across White/Green (A+/A-). If your readings are infinite or zero, the color code is non-standard and you must map the bridge manually.

Output Signal Math: Converting Raw ADC to Grams

The HX711 does not output volts, ohms, or grams. It outputs a raw 24-bit signed integer ranging from -8,388,608 to +8,388,607. To convert this raw reading into a physical unit like grams or kilograms, you must apply a two-step linear transformation: offset subtraction (taring) and scalar division (calibration).

The Math:
Weight (grams) = (Raw_Read - Tare_Offset) / Calibration_Factor

  1. Tare Offset: The raw integer value read when zero physical load is applied to the sensor. This accounts for the weight of your scale platform and the inherent zero-bias of the Wheatstone bridge.
  2. Calibration Factor: The number of raw ADC counts per gram. This is unique to every specific load cell and HX711 gain combination.

Calibration Procedure:
1. Read the raw value with nothing on the scale. Save this as Tare_Offset.
2. Place a known reference mass on the scale (e.g., a 500g calibration weight or a sealed 500ml bottle of water which is exactly 500g at 4°C).
3. Read the new raw value. Let's say it reads 420,500.
4. Calculate the factor: (420,500 - Tare_Offset) / 500g = Calibration_Factor.
5. Hardcode this factor into your firmware.

Interference Sources and Hardware Filtering

Because the HX711 amplifies signals in the microvolt range, the sensor circuit diagram is highly susceptible to environmental noise. Understanding what the output actually is—a high-gain amplified digital stream—helps explain why these interference sources matter.

  • 50Hz/60Hz Mains Hum: AC power lines induce electromagnetic fields that couple into the high-impedance analog traces. The HX711 includes a hardware notch filter controlled by the RATE pin. Tie the RATE pin to GND for 10 Samples Per Second (SPS), which activates a 50Hz rejection filter (ideal for Europe/Asia). Tie it to VCC for 80 SPS, which activates a 60Hz rejection filter (ideal for North America).
  • Thermal Drift: Strain gauges are temperature-sensitive. If your load cell is exposed to direct sunlight or a heating vent, the metal spring element expands, altering the baseline resistance and causing the zero-point to drift. Mount the cell in a thermally stable enclosure.
  • Switching Regulator EMI: If you power your ESP32 via a cheap buck converter, the high-frequency switching noise will couple into the HX711's analog ground. Always use an LDO (Low Dropout) regulator for the analog section, or physically separate the digital switching grounds from the analog star-ground point at the HX711 GND pin.

Decision Tree: Choosing Your Load Cell and HX711 Variant

Selecting the right hardware prevents you from over-engineering a simple scale or under-specifying a precision rig. Use this decision path to terminate your component search.

Load Cell and HX711 Selection Decision Matrix
Application Requirement Load Cell Type & Capacity HX711 Gain & Channel Recommended Action
High precision, low weight (0 - 5kg, <1g resolution) Single-point aluminum, 5kg Channel A, 128x Gain Use standard 4-wire full-bridge.
Human body scale or heavy bench (10kg - 200kg) Four 50kg half-bridge cells in parallel Channel A, 128x Gain Requires a combinator PCB to wire 4 half-bridges into one full bridge.
Industrial hopper or tension testing (>200kg) S-Type steel, 500kg Channel A, 128x Gain Use shielded 4-core cable; ground the shield at the HX711 only.
General Purpose DIY Bench Scale (Default) SparkFun 50kg (SEN-10245) Channel A, 128x DEFAULT PICK: Pair with SparkFun HX711 Breakout (SEN-13879).

The Verdict: For 90% of embedded projects requiring a reliable sensor circuit diagram implementation, the SparkFun 50kg Half-Bridge Load Cell (SEN-10245) paired with the SparkFun HX711 Breakout (SEN-13879) is the definitive choice. The SparkFun breakout includes the necessary decoupling capacitors and a clean star-ground layout that cheap, unbranded blue modules lack, eliminating hours of noise-debugging.

Complete ESP32 Implementation and Calibration Steps

Below is the production-ready ESP32 Arduino code using the standard HX711 library. This implementation includes non-blocking reads and serial commands for on-the-fly taring.

Prerequisites: Install the 'HX711 Arduino Library' by Olav Kallhovd (bogde) via the Arduino Library Manager. Select 'ESP32 Dev Module' as your board.
#include <HX711.h>

// Pin definitions matching the wiring table
const int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;

HX711 scale;

// Hardcode your calculated calibration factor here
float calibration_factor = 421.5; 

void setup() {
  Serial.begin(115200);
  Serial.println("Initializing HX711...");
  
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  
  // Set gain to 128 for Channel A
  scale.set_gain(128);
  
  // Tare the scale on startup (averages 10 readings)
  Serial.println("Taring... Ensure scale is empty.");
  scale.tare(10); 
  Serial.println("Tare complete. Ready.");
}

void loop() {
  // Check if scale is ready (non-blocking check)
  if (scale.is_ready()) {
    // Get average of 3 readings to smooth high-frequency noise
    float raw_reading = scale.get_units(3);
    
    // Apply calibration factor manually for transparency
    float weight_grams = raw_reading / calibration_factor;
    
    Serial.print("Raw: ");
    Serial.print(raw_reading);
    Serial.print(" | Weight: ");
    Serial.print(weight_grams, 2);
    Serial.println(" g");
  }
  
  // Serial command to re-tare on the fly
  if (Serial.available()) {
    char cmd = Serial.read();
    if (cmd == 't' || cmd == 'T') {
      scale.tare(10);
      Serial.println("Re-tared.");
    }
  }
  
  delay(100); // 10Hz update rate
}

By adhering strictly to the 3.3V logic constraints, mapping the Wheatstone bridge correctly, and applying the linear offset-division math, your HX711 circuit will deliver stable, drift-free weight measurements suitable for everything from automated pet feeders to precision lab scales.