Arduino load cell(strain gauge) appilication with hx711 3

Arduino load cell(strain gauge) appilication with hx711 3


We will perform a sensitive scales with arduino , hx711 and a load cell This is our scheme This is our load cell (strain gauge) This is hx 711 module And this is arduino This is our circuit. This is our arduino nano hx711 and load cell We connected this circuit according to scheme What wil we do now? There are two arduino programs Left one for calibrating Right one is for scaling We will find two values from left program One of them is Ratio [ Ratio=(weight – offset ) / 1000 ] Another one is “offset” value We will enter these values to our main program(right program) We will enter one of them to here and other one to here We will find these two values from the left program We have got one kg weight for calibrating We will upload to arduino the left program(calibration) We will calculate the “Ratio” value using “weight” and “offset” values We will enter offset and ratio values to our main program “Weight” is the value which was read from calibration program while we are scaling a weight of 1 kg “offset” is the value which was read from calibration program while we are scaling nothing(weight free). 1000 number is grams for 1 kg calibration weight If we use different weight for calibration, we will use our weight as grams. We need to find these values now Let’s upload left program to arduino Program was uploaded We will scale 1 kg and will read “weight” value from serial monitor Let’s open serial monitor Values which were read are “offset” values, because load cell is free of weight When there is 1 kg on the load cell. We will read “weight” value Let’s take one of these values as “offset” value I couldn’t copy ­čÖü I am taking 8311208 as “offset” and writing to formula as “offset” 8311208 I will read a value when there is 1 kg weight as “weight” Values which were read are our “weight” value 8418288 We will find “ratio” number from this calculation Ratio=(8418288-8311208)/1000 Ratio=(107080)/1000 Let’s divide this value to 1000 for Ratio Ratio=107.08 “Offset” value is this “Offset” value=8311208 Let’s enter these two value to our main program We are changing row as “scale.setOffset(8311208);” We are changing row as “scale.setScale(107.08f);” And uploading our main program to arduino Program was uploaded to arduino Let’s open serial monitor It is scaling the weight now Let’s scale 200 grams I have to bring weight to the middle of two screw holes We are reading 200 grams 200 grams Let’s scale 1 kg This is our 1 kg weight Let’s test it before scaling There is a cable under the scale, I have to take it before scaling I have to reset it to see zero gram As you see my weight is 1 kg Let’s scale this now Sorry for my socks ­čśÇ under the table 999 grams It is scaling 999 grams. There is 1 gram error Let’s put our 200 grams onto 1 kg I have to see 1200 grams now We are seeing 1200 grams Let’s see the main program Let’s minimize script size This is setup section We are scaling free of weight at start We are saving the value which was read as “offset variable” We are subtracting the offset value from our every scaling And print to screen I glued my load cell with hot glue gun Thanks for watching. You can find the scheme and program files by clicking the upper-left corner link

