Interfacing a Load Cell With an Arduino Board | RobotShop Community

Hi, I am a new member. I am not able to see the code. Where should I find it? @bdaouas

You can find the Load Cell Shield Arduino library and examples in this github repository :

1 Like

Thank you for the link. Now I have connected my amplifier board to Arduino and 2 load cells. When I try to load the program I get this error:

Arduino: 1.8.9 (Windows 7), Board: “Arduino/Genuino Uno”

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::~WheatstoneBridge()’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::~WheatstoneBridge()’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::measureForce()’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::getLastForce()’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::getLastForceRawADC()’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Wheatstone_Bridge_Interface_to_Serial\WheatstoneBridge.cpp.o (symbol from plugin): In function `WheatstoneBridge::WheatstoneBridge(unsigned char, int, int, int, int)’:

(.text+0x0): multiple definition of `WheatstoneBridge::linearCalibration(int, int, int, int)’

sketch\WheatstoneBridge.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

Could you please help? My load cells are 5 kg.

@matiussummer Please make sure that you have correctly installed the library. Please follow these instructions.

Hello,
I have two questions regarding the decoupling capacitor for the arduino to enhance the measurement results.

  1. What capacity would you recomend?
  2. Between which pins do I use the Capacitor? Between the AREF & 3,3V or AREF & GND?

Thank you for your help

If you are planning to use external analog voltage reference by connecting the 3.3V pin to AREF, we recommend connecting an external 100nF capacitor between AREF and GND. Also, please don’t forget to use the function analogReference(EXTERNAL) as explained here

Great! Thank you for your quick response :slight_smile:

hello,

I am trying to connect the amplifier to an Arduino NANO, but I cannot get it to work.
I connected the strain1 to A0, strain2 to A1, and then Vin, GND and 5V to the respective connectors, but it is not working like it says it should according to the test procedure (PDF file). Do you have any ideas on what I may be doing wrong?

Pablo

Please connect 3.3V from the Arduino Nano to the 3.3V pin of the load cell shield as the circuitry on the load cell shield (and the load cell excitation pin) is powered through the 3.3V pin. You can also power the shield with 5V by connecting 5V output from Arduino Nano to the 3.3V pin of the load cell shield. In this case, the load cells connected on the shield will be 5V excited (instead of 3.3V).

Thank you for the quick response! That worked perfectly.

One more question, I am trying to connect a half-bridge strain gauge to the shield, but I am not sure which pins to connect it to. Could you help me with it? Thanks again.

Pablo

hello,

I am trying to connect the shield to a quarter bridge strain gauge but when I apply the voltage, the current is too high (and has burned the arduino). I checked the wiring a few times and I think it is properly set (with 3 dummy resistances and the load resistance). Is there something I may be missing?

  1. What is the resistance values of the resistors and the strain gauge ?
  2. How was your bridge powered ?
  3. Could you provide a wiring diagram of your bridge ?

I tried two different setups (shown in the pictures); the strain gauges have a nominal value of 1k.
I think there was a mismatch between the shield datasheet and the webpage of strain gauges configuration given at the site. I checked with different tests and got it to kinda work.
Now, I can get the shield to output either 0V, 3V, or somewhere approximately in the middle (i.e. 1.4 V) but it does not show the change in voltage.
I tried using another amplifier box and I did get a signal but with the shield I am not getting any feedback signal (not even a small one).

SG wire setup.pdf (621.0 KB)

The gain of the AD8426 instrumentation amplifier IC is set to 495 by default on the shield with the gain resistor Rgain = 100 Ohms. A voltage input from the wheatstone bridge of 1.4V or 3V will saturate the output of the amplifier. You probably need to remove the gain resistor for your application (Gain 1 or Gain 2 depending on the channel you are using). When no gain resistor is used, the gain of the AD8426 would be 1 and gain error and drift are minimal. Please note that the gain resistors are smd components, therefor, some smd soldering skills might be needed.

Hello, everybody,

I have been working on a load readout device using load cell 0-300kg with an excitation of 10V and an output of 2mV/V. I have searched the internet and have found 2 ways of doing it first with HX711 amplifier second with load cell shield or nanoshield (company from Brazil make them). Do you know what would be the difference between them two? Which one give me more stable more accurate readout?
Thanks

Hi,

The HX711 Load Cell Amplifier is a single channel amplifier with a digital interface output and provides a 24 bit resolution which is higher than the Arduino’s 12 bit. However, the data output rate only goes to a maximum of 80Hz. The Load Cell / Wheatstone Amplifier Shield is a 2 channel analog output amplifier with a default of 100Hz filter (that can be removed for faster data output rate), therefore, it would be only limited by the ADC sampling rate of the Arduino board that can theoretically be 9600Hz. Also, it’s important to note that the Shield allow a maximum excitation voltage of 5V.

Hello,

I ve read that the shield has two channel so that 2 load cells can be used. I would like to ask :

  1. Is it possible to get measurements for these 2 channels simultaneously in real time applications?
  2. Are the gains of each channel independent of each other?
  3. Is this shield possible to be mounted in NUCLEO-F334R8 microcontroller and in which way ?
    https://www.st.com/en/evaluation-tools/nucleo-f334r8.html
    (It is a ST microcontroller with both Arduino uno v3 connectors and ST connectors)

Thanks
Giannis

Hi,

  1. The Load Cell / Wheatstone Amplifier Shield (2ch) provides 2x independent load cell analog outputs, therefore, yes you can get measurements for these 2 channels simultaneously.
  2. Yes the gains for the 2 channels are independent of each other. Each channel has a gain resistor (Gain1/Gain2) that can be changed.
  3. The Load Cell shield has an Arduino UNO shield form factor. It will provide the analog reading of channel 1 on the analog pin A0 and the analog reading of channel 2 on the analog pin A1. It should work with the NUCLEO-F334R8.

Hope this helps,

Thanks for the quick and useful response.

I would like also to ask:

  1. Let’ s say that I am using only channel 1. What does the pin A0 give me as reading, if I do not use the library code, but just analogRead(A0) ?
    For what I can understand it will be an integer (let’s say n ) between 0 and 1023, right ?
    If yes, I can convert my reading to Volts with the formula : Vout = n*4.9 mV , right?
    I ask because I do not want to print the reading in kg or lbs, but in Volts.
  2. From what I understand, the shield will work for a Wheatstone half bridge (not a load cell but other application) with 350 Ohm gages and resistanses, right?
    Best wishes
    Giannis
  1. Yes and no : If you had an Arduino UNO Board (10-bit ADC with 5V default reference voltage) that would be correct. However, the NUCLEO-F334R8, you are planning to use, has more ADC resolution than an Arduino UNO (12-bit ADC). Therefore, if the NUCLEO-F334R8 has a 5V ADC reference voltage, the formula would be Vout = n*1.22mV

  2. It’s actually the other way around, the shield can directly work with load cells. You can connect a full bridge load cell to each channel and get independent readings on A0 and A1.