DMS load cell with measuring amplifier HX711AD: Unterschied zwischen den Versionen
| Zeile 272: | Zeile 272: | ||
Model Overview | Model Overview | ||
* HX711 Read Block (custom block using IO Device Builder) – reads the 24-bit value via DOUT (pin | * HX711 Read Block (custom block using IO Device Builder) – reads the 24-bit value via DOUT (pin 10) and PD_SCK (pin 9). | ||
[[Datei:Simulink weight model.png|thumb|right|Simulink model of the weighing system.]] | [[Datei:Simulink weight model.png|thumb|right|Simulink model of the weighing system.]] | ||
* Calibration & Scaling – subtracts offset and multiplies by scale factor. | * Calibration & Scaling – subtracts offset and multiplies by scale factor. | ||
Version vom 5. April 2026, 10:02 Uhr

| Autor: | Onyesi John Abiagam |
| Sprache: | DE EN |
Introduction
A weighing scale is a measurement system used to determine the mass of an object by converting mechanical force into a readable value.
This system is based on a DMS load cell in combination with the HX711AD measuring amplifier. The applied force is converted into an electrical signal, which is processed and displayed as a weight value.
The signal is acquired using a microcontroller-based system and processed using Simulink. Calibration, signal filtering, stability detection, and tare functionality are implemented to ensure accurate and stable measurements.
Requirements
| Req. | Description | Priority | Progress |
|---|---|---|---|
| 1 | The mass must be determined using the HX711AD load cell via Arduino and Simulink. | 1 | Done |
| 2 | The measuring range must be determined. | 1 | In Progress |
| 3 | The measurement uncertainty (1σ) must be determined for the measuring range and displayed as a confidence interval. | 2 | In Progress |
| 4 | The on/off button starts the system. The sensor must first be calibrated and display 0 g. |
1 | Done |
| 5 | The weight must be referenced for the measuring range. | 1 | In Progress |
| 6 | The measured values must be filtered/smoothed over time. | 1 | Done |
| 7 | A beep must indicate when the measured value is stable/constant. | 1 | Done |
| 8 | The sensor system must display the weight in g on a display. | 1 | Done |
| 9 | The tara button resets the current weight to 0 g (recalibration). |
1 | Done |
Required Components
| Component | Function |
|---|---|
| DMS Load Cell (1 kg) | Converts mechanical force into a small electrical signal |
| HX711AD Measuring Amplifier | Amplifies the tiny load-cell signal and converts it into a 24-bit digital value |
| Microcontroller (Arduino Uno R3) | Central control unit that reads sensor data, processes signals, and controls peripherals such as the display, pushbutton, and buzzer |
| LCD Display (I2C) | Displays the measured weight |
| Pushbuttons | Provide user input for system control functions such as tare (zeroing) and power operation |
| Buzzer | Provides feedback sound when the weight becomes stable |
Working principle
This section describes the complete working principle of the system, including force sensing with the DMS load cell, signal amplification and digitization using the HX711AD, and data processing by the microcontroller. Additionally, it covers user interaction via pushbuttons and the output of measurement results through the display and feedback sound using the buzzer.
DMS Load Cell
Introduction
A DMS load cell converts mechanical force into an electrical signal. It consists of:
- a deformable metal body
- strain gauges attached to the surface
- resistance changes when stretched or compressed

Working Principle
When force is applied:
- the metal body deforms
- strain gauges change resistance
- gauges are wired in a Wheatstone bridge
- deformation → bridge becomes unbalanced
- output: small differential voltage

---
HX711AD Measuring Amplifier
Introduction
The HX711AD processes the small differential signal from the load cell. It includes:
- a programmable gain amplifier (PGA)
- a 24‑bit sigma‑delta ADC

Working Principle
Signal processing steps:
- load cell outputs a millivolt‑level differential signal (A+, A−)
- PGA amplifies the signal
- 24‑bit ADC converts it to digital
- microcontroller reads data via:
- DOUT (data)
- SCK (clock)

Technical Overview
- The system consists of a DMS load cell, an HX711AD measuring amplifier, a microcontroller, an LCD, a buzzer, and two push buttons (power and tare).
- The load cell converts the applied force into an electrical signal, which is amplified and digitized by the HX711AD.
- The digital data is read and processed by the microcontroller.
- The measured weight is displayed on the LCD.
- A buzzer indicates when a stable measurement is reached.
- The power button controls the system state, and the tare button resets the measured value to 0 g.
Pin Assignment
This section describes the electrical connections between the load cell, the HX711AD,the buzzer,LCD and push buttons and the microcontroller.
Load Cell to HX711
| Load Cell Wire | Function | HX711 Pin | Description |
|---|---|---|---|
| Red | Excitation + (E+) | E+ | Supplies voltage to the bridge |
| Black | Excitation − (E−) | E− | Ground reference |
| White | Signal + (S+) | A+ | Positive input signal |
| Green | Signal − (S−) | A− | Negative input signal |
| Yellow (optional) | Shield | GND | EMI protection |
HX711 to Microcontroller
| HX711 Pin | Function | Microcontroller Pin | Description |
|---|---|---|---|
| VCC | Power Supply | 5V / 3.3V | Power input |
| GND | Ground | GND | Common reference |
| DOUT | Data Output | Digital Input | Sends measurement data |
| PD_SCK | Clock Input | Digital Output | Controls data read |
Microcontroller Peripherals
| Component | Function | Microcontroller Pin | Description |
|---|---|---|---|
| LCD | Display output | I2C (SDA/SCL) | Displays measured weight |
| Buzzer | Acoustic feedback | Digital Output | Indicates stable measurement |
| Push Button (Power) | System control | Interrupt Pin (e.g., D2) | Starts or stops the system |
| Push Button (Tare) | Reset function | Interrupt Pin (e.g., D3) | Resets measured value to 0 g |
Measurement method
- The raw digital value from the HX711 is converted into a weight value using calibration parameters.
Weight = (Raw value − Offset) × Scale factor
- To reduce noise, a recursive average filter is applied:
y[n] = α · x[n] + (1 − α) · y[n−1]
where:
- x[n] is the current measurement
- y[n] is the filtered value
- α is the filter coefficient (0 < α < 1)
- The stability of the measurement is evaluated using the standard deviation:
σ = sqrt( (1/N) · Σ (x_i − μ)^2 )
where:
- μ is the mean value of the samples
- N is the number of samples
- A measurement is considered stable when the standard deviation falls below a defined threshold.
- The final result is expressed as:
Weight = μ ± σ
Where:
- μ: mean value
- σ: standard deviation (measurement uncertainty)
Measuring Circuit
Components
- DMS load cell ( 1Kg)
- HX711AD measuring amplifier
- Microcontroller (Arduino Uno R3)
- LCD (I2C)
- Buzzer
- Push button (power)
- Push button (tare)
- Breadboard
- Jumper wires
Circuit Description
- The load cell is connected to the HX711AD measuring amplifier using a Wheatstone bridge configuration.
- The HX711AD is powered by the microcontroller and shares a common ground with all components.
- The HX711AD transmits digital measurement data to the microcontroller via the DOUT and PD_SCK pins.
- The LCD is connected to the microcontroller via the I2C interface (SDA and SCL).
- A buzzer is connected to a digital output pin to provide feedback sound.
- Two push buttons are connected to interrupt-capable pins:
- Power button: controls the system state
- Tare button: resets the measured value to 0 g

Software
The software for this project is implemented in two environments:
- Arduino IDE for low-level hardware control (reading the HX711, driving the LCD, buttons, and buzzer).
- Simulink (MATLAB) for signal processing, data logging, and visualisation.
All hardware pin connections follow the definitions given in Section 3.1 (Pin Assignment). The software uses those same pin numbers for digital I/O, interrupts, and I2C communication.
Arduino IDE
The main program loop performs the following steps:
- Read the raw 24-bit value from the HX711.
- Apply a recursive average filter to reduce noise.
- Convert the filtered value to grams using calibration parameters (offset and scale factor).
- Check stability by computing the standard deviation of recent measurements.
- If stable, activate the buzzer briefly.
- Update the LCD with the current weight.
- Handle button interrupts for power (on/off) and tare (zeroing).
Required Libraries
- HX711.h – for communicating with the HX711 amplifier.
- LiquidCrystal_I2C.h – for the I2C LCD display.
Simulink
For advanced signal processing and data logging, a Simulink model was created using the Arduino Support Package for Simulink. The model uses the same pin assignments as defined in Section 3.1 (Pin Assignment).
Model Overview
- HX711 Read Block (custom block using IO Device Builder) – reads the 24-bit value via DOUT (pin 10) and PD_SCK (pin 9).

- Calibration & Scaling – subtracts offset and multiplies by scale factor.
- Digital Filter – first-order recursive (IIR) low-pass filter with smoothing factor α = 0.1, used to reduce measurement noise.
- Stability Detection – moving standard deviation computed over a sliding window of recent samples; the window size is adjustable and was tuned experimentally.
- Display – filtered weight on a Scope and/or LCD (custom block using IO Device Builder).
- Button Inputs – external interrupt-based inputs (using Arduino Support Package for Simulink) for the power button (pin 2) and tare button (pin 3), enabling immediate event-driven response.
Note: The Simulink Arduino support package does not natively support the HX711 and LCD; custom blocks were created using the IO Device Builder.
Measurement
Video
Datasheets
Related Links
SVN-Repository
https://svn.hshl.de/svn/HSHL_Projekte/trunk/Arduino_Sensorsammlung
→ zurück zum Hauptartikel: HSHL-Mechatronik-Baukasten | Arduino Sensorsammlung | Sensorinbetriebnahme mit Arduino und Simulink