HX711 Erratic Calibration


+ Reply to Thread
Results 1 to 3 of 3

Thread: HX711 Erratic Calibration10 days old

  1. #1
    Inactive member dawaherjesus,'s Avatar
    Join Date
    May 2020
    Posts
    1
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default HX711 Erratic Calibration

    Dear.
    I am doing a small project with a PIC 16F877A, HX711 and a load cell of 150 Kg, at the moment I am simulating in Proteus 8.

    Click image for larger version

Name:	Sin título.jpg
Views:	42
Size:	57.3 KB
ID:	3954

    I have problems with the calibration or adequacy of the signal of the HX711.
    I can already read the module and see the weight that is in the load cell on an LCD, but the measurement is incorrect, as the value increases, the difference is greater. if I perform a tare or zero the difference is greater.

    Click image for larger version

Name:	Sin título1.jpg
Views:	43
Size:	22.0 KB
ID:	3953

    I would like to know if it is a simulation problem or my code.

    I have reviewed in the forum and can not find how the HX711 is calibrated despite the fact that there is a topic entitled "Calibration HX711"

    the code i am using:

    Code:
    LoadCell:
        Dataa = 1
        Clock = 0
        Hx711Cnt = 0
        While Dataa = 1 : Wend
        For i = 0 To 23
            High Clock
            Hx711Cnt = Hx711Cnt <<1
            Low Clock
            If Dataa = 1 Then Inc Hx711Cnt
        Next
        High Clock
            Hx711Cnt = Hx711Cnt^0x800000
            gram = ((Hx711Cnt-124000)*10)/500
            gram = gram - 165090
            gram = gram / 1000
        Low Clock
        Print At 2,1, "   Peso: ",Dec1 gram,"Kg   "
    GoTo LoadCell

  2. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Member ricardourio's Avatar
    Join Date
    Jan 2007
    Posts
    221
    Thumbs Up
    Received: 6
    Given: 54
    Total Downloaded
    3.89 GB

    0 Not allowed!

    Default Re: HX711 Erratic Calibration

    Hello,

    You need to take at least two measurements, one for tare/offset with no weight and another with a well know weight. So you can calculate the real sensitivity of your load cell. Pay attention to the HX711 gain selection when reading it (datasheet page 4)

    Ricardo Urio

  4. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    193
    Thumbs Up
    Received: 8
    Given: 5
    Total Downloaded
    331.75 MB

    0 Not allowed!

    Default Re: HX711 Erratic Calibration

    I worked with that and I set the simulation hardware as real as possible.
    You should consider your mV/V factor on the cell properties. Also to consider that the variation is in percentage rather than the real value. So if your cell is at 50% it should have a result of 25 Kg, as per 50 Kg cell.

    You might use my procedure to read the cell

    Code:
    $define DEBUG 0                   ' no debugging
    $define MAXSAMPLES 40             ' set at least 40 samples
    Dim reading As Dword
    Proc readHX711()
      Dim avrg As Dword
      Dim coun As Dword
      Dim cnti As Byte
      Dim cntn As Byte
      Clear timed_out                 ' reset the flag
      Clear avrg                      ' average variable counter
      Clear cnti                      ' reset value
      Clear ADSK                      ' lowering the clock pin
      ' next instruction gives a little delay before reading the input
      Clear cntn                      ' reset value
      Repeat                          ' loop over the wanted samples
        Clear coun                    ' resetting the variable for the result
        While ADDO = 1                ' probing the data pin to wait the start
          If cnti < 250 Then          ' counting a time-out in case the cell fails
            DelayMS 1                '  for one round
          Else                        ' if exceeds
            Set timed_out             ' flag a no ready signal
            Return                    ' leave the subroutine
          End If
          Inc cnti                    ' keep counting track
        Wend                          ' end of wait ADD0
        cnti = 24                     ' reset the counter
        Clear coun                    ' resetting the variable for the result
        Clear INTCON.7                ' atomic operation no interrupts
        Repeat                        ' counting for 24 bits
          ADSK= 1                     ' ticking the serial clock
          coun = coun << 1            ' shift left the variable
          Clear ADSK                  ' reset the clock
          coun.0 = ADDO
          Dec cnti
        Until cnti <= 0                ' loop for the next bit
        Set INTCON.7                  ' atomic operation completes, OK interrupts
        Set ADSK                      ' reset the clock high
        coun = coun ^ $800000
        Clear ADSK                    ' toggle last bit for 128 gain
    $if DEBUGGER == 3
        HSerOut ["coun = ", Dec coun]
        sendCRLF
    $endif
        avrg = avrg + coun            ' sum the sample to the average value
        Inc cntn
      Until cntn >= MAXSAMPLES
      ' calculate the returned value
      reading = avrg / MAXSAMPLES
    EndProc
    There no returning result, the global variable reading will gives the current value.
    If you are interested I'll will publish the source on my Google drive.

  6. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Read HX711
    By basparky in forum Proton Plus Compiler v3
    Replies: 25
    Last Post: 20th February 2020, 14:06
  2. [SOLVED !] Hx711 calibration
    By amod in forum Absolute Beginners Section
    Replies: 22
    Last Post: 23rd June 2018, 19:26
  3. SPI erratic at 40 Mhz
    By geoff_c in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 18th December 2012, 22:59
  4. Erratic LCD behaviour
    By Peter Holland in forum The Lounge
    Replies: 5
    Last Post: 10th June 2011, 21:24
  5. Erratic Interrupt
    By crankshaft in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 29th March 2006, 22:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts