Go to last post By: normnet
Today 09:31
Forum: FineLine IDE
Starter: normnet
Views: 33570
Replies: 121
Today 08:52
Forum: The Lounge
Starter: Stephen Moss
Views: 0
Replies: 20
Today 01:18
Forum: Wanted and For Sale
Starter: cassio_franquini
Views: 0
Replies: 0
Yesterday 21:12
Forum: Proton Plus Compiler v3
Starter: Henk57
Views: 0
Replies: 7
Yesterday 15:40
Forum: New devices and techniques
Starter: normnet
Views: 0
Replies: 7
Yesterday 13:51
Forum: The Lounge
Starter: Henk57
Views: 0
Replies: 85
+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Hx711 calibration61 days old

  1. #1
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    17
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    2.37 MB

    1 Not allowed!

    Default Hx711 calibration

    Iam using load cell amplifier HX711 module.I have got raw values from module but iam not able to calibrate with load cell.I want make a universal calibration factor in which I can use any type of load cell. Secondly I want to tare the values.pls help.

  2. #2
    Member ricardourio's Avatar
    Join Date
    Jan 2007
    Posts
    202
    Thumbs Up
    Received: 5
    Given: 39
    Total Downloaded
    2.11 GB

    0 Not allowed!

    Default Re: Hx711 calibration

    Hello,

    No calibration is almost impossible, load cells works with very low signals so it's important to gage it. I suggest that you create a calibration routine, that you record no load value and a loaded value, like 1 Kg.

    Ricardo Urio

  3. #3
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    17
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    2.37 MB

    7 Not allowed!

    Default Re: Hx711 calibration

    Pls guide me ,how I can get average of adc values.example needed.

  4. #4
    Member ricardourio's Avatar
    Join Date
    Jan 2007
    Posts
    202
    Thumbs Up
    Received: 5
    Given: 39
    Total Downloaded
    2.11 GB

    0 Not allowed!

    Default Re: Hx711 calibration

    Hello,

    It's a very basic question, and you will need to make some research. A initial way is to create a routine where you read 12 times the adc value, recording the sum of all values and min and max, in the end you divide the sum by 10 after subtracting the min and max values. It's necessary to do it with no load and with a knowed load. After it the variation Kg/mv wil be defined.

    Ricardo Urio

  5. #5
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,483
    Thumbs Up
    Received: 97
    Given: 29
    Total Downloaded
    2.25 GB

    0 Not allowed!

    Default Re: Hx711 calibration

    Hello Amod
    Another way is to bring in an odd number of samples into an array, sort the array and then use the middle value. I saw this elsewhere on the forum and it seems to work well although I think Ricardo's method is a good solution too.
    In the past I have just sampled a number of times and calculated an average.
    John

  6. #6
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    17
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    2.37 MB

    0 Not allowed!

    Default Re: Hx711 calibration

    I got the values in kg and they are stable.

    I want to include TARE function to my project.When i minus current reading it gets zero but till i press button.When i Release button same old readings displays.
    pls Help.

  7. #7
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    768
    Thumbs Up
    Received: 20
    Given: 14
    Total Downloaded
    465.13 MB

    0 Not allowed!

    Default Re: Hx711 calibration

    Hi Amod

    I would do it something like this:

    Use an adjustment variable, initially set to zero, when you press the button set the adjustment variable to the current averaged ADC value from the load cell.

    For the output/display reading subtract the adjustment variable from the current averaged ADC output.

    If you have trouble doing that post your code and I'm sure you'll get some help.

  8. #8
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    17
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    2.37 MB

    0 Not allowed!

    Default Re: Hx711 calibration

    my Program

    Device = 16F877A
    Xtal = 20
    All_Digital On
    Include "modedefs.bas"
    Declare LCD_DTPin = PORTB.4
    Declare LCD_RSPin = PORTB.2
    Declare LCD_ENPin = PORTB.3
    Declare LCD_Interface = 4
    Declare LCD_Lines = 2
    Declare LCD_Type = 0


    Dim y As Dword
    Dim i As Byte
    Dim COUN As Dword
    Dim gram As Float
    Dim Value As Word
    Symbol TARE = PORTC.3
    Symbol ADDO = PORTC.4
    Symbol ADSK = PORTC.5
    TRISC=%00011000
    DelayMS 150
    Cls


    Main:
    ADDO=1
    ADSK=0
    COUN=0
    While ADDO=1:Wend
    For i= 0 To 23
    ADSK=1
    COUN=COUN<<1
    ADSK=0
    If ADDO =1 Then Inc COUN
    Next i
    ADSK=1
    COUN=COUN^0x800000
    gram=8388608-COUN
    gram=((coun-124000)*10)/500
    gram=gram-165090
    y=0
    If TARE=1 Then y=y-gram
    ADSK=0

    Print At 2,4, Dec1 y
    GoTo Main

  9. #9
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    768
    Thumbs Up
    Received: 20
    Given: 14
    Total Downloaded
    465.13 MB

    0 Not allowed!

    Default Re: Hx711 calibration

    I think something like this should give you an idea:

    Code:
    If BUTTON1 = 0 Then 
    adjustmentVal = gram
    EndIf
    
    displayVal = gram - adjustmentVal
    You would not need to worry about debouncing the button, I assume your code is looped through quite quickly so as long catch the event it would set the value.

    You would need to make the button an input on a pic port (to ground) and have a pull-up resistor or enable one in software.

  10. #10
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    17
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    2.37 MB

    0 Not allowed!

    Default Re: Hx711 calibration

    Thanks SimonJA.I got my work done.
    My new problem is that my program runs fine on lcd but when i converted my code for 6 digit seven segment display all segment blinks for half a second repeatedly.
    and it only show positive value and doesnt show negetive value.
    here is my code


    Device = 16F877A
    Xtal = 16
    Include "modedefs.bas"
    All_Digital = True





    Dim dg1 As Dword
    Dim DG2 As Dword
    Dim DG3 As Dword
    Dim DG4 As Dword
    Dim DG5 As Dword
    Dim DG6 As Dword

    Dim DIGIT As Dword
    Dim DG As Byte
    Dim COUNTT As Byte


    Symbol TARE = PORTD.4
    Symbol ADDO = PORTC.3
    Symbol ADSK = PORTC.4



    Dim N As Float
    Dim adjval As Dword
    Dim disval As Float
    Dim i As Byte
    Dim COUN As Dword
    Dim gram As Float


    TRISA=0
    TRISC=%00001000
    TRISB=0
    TRISD=%00010000
    TRISE=0

    GoSub display


    Main:
    ADDO=1
    ADSK=0
    COUN=0
    While ADDO=1:Wend
    For i= 0 To 23
    ADSK=1
    COUN=COUN<<1
    ADSK=0
    If ADDO =1 Then Inc COUN
    Next i
    ADSK=1
    COUN=COUN^0x800000
    gram=8388608-COUN
    gram=gram/50
    ADSK=0
    If TARE=0 Then 'tare routine
    adjval=gram
    EndIf
    disval=gram-adjval
    N=disval
    GoSub display
    GoSub DIGITCALC
    GoTo Main


    display:
    For COUNTT=0 To 99

    PORTB=dg1
    PORTA.5=0
    DelayUS 100
    PORTA.5=1

    PORTB=DG2
    PORTA.4=0
    DelayUS 100
    PORTA.4=1

    PORTB=DG3
    PORTA.3=0
    DelayUS 100
    PORTA.3=1

    PORTB=DG4
    PORTA.2=0
    DelayUS 100
    PORTA.2=1

    PORTB=DG5
    PORTA.1=0
    DelayUS 100
    PORTA.1=1

    PORTB=DG6
    PORTE.0=0
    DelayUS 100
    PORTE.0=1

    Next COUNTT

    Return


    DIGITCALC: ''THIS ROUTINE BREAKS UP THE NUMBER INTO 3 DISTINCT PARTS - DG1,DG2,DG3,DG4,DG5,DG6
    'NOTICE THAT ANOTHER SUBROUTINE IS CALLED EACH TIME


    DIGIT=0
    LP1:
    If N<10000 Then DS1
    N=N-10000
    DIGIT=DIGIT+1
    GoTo LP1
    DS1:
    GoSub FND
    dg1=DG
    DIGIT=0
    LP2:
    If N<1000 Then DS2
    N=N-1000
    DIGIT=DIGIT+1
    GoTo LP2
    DS2:
    GoSub FND
    DG2=DG


    DIGIT=0
    LP3:
    If N<100 Then DS3
    N=N-100
    DIGIT=DIGIT+1
    GoTo LP3

    DS3:
    GoSub FND
    DG3=DG


    DIGIT=0
    LP4:
    If N<10 Then DS4
    N=N-10
    DIGIT=DIGIT+1
    GoTo LP4

    DS4:
    GoSub FND
    DG4=DG


    DIGIT=N
    GoSub FND
    DG5=DG

    Return




    '_________________________________________________ _________________________


    '_________________________________________________ _________________________
    FND: ''THIS ROUTINE IDENTIFIES THE SEGMENTS TO LIGHT UP

    '7 SEGMENTS WIRED UP AS FOLLOWS

    'A -PORTB.7
    'B -PORTB.6
    'C -PORTB.5
    'D -PORTB.4
    'E -PORTB.3
    'F -PORTB.1
    'G -PORTB.2
    'DECMAL=PORTB.0

    FND0:
    If DIGIT>0 Then FND1
    DG=%00000101
    GoTo FNDEND

    FND1:
    If DIGIT>1 Then FND2
    DG=%10011111
    GoTo FNDEND

    FND2:
    If DIGIT>2 Then FND3
    DG=%00100011
    GoTo FNDEND

    FND3:
    If DIGIT>3 Then FND4
    DG=%00001011
    GoTo FNDEND

    FND4:
    If DIGIT>4 Then FND5
    DG=%10011001
    GoTo FNDEND

    FND5:
    If DIGIT>5 Then FND6
    DG=%01001001
    GoTo FNDEND

    FND6:
    If DIGIT>6 Then FND7
    DG=%01000001
    GoTo FNDEND

    FND7:
    If DIGIT>7 Then FND8
    DG=%00011111
    GoTo FNDEND

    FND8:
    If DIGIT>8 Then FND9
    DG=%00000001
    GoTo FNDEND

    FND9:
    DG=%00011001

    FNDEND:
    Return
    '______________________________

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: 9
    Last Post: 25th March 2018, 07:54
  2. ADC Calibration
    By dmTulsa in forum Tips 'n Tricks
    Replies: 0
    Last Post: 24th February 2010, 19:43
  3. ADC calibration
    By dmTulsa in forum The Lounge
    Replies: 19
    Last Post: 18th February 2010, 05:42
  4. touchpad calibration
    By buddhafragt in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 29th September 2009, 16:08
  5. Calibration
    By dmTulsa in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 29th December 2006, 15:17

Tags for this Thread

Posting Permissions

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