19 comments on “Arduino load cell(strain gauge) appilication with hx711 3

  1. Sidibe Jefferson Post author

    hello Yasin , well thank your for this tutorial i have tried it and it works very well , can i ask you if it's possible to have your help , when it comes to 4 load cells , because i have try your code for a single load cell and it works , could please help to make it work for 4 load cells

    Reply
  2. hakan yak─▒n Post author

    hocam tekrar merhaba, ben ayn─▒s─▒n─▒ yapt─▒m ba─člant─▒lar do─čru , uno kulland─▒m, kalibirasyon yap─▒yorum bo┼čken bir de─čer g├Âsteriliyor ama ├╝st├╝ne y├╝k koydu─čumda de─čer de─či┼čmiyor niye ?
    yad─▒mc─▒ olabilirmisiniz ?

    Reply
  3. hakan yak─▒n Post author

    hocam birde benim loadcell de ye┼čil renk yok onun yerine mavi kablo var ba─člant─▒lar yine ayn─▒m─▒

    Reply
  4. muratcan yan─▒k Post author

    Merhaba 16,2 lcd ekranla ve arduino uno ile nas─▒l yapabilirim sal─▒ g├╝n├╝ne kadar teslim etmem gereken bir proje l├╝tfen yard─▒mc─▒ olurmusunuz

    Reply
  5. Burak Yurtta┼č Post author

    Offset a─č─▒rl─▒─č─▒ s├╝rekli de─či┼čiyor ve her zaman birebir ├Âl├ž├╝m al─▒nam─▒yor eksik ├ž─▒kabiliyor ├Âl├ž├╝len a─č─▒rl─▒k bu sorunu ├ž├Âzebilme ┼čans─▒m var m─▒d─▒r?

    Reply
  6. mahmut ├╝├žta┼č Post author

    ─░yi g├╝nler. Ben bug├╝n ayarlad─▒─č─▒m ve do─čru sonu├ž elde etti─čim kalibrasyon verilerini yar─▒n kullan─▒nca ├žok farkl─▒ de─čerler elde ediyorum. Bu verileri kal─▒c─▒ bir projede kullanmak istiyorum fakat de─čerler de─či┼čti─či i├žin sa─čl─▒kl─▒ bir sonu├ž elde edemiyorum. Bu problem hakk─▒nda bir bilginiz var m─▒? Te┼čekk├╝rler.

    Reply
  7. zeynep eli├žora Post author

    ─░yi g├╝nler, ben load sensorumun verilerini elde etmek i├žin, birinci program─▒ yazd─▒m, ancak daha program─▒ derlerken hata verdi Hx711 does not name a type hatas─▒ veriyor. Hx711 k├╝t├╝phanesini y├╝kledim, hata nedeni ne olabilir.

    Reply
  8. burak k├Âseo─člu Post author

    Ustam dedi─činiz gibi her ┼čeyi yapt─▒m.Akl─▒mda 3 tane soru var.Rica etsem bakarm─▒s─▒n─▒z
    1)Ratio de─čerim – ├ž─▒kt─▒.Burda bi s─▒k─▒nt─▒ var m─▒?
    2)1 litrelik bi su ┼či┼česini ├Âl├ž├╝yorum 1222 gram yaz─▒yor.S─▒k─▒nt─▒ nerede ├ž├Âzemedim.
    3)Benim sistemde lcd var.Bu a─č─▒rl─▒─č─▒ lcd ye nas─▒l yazd─▒rabilirim?

    Reply
  9. ─░brahim Y├╝cel Post author

    devre ┼čemas─▒n─▒ daha detayl─▒ varsa alarb─▒lirm─▒y─▒m

    Reply
  10. ─░brahim Y├╝cel Post author

    breadboardan arduinoya g─▒den kablolar pek net deg─▒l varsa daha detayl─▒ alab─▒l─▒rm─▒y─▒m

    Reply
  11. ─░brahim Y├╝cel Post author

    selam yasin cebeci reyis ben v─▒deoyu aynen yapt─▒m ve olumlu sonuc ald─▒m cal─▒st─▒rab─▒ld─▒m fakat bu projey─▒ ben nodemcu ile yapmam gerek─▒yor ve turlu turlu hatalar al─▒yorum nodemcu ─▒le nas─▒l yapab─▒l─▒r─▒m yard─▒m ederm─▒s─▒n─▒z

    Reply
  12. Turuncuww Post author

    200 gram─▒ baz alarak yapt─▒m ama s├╝rekli 0 ├Âl├ž├╝m sonucu al─▒yorum.Yard─▒mc─▒ olur musunuz?
    #include "hx711.h"

    Hx711 scale(A3, A2);

    float offset=0;

    int weight=0;

    void setup() {

    Serial.begin(9600);

    scale.setOffset(8388608);

    scale.setScale(634.88f);

    delay(500);

    offset=scale.getGram();

    Serial.print("offset weight:");

    Serial.println(offset);

    }

    void loop() {

    delay(500);

    weight=scale.getGram()-offset;

    if(weight<1)

    weight=0;

    Serial.print(weight);

    Serial.println(" grams");

    }

    Reply
  13. Turuncuww Post author

    mail den ileti┼čim kurmam─▒z m├╝mk├╝n m├╝ tek s─▒k─▒nt─▒m a─č─▒rl─▒k sens├Âr├╝ de─čil ├ž├╝nk├╝ renk sens├Âr├╝ de var :/ yard─▒mc─▒ olursan─▒z sevinirim.

    Reply
  14. asl─▒ kar├ž─▒─ča Post author

    Hocam eme─činize sa─čl─▒k. Takip ediyorum art─▒k sayfan─▒z─▒ ve ├Âneriyorum. Size sorum ┼ču, ben buradaki projeyi ayn─▒ ├žal─▒┼čma ve kodu kullanarak LCD ekran ile yapabilir miyim? A─č─▒rl─▒k sens├Ârl├╝ Arduino projesi yapaca─č─▒m. ┼×imdiden sa─č olun

    Reply
  15. Her ┼×ey ┼×ey Post author

    Yasin hocam kolay gelsin arduinoya her g├╝├ž verdi─čimizde kalibrasyonu tekrar tekrar yapmal─▒m─▒y─▒z,yoksa sens├Âr├╝ bir yere sabitleyince ve bir kereli─čine kalibrasyonu yap─▒nca g├╝c├╝ kesti─čimizde tekrardan kalibrasyon yapmam─▒za gerek var m─▒?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *