Read HX711


+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Read HX7112035 days old

  1. #1
    Member
    Join Date
    Oct 2006
    Posts
    218
    Thumbs Up
    Received: 9
    Given: 20
    Total Downloaded
    751.86 MB

    0 Not allowed!

    Default Read HX711

    Hi,

    I would like to add a HX 711 module to a pic 18f2550. This to add a weigh scale to my project.
    Datasheet: http://www.dfrobot.com/image/data/SE...11_english.pdf
    I need to read the 24 bits from the device but have no idea where to start. Has anyone used this module before?

    At this moment i have the following loop to read the 24 bits from the module:
    Code:
    main:
    While Dout = 1 
    Wend
    For j = 1 To 3
        For i = 1 To 8
            High Slk
            SetBit DataDWord,i*j
            Low Slk
        Next
    Next
    High Slk
    DelayMS 10
    Low Slk
    
    
    DelayMS 2000
    HRSOut Bin DataDWord,"\r\n"
    GoTo main
    But how do i get readable data form this?

    Thanks for any help!
    Last edited by basparky; 1st September 2014 at 21:34.

  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
    Join Date
    Oct 2006
    Posts
    218
    Thumbs Up
    Received: 9
    Given: 20
    Total Downloaded
    751.86 MB

    0 Not allowed!

    Default Re: Read HX711

    If i follow the manual i get something like:
    Code:
    main:
    Dout = 1
    Slk = 0
    DataDWord = 0
    Count1 = 0
    While Dout = 1 : Wend
    
    
        For i = 0 To 24
            High Slk
            Count1 = Count1<<1
            LoadBit DataDWord,i,Dout
            Low Slk 
            If Dout = 1 Then Inc Count1  
        Next
    High Slk
    Count1 = Count1^0x800000
    Low Slk

  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
    Join Date
    Jul 2006
    Posts
    220
    Thumbs Up
    Received: 6
    Given: 38
    Total Downloaded
    11.51 GB

    0 Not allowed!

    Default Re: Read HX711

    H
    I Basparky,
    Did you managed to read your HX711. Would you like to share your code?
    Yves

  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.

  7. #4
    Member
    Join Date
    Oct 2006
    Posts
    218
    Thumbs Up
    Received: 9
    Given: 20
    Total Downloaded
    751.86 MB

    0 Not allowed!

    Default Re: Read HX711

    Hi Yvesmazzon,

    Yep , i did managed to get my project running with the HX711. I used 2 modules. Ech connected to a load cell.
    This is a piece of code to get the data and scale it into whatever you want. It is possibel to use one module for 2 loadcells. I tried but without succes (because of the weird gain differences in the channels).

    I hope this helps. It was made for a 18F2620. Any further help needed, just let me know. succes!

    Code:
        Symbol DoutA         = PORTB.0
        Symbol SlkA          = PORTB.1
        Symbol DoutB         = PORTB.2
        Symbol SlkB          = PORTB.3
    
    
    '>>>LoadcellA<<<
        LoadCellA:
        DoutA = 1
        SlkA = 0
        Hx711Cnt = 0
        While DoutA = 1 : Wend
        For i = 0 To 23
            High SlkA
            Hx711Cnt = Hx711Cnt <<1
            Low SlkA
            If DoutA = 1 Then Inc Hx711Cnt
        Next
        High SlkA
        Hx711Cnt = Hx711Cnt^0x800000
        Low SlkA
        Return
    
    
    '>>>LoadcellB<<<
        LoadCellB:
    ;HRSOut "loadcell"
        DoutB = 1
        SlkB = 0
        Hx711Cnt = 0
        While DoutB = 1 : Wend
        For i = 0 To 23
            High SlkB
            Hx711Cnt = Hx711Cnt <<1
            Low SlkB
            If DoutB = 1 Then Inc Hx711Cnt
        Next
        High SlkB
        Hx711Cnt = Hx711Cnt^0x800000
        Low SlkB
        Return
    '>>>CalculatieA<<<
    ' Nu op 2 kilo..
        CalculateA:
        aReading = 8068660;8285167; laagste uitgelezen waarde hier
        aLoad = -100;240; minimale geschaalde waarde
        bReading = 8718181;8501674; hoogste uitgelezen waarde hier
        bLoad = 100;780 maximale geschaalde waarde
        LoadA = (((bLoad - aLoad) /(bReading - aReading)) * (Hx711Cnt - aReading) + aLoad) ;+ correctieA;
    ;LoadA = LoadA * 2
        If LoadA > 100 Then LoadA = 100
        If LoadA < -100 Then LoadA = -100
    ;HRSOut "A = ", Dec Hx711Cnt,"\r\n"
        Return
    
    
        CalculateB:
        aReading = 7979750;8204124; laagste uitgelezen waarde hier
        aLoad = -100;240;-100
        bReading = 8652872;8428498;
        bLoad = 100;780;100
        LoadB = (((bLoad - aLoad) /(bReading - aReading)) * (Hx711Cnt - aReading) + aLoad) ;+ correctieb; + 58.2
    ;LoadB = LoadB * 2
        If LoadB > 100 Then LoadB = 100
        If LoadB < -100 Then LoadB = -100
    ;HRSOut "B = ", Dec Hx711Cnt,"\r\n"
        Return

  8. 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.

  9. #5
    Member
    Join Date
    Jul 2006
    Posts
    220
    Thumbs Up
    Received: 6
    Given: 38
    Total Downloaded
    11.51 GB

    0 Not allowed!

    Default Re: Read HX711

    Hello Basparky,

    Many thanks for sharing your code. Just one more thing the chip doesn't seem to be wildly distributed , where did you get yours? I'm situated in Zimbabwe Harare,

    Regards,

    Yves

  10. 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.

  11. #6
    Member
    Join Date
    Oct 2006
    Posts
    218
    Thumbs Up
    Received: 9
    Given: 20
    Total Downloaded
    751.86 MB

    0 Not allowed!

    Default Re: Read HX711

    Hi Yves,

    I got them from Ebay. I have no idea if this is an option for you...

  12. 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.

  13. #7
    MERSOZ
    Guest

    0 Not allowed!

    Default Re: Read HX711

    Device 16F877A
    XTAL 20


    ALL_DIGITAL On
    Include "MODEDEFS.BAS"
    Declare LCD_TYPE = 0
    Declare LCD_DTPIN PORTB.4 'DATA girişi PORTC'nin 4. ucundan başlayacak
    Declare LCD_ENPIN PORTB.3
    Declare LCD_RSPIN PORTB.1
    Dim Hx711Cnt As DWord


    Dim i As Byte
    Dim c As Bit
    Dim gram As Float
    Output PORTB.2
    PORTB.2=0
    Input PORTD.4
    Output PORTD.5

    Symbol dataa = PORTD.4
    Symbol clock = PORTD.5
    Symbol DoutB = PORTD.6
    Symbol SlkB = PORTD.7

    Cls
    Print At 1,1, "LOADCELL"
    i=0


    LoadCellA:
    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=8388608-Hx711Cnt
    gram=gram-124000
    Low clock
    Print At 2,1, Dec gram
    GoTo LoadCellA
    Last edited by MERSOZ; 26th January 2016 at 18:19. Reason: THİS CODE WORK..

  14. 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.

  15. #8
    Member
    Join Date
    Jul 2006
    Posts
    220
    Thumbs Up
    Received: 6
    Given: 38
    Total Downloaded
    11.51 GB

    0 Not allowed!

    Default Re: Read HX711

    Hello Basparky,

    Sorry of my ignorance but what is the purpose of the "Hx711Cnt = Hx711Cnt^0x800000" ?

    regards,

    Yves

  16. 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.

  17. #9
    Member
    Join Date
    Mar 2018
    Posts
    137
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    19.14 MB

    0 Not allowed!

    Default Re: Read HX711

    After using Mersoz code I get fluctuating values .how I can get stable values?

  18. 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.

  19. #10
    Member
    Join Date
    Jul 2006
    Posts
    220
    Thumbs Up
    Received: 6
    Given: 38
    Total Downloaded
    11.51 GB

    1 Not allowed!

    Default Re: Read HX711

    Quote Originally Posted by amod View Post
    After using Mersoz code I get fluctuating values .how I can get stable values?
    Hi Amod,being a 24 bit values which is a very large number you will notice quite lot variations on the low digits, but when you convert it into grams or kg or what ever unit you are using these variations are insignificant. with a 3kg loadcell I get 1 grams with a standard deviation of +/-0.05 gram which is pretty good for my application. I suggest you do 10 times averaging and you also ground the loadcell body.

    Yves

  20. 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.

  21. #11
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,702
    Thumbs Up
    Received: 48
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: Read HX711

    Hi basparky

    Sorry know this is a really old thread. I just wondered how accurate the HX711 is? I need 0.1g over 2Kg. Is it capable of that?

    Thanks
    Tim

  22. 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.

  23. #12
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,529
    Thumbs Up
    Received: 75
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Read HX711

    Well, post #10 says that he have fluctuations of +/- 0.05g over 3Kg. I think it all depends how accurate you need it.
    Regards

    Joseph

  24. 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.

  25. #13
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,702
    Thumbs Up
    Received: 48
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: Read HX711

    Thanks joesaliba


    I need 0.1 gram over 2kg There are technique's to stabilise the reading, eg once it has evened out for a couple of seconds require a big change before updating the reading.

    Tim
    Tim

  26. 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.

  27. #14
    Prolific Poster
    Join Date
    Mar 2012
    Posts
    2,308
    Thumbs Up
    Received: 80
    Given: 182
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: Read HX711

    I've just got the hardware (slow boat from china) and I think I may have bought the wrong thing. The aluminum block with the load cells on two opposite side seems to be pretty standard. On the back side of the board I have 4 pins to the PIC and 6 to the loadcell and a solder jumper J1


    +--------------------------+
    | |--- out+
    VCC -- | |--- A-
    DO/RX ---| |--- A+
    CK/TX ---| |--- Gnd
    GND ---| |--- B+
    | |--- B-
    +------------------+

    I tried VCC 5V, DO/RX to input pin on PIC, CK/TX to output pin on PIC, GND to Gnd. On the loadcell Red to out+, black to A-, white to A+, green to Gnd. (B+ and B- nc)

    It never gets past the While dataa = 1: Wend statement.

    BTW I bought theis version of the ADC board because it had a can which seemed important at the time.

    Thoughts suggestions anybody?
    George.

  28. 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.

  29. #15
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Read HX711

    Is it SPI George?

  30. 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. [SOLVED !] Hx711 calibration
    By amod in forum Absolute Beginners Section
    Replies: 22
    Last Post: 23rd June 2018, 19:26
  2. DELAY read
    By teo in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 31st December 2017, 19:01
  3. [SOLVED !] CF read speed ?
    By Richard in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 31st January 2010, 17:29
  4. Read GPS
    By dmTulsa in forum GPS
    Replies: 5
    Last Post: 19th December 2007, 17:59

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