Multi axis load sensor array

DrDiettrich:
Please enclose all code in code tags </>.

A crawling value can result from thermal effects, or integration on open pins. Give your circuit some time for warm up and thermal settling (10 min.), then calibrate and check again. If the value converges to the supply voltage, after some time, check the circuit for unconnected pins or too high resistors.

Sorry, still figuring out the format for y'all. I give the warm up a try later today. I also had a friend last night recommend a 0-200ohm variable resistor. http://www.skycraftsurplus.com/trimpot200ohm.aspx His claim was that the bridge may not be set correctly and there could be some noise bleeding through the resistor. Thought?

Noise does not normally result in a directed change of a value, it tends to produce jitter.

Eventually also a strain gauge is creeping under load, depending on the glue used to fix it to a surface.

What behaviour do you see after removing the load? Does the added offset persist, still increases or decreases over time?

DrDiettrich:
What behaviour do you see after removing the load? Does the added offset persist, still increases or decreases over time?

I've fired it up and just let it do its thing for about 15min before testing.

The downward trend is consistent with and without loads on the cell. On start up it will zero and immediately fall into ever increasing negative values. If a load is added, the values will increase by what I can only guess is the amount of the load. While the load is applied, the downward trend continues. Once the load is removed, the approximate value of the load is removed and the downward trend continues.

The downward trend seems to be a constant of integration of some sort. For example, if I start the code it reads zero then falls to -9lb. I then add 15lb weight it will jump to 35lb(can't calibrate it). As the weight remains, the value will fall to 28lb. If I then remove the weight, the new value will be -16 or lower.

Show a circuit diagram, perhaps you missed to connect the bridge properly.

DrDiettrich:
Show a circuit diagram, perhaps you missed to connect the bridge properly.

The attachment, load_cell_diagram.pdf from the first post today has a drawing I made. I'm no pro, but the white wire is connected to E+, and then a jumper goes through a 100ohm resistor then to A-. The black wire is connected to E- then a jumper goes through a 100ohm resistor then to A- as well. And the red wire is connected to A+.

Edit: I added a slightly better drawing to the pdf on the attachment with this post.

Load Cell diagram.pdf (270 KB)

Another test: what happens if you replace the sensor by another 100 Ohm half bridge?

What resistance does your sensor have, what's the bridge supply voltage?

DrDiettrich:
Another test: what happens if you replace the sensor by another 100 Ohm half bridge?

What resistance does your sensor have, what's the bridge supply voltage?

It works! So after doing it wrong for too long. I noticed that the calibration factor changed the speed of the drift. So I started messing with the calibration factor. Don't know exactly what it does, but I played with it long enough to get a stable and repeatable result. I've got to look that up to see what I did, but it is working! More to come...

Can I use this? It's an 8-bit parallel to serial shift register.

With this? They are the hx711 chips I'm using to amplify the load cells. They are 24 bit.

The way I understand bits so far is very rough and not even worth explaining my knowledge. But, my thinking is if the shift register only processes 8 bits at a time the code will just have to reflect the extra bits from the hx711? I do not have code at this time to run all 12 load cells at the same time.

I do have enough pins to run them all. But, I'd like to make some room to put an LCD display to output the data and maybe a button to cycle through it. Again, no code. Just looking to see if I'm on the right track.

FirstRodeo:
Can I use this?

With this?

No.

Why don't you try this: GitHub - compugician/HX711-multi: An Arduino library to interface multiple HX711 units simultaneously Supposedly it allows you to use one clock line for all hx711s, so you'd only need to use 13 pins to get data from 12 hx711s. (I've never tried it.)

DaveEvans:
No.

Why don't you try this: GitHub - compugician/HX711-multi: An Arduino library to interface multiple HX711 units simultaneously Supposedly it allows you to use one clock line for all hx711s, so you'd only need to use 13 pins to get data from 12 hx711s. (I've never tried it.)

That looks like the exact thing I have now. I already have a way to run every chip on the same clock and same power out. The way I understand the shift registers is that they accept and organize data then distribute the data with respect to their designed direction (serial out or parallel out). The chip I have is serial out parallel in. So my thinking is that the hx711 gives the shift register its 1's and 0's then the shift register takes the aforementioned 1's and 0's and delivers them to the board where another set of code will correctly read the new encoded 1's and 0's and give me the data I need.

So, my new question is. Is there a better response than, "No."?

Use a multiplexer to feed your 12 HX711 data output lines into one Arduino digital input pin. With a 16-channel mux, your Arduino will also use four digital output pins for the mux address lines. So you'll use a total of five Arduino pins to get the data in. Six if you need to use the mux enable/disable pin (probably don't need to). Seven counting the clock line.

Also...after a "bit" :slight_smile: more thought... the answer to your previous question should have been "yes, sort of." You could probably use two 8 bit daisy-chained parallel-in serial-out shift registers to read all 12 HX711 data output lines. Would take four Arduino pins for the shift registers and one for the hx711 clock. The code would be somewhat less straightforward than using a mux.

DaveEvans:
Use a multiplexer to feed your 12 HX711 data output lines into one Arduino digital input pin. With a 16-channel mux, your Arduino will also use four digital output pins for the mux address lines. So you'll use a total of five Arduino pins to get the data in. Six if you need to use the mux enable/disable pin (probably don't need to). Seven counting the clock line.

Also...after a "bit" :slight_smile: more thought... the answer to your previous question should have been "yes, sort of." You could probably use two 8 bit daisy-chained parallel-in serial-out shift registers to read all 12 HX711 data output lines. Would take four Arduino pins for the shift registers and one for the hx711 clock. The code would be somewhat less straightforward than using a mux.

I'm going to pursue the shift register route. After all, if it were easy, everyone would do it, right? Got any tips for the code structure? :smiley:

FirstRodeo:
Got any tips for the code structure?

Sure. Follow the C example in the HX711 data sheet, except:

  • use an array to hold "Count," and do each operation on Count for each element of the array
  • regarding "while(ADDO)" - make this "while all 12 data lines are not low" (or "while at least one data line is high")

The array works, here is what I've got so far. They all work, they're all accurate, and I can read them all at once. I wanted to share the simple code with the world since there really isn't a clean code out there that I've found that works in this fashion. At least not a code a beginner like myself can understand. :roll_eyes:

I've cut the sensors down to 10 since getting a separate sensor in the (what I call) negative z direction proved to be an engineering nightmare. I found a way, but it wasn't cost effective for the project I'm doing. I opted to keep the dual sensors for the x and y directions since it was easy enough and allows me an extra level of accuracy.

Beyond this, if anyone would like to help out with the coding, I've had an incredibly hard time getting this far. I still would like to figure out a code to get the shift registers working. SN74HC165N is what I'm working with. I'd like to save the pins for add-ons like an LCD and some buttons to make the thing fancy

And after or before that, probably the later, I'll be wanting to load this data into excel to run calculations with the readings.

Attempt_1.ino (7.81 KB)

HX711.h (2.32 KB)

HX711.cpp (2.54 KB)