HX711 misbehaving when a potentiometer is used in parallel

Hello, how's it goin'?

The idea:
I'm building an automatic counting scale using 4x 50kg load cells in a Wheatstone bridge configuration and connected into an HX711 amplifier, which then connects into my Arduino Uno through digital pins 4 and 5. Along with the HX711 the Arduino is also connected to a 16x2 LCD display, 3 LEDs, 2 pushbuttons, and a potentiometer. The issue seems to be hardware related, but I can share the source code if needed (it's a mess though, but it works as intended whenever I'm just using the HX711 and LCD display).

The issue:
So here's the issue: I was hoping to use either a push button or a potentiometer to determine how many products would be measured by the scale. I settled on a middle ground and am using the potentiometer as the selector and the push button (with a software interrupt) as a confirmation button. Tare is then performed a few seconds after the press of the button. The issue seems to be that, when both are connected in parallel with the HX711 board the readings get a little bit crazy. Without anything connected the scale's readings oscillate a bit but that's expected as the load cells have a precision/accuracy rating of +/- 25g. Whenever they are connected though the HX711 can display inaccurate readings (sometimes up to +/- 100g in the span of a few seconds). I've attached the schematics of the circuit (the website didn't really have an HX711 module though, so I've used a breadboard to illustrate and attached another picture of that configuration), demonstrating how all the components are connected in -what I assume is- parallel. Are my worries justified or should I look for other sources of inaccuracy in the system?

1 Like

Schematic?

the fritznuts thing is not a schematic.

This is the "circuit part" of the schematic, @Idahowalker, everything else is connect directly to the Arduino and not to the main power line. The 5V source is supplied by the Arduino as well.

circuit_v2.PNG

circuit_v2.PNG

what is the pot's value?

Why not a resistor?

What is the wiper arm connected to?

A picture/image of the thing with the pot wired in place?

shrug

what is the pot’s value?

It’s a 10k potentiometer (forgot to add it in the schematic, sorry)

Why not a resistor?

I need the resistance to change, I’m using it to select an element inside an array, reading the pot’s output with analogRead() then mapping it to stay between 0 and the array’s length

What is the wiper arm connected to?

The wiper arm is what the operator (in this case myself) will use to select how many products will be counted

A picture/image of the thing with the pot wired in place?

Unfortunately I don’t have my phone on me, so I can only upload some pictures tomorrow when I bring it to class

The ground lead for the HX711 needs to run alongside the SCK and DT lines directly between Arduino
and HX711 - every fast logic signal needs to runalongside its ground return to avoid signal reflections
and crosstalk and other glitches - logic signals are high speed and high speed signals are fussy,
especially clocks which can double-count through poor layout.

Your whole grounding and power arrangement could be improved by being a star, not a big loop
round all the breadboards. This may also be the reason for dodgy readings as noise voltages from
the display are being injected into the HX711.

Some more decoupling on the breadboards is a great idea, never skimp on decoupling, wierd and
confusing stuff can happen through inadequate decoupling - you never want to be in that situation
as the symptoms are often Heisenbugs and pattern-sensitive.

Then your variable resistor is drawn wrong.

OK. I'll guess

I am guessing the wiper arm travels one way it goes to 5V and the other way it goes to 0 volts. I bet when you drop the volts down too low the hxthingy do the mess up?

As you may have surmised the issue is not your schematic (although there is some question on the pot connections) but in the wiring and connections.

I would move the HX711 to the ground near the AREF and the HX711 +5 to at or very near the +5 pin on the mega.

I would add a capacitor 0.1µF from A0 to ground. Again near the board.

I would get the spec for your pot and triple verify you are connecting the “ends” to +5 and Gnd. And again near the mega pins. I would leave the wiper unconnected until you get thinks running stable.

When using the solderless breadboards, remember… keep the grounds and V+ all near the same spot, not traversing the board as your diagram shows.

BTW, welcome to the real world. Nothing is as clean as it appears in the drawings.

I can only post once every five minutes, so I'll group all the replies into one.
@MarkT

Your whole grounding and power arrangement could be improved by being a star, not a big loop
round all the breadboards. This may also be the reason for dodgy readings as noise voltages from
the display are being injected into the HX711.

Star as in something like a three-phase transformer connection?

Some more decoupling on the breadboards is a great idea, never skimp on decoupling, weird and
confusing stuff can happen through inadequate decoupling - you never want to be in that situation
as the symptoms are often Heisenbugs and pattern-sensitive.

I'm surprised none of my professors ever spoke about decoupling, I did look briefly into it and it looks like kind of a big deal, I certainly will dive deeper into it before trying to design a PCB for the final presentation. Thanks!


@Idahowalker

Then your variable resistor is drawn wrong.

I thought so too, but I've learned it for next time.

I am guessing the wiper arm travels one way it goes to 5V and the other way it goes to 0 volts. I bet when you drop the volts down too low the hxthingy do the mess up?

If I move it while I'm measuring something then the scale just goes absolutely crazy, yeah. However if it sits still then it isn't as much of a bother (after changing the HX711 GND from the breadboard to the GND near AREF)


@JohnRob

I would move the HX711 to the ground near the AREF and the HX711 +5 to at or very near the +5 pin on the mega.

I did, and it actually helped a lot. Thanks!

I would add a capacitor 0.1µF from A0 to ground. Again near the board.

This is the next step, I'll try to minimize a lot of the noise from the different components.

BTW, welcome to the real world. Nothing is as clean as it appears in the drawings.

Yeah, I really wish it was more like coding hahah

Can I congratulate you on a really nice readable fritzy rubbish thing.

My immediate observations are

1; its always worth putting decoupling - around 100uF + 0.1uF - across the supply rails on the breadboard.

2: there are many good reasons for connecting your switches to the ground rail and using pull-ups,

(as shown in your schematic) ..

rather than the +Vcc rail and pull-downs as you have them shown in the fritzy.

3: your analog ground (from the pot) should be kept seperate from the digital ground (all the rest) and just connected at the Arduino. Thats one reason why there are multiple ground connections on the uno.

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