0

i'm currently a student and my project is to create a weighing scale using 50kg load sensors (x4) with HX711 amplifiers, load combinator and Arduino UNO. I've connected the load combinator and HX711 based on the picture below:

connection of load combinator to hx711

I'm wondering after this connection, how do i connect it to the pins of Arduino UNO and does anyone know the codes to make the load sensors work? Because currently i keep getting 0kg as the final value as well as the offset value.

  • How have you connected it to the Arduino? What code are you running? How are the rest of the pins on the bridge board wired? – Majenko Feb 1 '18 at 10:34
  • part of your school learning is how to do research. ... i do not think that research is asking someone to give you the answer. – jsotola Feb 1 '18 at 20:40
0

To be able to wire load sensors up you first need to understand how they work and what the wires on them actually mean. There are no standards as regards colour coding of the wires.

So step one is to find out the colour coding of your load cells. Assuming they are "normal" cheap 3-wire ones, internally they look like:

schematic

simulate this circuit – Schematic created using CircuitLab

You need to identify those wires on your cells. We'll call them +, C and - (in that order) from now on.

The idea is that you provide power between + and - and a varying voltage comes out of C depending on the load applied. More load means a lower voltage, since R1 and R2 form a simple potential divider.

However that's not enough to get good results - the voltage differences are too small. So they are usually used as part of a Wheatstone Bridge. This allows a much smaller voltage variance to be detected.

The Wheatstone Bridge is created by the combinator board. It does it by combining the individual parts of separate cells together to form just two load cells along with the static resistances. This is the form the Wheatstone Bridge create takes:

schematic

simulate this circuit

I have boxed in each load cell so you can see how two "variable" legs combine into a single variable resistance, and two "static" legs combine into a single static resistance.

Now you can see how you could test the combinator to make sure it's giving proper results. Apply a voltage between E+ and E- (say 5V) and measure the voltage between A+ and A-. Apply pressure to the load cells (all of them at once) and observe a change in the voltage between A+ and A-.

Assuming that is showing good results (the voltage change will be quite small, so set your DMM to its most sensitive setting), your next point of call is the connection to the Arduino itself.

The HX711 uses a digital serial protocol. Sparkfun has software that bit-bangs that protocol over any pair of IO pins you choose. There is nothing special about which pins are chosen - any two can be used. So as long as you have +5V, GND and the two data pins connected up to the Arduino there's not much that can go wrong.

So that then leaves the software. The biggest mistake people often make is to not tell the software which pins are being used for the serial communication. Or telling it the wrong pins - getting the clock and data pins mixed up, for instance. This would be the first port of call for checking the software. Make sure you have the right pins specified. Quite how you do that without seeing your software I can't say, but Sparkfun have some example software (scroll down to the bottom of the page) which just uses a pair of #define macros to specify the pins.

0

thank you for your help to my question and sorry i was not being specific enough.

Initially the connection of the weighing scale was based on this: Connection of Arduino to Load cells

However, after much research, i've decided to give the load combinator a try and use it to connect all the 4 load sensors to form a Wheatstone Bridge that will then connect to the Arduino. So basically, the load combinator is just another add on component.

As for my codes, this is how it looks like:

#include <hx711.h>
#define DOUT 3
#define CLK 2

Hx711 scale(3,2);

int count=0;

float sum=0;
float value;
float avg=0;
float offset;
float toffset;

int count2;

float V;
float VT;
float total;
int t;
float foffset;

void setup() 
{
  Serial.begin(9600);
  Serial.println("HX711 Test");
}

void loop()  
{
  for(count=0;count<10;count++)
  {
    value = (scale.getGram()*0.07);
    sum = sum + value;
  }
        toffset = +(sum / 10);
         Serial.print("Offset: ");
        Serial.print(toffset, 1);
        Serial.println(" kg");

        Serial.println("Please stand on the plate and do not remove both of your legs.");
        delay(4000);

  for(count2=0;count2<10;count2++)
  {
    V= (scale.getGram()*0.07);
    total=total+ V;
  }

  VT=(total/10);
  Serial.print("Average Weight: ");
  Serial.print(VT, 1);
  Serial.println(" kg");

   if(foffset= -toffset)
   {
    Serial.print("Final Weight: ");
    Serial.print(((VT+foffset)*-1), 1);
    Serial.println(" kg");
   }
 else 
  {
    if(foffset=toffset)
   {
    Serial.print("Final Weight: ");
    Serial.print((VT-foffset), 1);
    Serial.println(" kg");
   }
 }
 Serial.end();
}
  • You should not answer your own question with information about your question. You should edit this into your question and delete this answer. I will leave it here for now to give you easy access to it, but it will be deleted soon. – Majenko Feb 2 '18 at 11:56

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.