HX711 gives fluctuating values

Hi everyone,

I have an urgent problem, as my project submission is due in two weeks, and I am unable to resolve this issue. I am conducting a bending test within a press and have chosen a quarter-bridge strain gauge configuration for measurement. My setup consists of:

  • List item Microcontroller:
  • Arduino Uno
  • Signal Amplifier & ADC: Sparkfun HX711
  • Strain Gauge Measurement: Quarter Bridge configuration

Problem Description

I am trying to capture the voltage variations from the strain gauge, amplify them, and convert them to digital values using the HX711. For testing purposes, I am not using an actual strain gauge but instead three resistors in series, which total 350Ω, just like the strain gauge would. I have carefully balanced the bridge, and the differential voltage is close to 0V, with only minor deviations (~1mV).

However, my HX711 outputs fluctuating values, which make the measurements highly unreliable. I have read multiple times that the HX711 typically has deviations in the double-digit range, but in my case, the fluctuations are in the five-digit range, making the measurements extremely inaccurate.

What I have tried so far

  1. Shielding & EMI Reduction:
    I have connected the YLW output to ground as it is supposed to reduce electromagnetic interference (EMI), which has somewhat minimized fluctuations, but they are still significantly high.
  2. Testing Different HX711 Modules:
    I have tried several cheap green HX711 modules from China – they were terrible.
    The red SparkFun HX711 modules are noticeably better, but they still produce unstable readings.
  3. Verifying Bridge Voltage:
    The bridge voltage is stable, and the differential output is near 0V with ~1mV drift, so the instability must be happening inside the HX711 or due to external noise.

Request for Help

I am running out of time and getting desperate, as I need to submit my project soon. Does anyone have any idea how to fix this issue?
As a token of appreciation, I am willing to send €10 via PayPal to anyone who provides a working solution that completely resolves the problem.

I have attached a graph/image of the fluctuating values for reference and more. Any help would be greatly appreciated!

The Fritzing diagram uses a photoresistor to represent the strain gauge, as I created it quickly.

You have to use a real strain gauge.

Hi thank you for answering, I primarily just want to see if I get a stable value. Therefore, it doesn't matter whether I connect a strain gauge or a resistor. The strain gauge wouldn't change anything.

Those long, looping connections are asking for trouble. They act as antennas to pick up interference from overhead lighting, nearby house wiring, etc.

Also, breadboards are unreliable, so move connections around to avoid bad contacts and/or open circuits.

That minor 1mV is 2.5% of the range. If your circuit already produces that much noise, fixing it downtream will be hard.

If you want to eliminate the fluctuations, you would need to reduce the 1mV noise below the 0.040/2^24=2.384186e-09 =2nV precision of the 24bit device.

Ok, good luck with that then.

1 Like

That appears as EMI, conducted or radiated, could be either or both. Here are some things to take a look at. Lead type and dress is extremely important.

1. Shielding

  • Shielded cables: Use cables with shielding (like braided metal or foil wraps) to reduce the amount of EMI they emit or pick up.
  • Enclosures: Place sensitive electronics in metal or conductive enclosures (Faraday cages) to block external electromagnetic fields.

2. Grounding

  • Proper grounding: Ensure that all electronic components and their enclosures are properly grounded to prevent stray electromagnetic signals from affecting them. Grounding can direct EMI away from sensitive components.

3. Ferrite Beads

  • Ferrite beads: Install ferrite beads on cables that run to and from sensitive electronics. These components help suppress high-frequency EMI by dissipating it as heat.

4. Twisted Pair Cables

  • Twisted pair wiring: If you're running wires, use twisted pair cables for signal lines. The twisting helps cancel out EMI that would otherwise be picked up by the wires.

5. Capacitors and Filters

  • EMI filters: Install EMI filters (low-pass, high-pass, or band-stop) on power supply lines or signal lines to prevent high-frequency noise from reaching sensitive electronics.
  • Capacitors: Capacitors between power lines and ground can help smooth out high-frequency noise.

6. Distance from EMI Sources

  • Separation: Keep sensitive electronics as far away as possible from sources of EMI, such as motors, ignitions, and power cables.

7. Proper Cable Routing

  • Avoid running signal cables near power lines, ignition systems, or any high-current cables to reduce the possibility of picking up interference.

8. Use EMI-Resistant Components

  • Whenever possible, use components that are specifically designed to be resistant to EMI, such as EMI-hardened sensors, controllers, and processors.

9. Suppress Noise at the Source

  • Suppress ignition noise: Use resistor-type spark plugs or ignition leads with built-in suppression to reduce EMI from the bike’s engine and ignition system.
  • DC-DC converters: For bikes with electric systems, install noise-suppressed DC-DC converters to minimize EMI from power supplies.

By implementing a combination of these techniques, you can significantly reduce the impact of EMI on your projects electronics. If you need help with a specific part or scenario, feel free to provide more details!

1 Like

I have the impression that you may not have much experience with EMI.
It seems that you have collected generic information from external sources.
Can you confirm that you have a solid understanding and experience of the information you have posted?
If not, can you at least confirm that the posted information is from a source with solid understanding and experience of EMI?

I do have knowledge of programming and simple circuits like the Wheatstone bridge, but Im not working quite often with those things. Additionally I have had very little exposure to EMI. To be honest, I didnt expect the effects of EMI to be so significant. Do you have any tips for me on what I should change first and how? :frowning:

My post was intended to be an answer to post #10 of @gilshultz and was not addressed to you. sorry for the confusion.

1 Like

@deusvult

You could try my HX711 library,
It has functions to take the average of several reading, or the median just to reduce noisy measurements.

I was doing this before you were in diapers.

@gilshultz Thanks for the clarification.

Perhaps just smoothing the values with averaging the values, slight delay, but so what?

const int sensorPin = A0;
const int numSamples = 10; // Number of readings to average
int readings[numSamples]; // Array to store readings
int readIndex = 0;
int total = 0;
int average = 0;

void setup() {
Serial.begin(9600);
for (int i = 0; i < numSamples; i++) {
readings[i] = 0; // Initialize array
}
}

void loop() {
total = total - readings[readIndex]; // Subtract oldest value
readings[readIndex] = analogRead(sensorPin); // Read new value
total = total + readings[readIndex]; // Add new value
readIndex = (readIndex + 1) % numSamples; // Circular buffer index

average = total / numSamples; // Compute the average
Serial.println(average);

delay(10); //
}

I've never used the HX711 so I don't really know what I'm talking about, :smiley: but "only" 2-digit variations with 24-bits is hard for me to believe... With 24-bits you can count to 16 million so 2 digits of noise/error/instability is a fraction of a percentage error (of full scale).

Strain gauges put-out small voltages (depending on the amount of strain, of course) and whenever you have small voltages, noise is a problem.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.