0
\$\begingroup\$

I want to connect four 6-wire load cells (Tedea Huntleigh Compression & Tension Load Cell 300kg, 15V dc, IP67, product page and datasheet) into an Arduino or Raspberry Pi and get four independent readings. This is my first time dealing with load cells.

I would like to get an accuracy of 2kg and a range of 25-100 kg on each load cell. The load cells have a recommended excitation of 10V.

My understanding is that, to get a working prototype, I can:

  • not use the two sense wires in the load cell (first suggestion by DaveEvans in this Arduino thread)
  • use a breadboard, even though it's not meant for a sensitive circuit
  • use the 5V supply from the Arduino, which halves the output voltage from the load cell but does not require an extra power supply or an booster converter, with some decrease in precision of the reading
  • use an INA125P amplifier and the wiring in the first link of this thread and connect each load cell to a single analog pin in the Arduino Uno, which only has 5 analog pins
  • calibrate the reading from each load cell with two known weights and extrapolate linearly

Would this work? Which shortcuts would be the first to consider to improve the precision of the readings?

\$\endgroup\$
  • \$\begingroup\$ The Raspberry Pi does not have an ADC, so you would need to add that in to make it work...This makes going straight to an Arduino a good choice (provided the built in ADCs on the Arduino are adequate for your needs). \$\endgroup\$ – evildemonic Mar 22 '19 at 16:02
  • \$\begingroup\$ Please reference the load cell that you will use, There is no point in commenting what an analog system can or can't do if you don't know what the sensor is. Also comment on the accuracy and range that you'd like to obtain. \$\endgroup\$ – Voltage Spike Mar 22 '19 at 16:44
  • \$\begingroup\$ @mmorin Breadboard is fine for a load cell amplifier. It's a DC circuit. \$\endgroup\$ – Nick Alexeev Mar 22 '19 at 17:51
3
\$\begingroup\$

If you use a load cell rated for 200kg full load, with an output of 2 mV/V, and a supply voltage of 5V, then your output voltage will be 10mV for a 200kg load or 5mV for a 100kg load. A change in the load of 2kg will cause a voltage change of 0.1mV.

If you are digitizing this with a perfect ADC using a reference voltage of 5V you need at least 16 bits of resolution to see such a change in voltage. This will not happen with an Arduino. The ADC on an Arduino has 10 bits of resolution, so it can see changes of about 5mV. And we haven't even talked about accuracy yet.

So, you need to provide a differential gain of at least 100X if you want to use an Arduino. Otherwise, you need to find a better ADC. You also need to make sure that your analog reference voltage for the ADC, and the excitation voltage for the load cells, is as stable and accurate as you want your measurements to be.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

