0
\$\begingroup\$

I'm trying to use a Load cell with the INA 125P amplifier with my FRDM KL-43Z board. Currently, I have it connected like so enter image description here with the Arduino being replaced with the KL43Z analog input (Port B bit 0), 5V and ground pins. What I have decided to do is use the ADC module of the KL43Z code (MCU Expresso):

 SIM->SCGC5|= SIM_SCGC5_PORTB_MASK;
    PORTB->PCR[0]=0x000;

    SIM->SCGC6|= SIM_SCGC6_ADC0_MASK;
    ADC0->CFG1=0x40|0x10|0x04|0x00; 
    ADC0->SC2 &= ~0x40;
    ADC0->SC1[0]=0b001000;

  volatile static int i = 0 ;
  while(1) {
        i++ ;
        while(!(ADC0->SC1[0]&0x80)){

            }
        result= ADC0->R[0];
       printf("res: %d\n", result);
      ADC0->SC1[0]=0b001000;
    }

The result of the ADC register value fluctuates greatly. Sometimes it will sit at around an average of 64 but will then change values significantly and decrease. Applying a force to the load cell seems to have no effect.

If anyone could provide some tips or shed some light on my situation it would be greatly appreciated as I am new to working with this kind of equipment.

Additionally, what would be the ideal gain resistance. I have tried using a 75 Ohm resistance, (20 kg load cell 1mV/V) but have also seen a video that uses one around 33 Ohms, so I'm not certain what value is ideal. Load cell data sheet is available here.

\$\endgroup\$
  • \$\begingroup\$ The value of the gain resistor isn't a "best" and it isn't something you pick by watching a video and saying "that looks good." You need to be able to calculate the needed gain to get the load cell output up to fullscale for your ADC. Once you know the gain, you get out the datasheet for the instrumentation amplifier and use the information there to determine the correct gain setting resistance to achieve the gain you need. I don't know enough about load cells to make sense of the given "datasheet" to find the output range. \$\endgroup\$ – JRE Mar 27 '18 at 9:28
  • \$\begingroup\$ To take your two examples, 33 ohm gives a gain around 2000. A 75 ohm gain resistor works out to a gain of around 900. Which do you need? Work out the numbers and see. \$\endgroup\$ – JRE Mar 27 '18 at 9:33
0
\$\begingroup\$

I don't know why your measurements are so unreliable and/or wrong. You might have a wiring problem or a software problem. I'm not going to try to resolve that.

I'm going to address the gain set resistor.

I looked up how the mV/V rating works (the Wikipedia site on load cells explains it clearly enough.)

You are powering the load cell from 5V. So, the 1mV/V rating means that you will get 5mV out of the load cell when you place 20kg on it.

The ADC on your development board seems to be a 12bit ADC with a 1.2V reference voltage.

You will need to amplify the 5mV from the load cell to 1.2V in order to get good resolution.

I come up with a gain of 240. Now, you can choose the gain resistor.

Refer to the datasheet for the INA125. There's a description in there for calculating the gain for a given resistor value: G= 4 + (60k/Rg)

You can rearrange that to go from gain to the needed resistor: Rg = 60k/(G-4)

So, you need a gain resistor of 254 ohms. The next closest value in 1% tolerance parts would be 255 ohms.


There's probably more to it than that. The datasheet for the load cell mentions an offset that you'll have to account for. The mV/V rating is also not perfect - it can be higher or lower by a bit.

You may also not want to go full scale on the ADC - you need a little "headroom" to cover inaccuracies and whatever happens if you put too much of a load on the cell.

This was intended to give you some idea of the process beyond "should I use this value that I don't understand, or this other value that someone else used that I don't understand, either."

\$\endgroup\$
  • \$\begingroup\$ Oh okay, thanks for the little tips. One more question. For the connection of pin 4 on the INA 125p Vrefout, should which Vref should I connect it to? Is it right to have it connected to the 5V Vref Pin 15? or should it VrefBG (Pin 13) for 1.24 V? \$\endgroup\$ – J. Wang Mar 27 '18 at 22:54

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.