I tried two ways: with a pre-programmed SparkFun OpenScale and with a custom circuit with Arduino Nano. Both ways do without the Sense cables, which serve for more accurate readings. They also use 5V instead of 10V, which reduces precision but seems OK for my application (see Elliot Alderson's answer for an excellent guidance on calculating precision and the difference with accuracy). Both use a serial interface, such as the one from the Arduino app (choose Tools > Port, then Tools > Serial Monitor), and both use components specifically for this purpose of load cells.

Easy way with SparkFun OpenScale

SparkFun has an OpenScale made specifically for load cells and provides a tutorial to connect to them. You can calibrate the measurements via the serial interface, as well as other settings. The OpenScale is basically an Arduino mounted on a printed circuit board, so you can also modify the open-source code and flash it to the OpenScale, e.g. with the Arduino app.

Custom way with micro-controller and HX711

The HX711 is an amplifier specifically for load cells (and used in the OpenScale board). I found this tutorial on using an HX711 amplifier and analogue-to-digital converter. It took readings from the load cell and sent to the Arduino nano with 24 bits of depth. See that website for the circuit and for installing the QHX711 library. See also this tutorial for the LCD1602 screen, and this tutorial for adding a push button. The result is here:

Circuit with Arduino Nano, HX711, and load cell

And I modified the original code to refactor the readings, add a tare button, and include a LCD1602 screen:

// Liquid Crystal Display directions from
// https://create.arduino.cc/projecthub/najad/interfacing-lcd1602-with-arduino-764ec4
// www.diyusthad.com
#include <LiquidCrystal.h>

// HX711 and load cell directions from
// https://makersportal.com/blog/2019/5/12/arduino-weighing-scale-with-load-cell-and-hx711
#include <Q2HX711.h>

// Constant variables for display
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

// Constant variables for load cell
const byte HX711_DATA_PIN = 7;
const byte HX711_CLOCK_PIN = 8;
const float KNOWN_WEIGHT = 199.0; // calibrated mass to be added
const long AVG_NUM = 10; // amount of averages for each mass measurement

// Constant variables for the pushbutton
const int buttonPin = 10;

// Global variables for load cell
float slope = 0.0;
long tare = 0L;

// Declare HX711 and LCD
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
Q2HX711 hx711(HX711_DATA_PIN, HX711_CLOCK_PIN);

long take_reading() {
  long x = 0L;
  for (int i = 0; i < AVG_NUM; i++) {
    delay(10);
    x += hx711.read();
  }
  return x / AVG_NUM;
}

void setup() {
  // Initialize serial connection at this baud
  Serial.begin(9600);

  // Initialize LCD
  lcd.begin(16, 2);

  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);

  // allow load cell and hx711 to settle
  delay(1000);

  // Take initial reading for tare
  tare = take_reading();

  // Request known weight
  char buffer[16];
  dtostrf(KNOWN_WEIGHT, 3, 1, buffer);

  Serial.print("Add known weight (g): ");
  Serial.println(buffer);
  lcd.print("Add known weight (g)");
  lcd.setCursor(0, 1);
  lcd.print(buffer);
  // calibration procedure (mass should be added equal to KNOWN_WEIGHT)
  while (hx711.read() < tare + 10000) {
    delay(100);
  }
  long reading = take_reading();
  Serial.println(reading);

  // This slope is fixed throughout
  slope = KNOWN_WEIGHT / (reading - tare);

  Serial.println("Calibration Complete");
  lcd.setCursor(0, 0);
  lcd.print("Weight (g):      ");
}

void loop() {
  // averaging reading
  long reading = take_reading();

  // calculating mass based on calibration and linear fit
  float mass = (reading - tare) * slope;

  // Format string
  char weight[6];
  dtostrf(mass, 3, 1, weight);
  Serial.println(weight);

  char buffer[16];
  lcd.setCursor(0, 1);
  sprintf(buffer, "%16s", weight);
  lcd.print(buffer);

  // Check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (digitalRead(buttonPin)== HIGH) {
    while(digitalRead(buttonPin) == HIGH) {
      delay(100);
    }
    // Lazy debounce
    delay(100);
    tare = reading;
  }
}
| improve this answer | |
\$\endgroup\$
-2
\$\begingroup\$

You have a system composed of FOUR resistors, of value about 400 ohms each.

Power them from +5 volts, install a 0.1uF capacitor across the differential output wires, and wire that to the differential inputs of your microcontroller.

The common-mode output of the bridge will be approximately VDD/2 or 2.5 volts.

If you don't have differential inputs to the MCU, you can still wire the bridge outputs to TWO inputs of the ADC, and subtract the reported-voltages. Some errors will occur.

For noise rejection (switching power supplies, motor-commutator sparks, AM radio transmitters, cellphones, etc) consider this

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I would like to get an independent measurement from each load cell. Does your circuit provide that? \$\endgroup\$ – miguelmorin Mar 22 '19 at 18:00
  • \$\begingroup\$ If you use a dual 4:1 analog mux (MC140xx or MC40xx), this will work. \$\endgroup\$ – analogsystemsrf Mar 23 '19 at 5:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.