• First Steps
  • General
  • Projects
Facebook Twitter YouTube
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
  • Hardware & GPIO
  • Sensors & Components
  • Scale
  • Cases
  • Fingerprint
  • Gas Sensor
  • Heartbeat
  • German
  • French
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
Home»Hardware & GPIO»Build a digital Raspberry Pi Scale (with Weight Sensor HX711)

Build a digital Raspberry Pi Scale (with Weight Sensor HX711)

Facebook Twitter LinkedIn Tumblr Email Reddit
Raspberry Pi Waage selber bauen (mit Gewichtssensor HX711)
Share
Facebook Twitter LinkedIn Email Tumblr Reddit Telegram WhatsApp

As hardly any scales work analogously, it is of course also possible to measure weights with a digital Raspberry Pi scale. This can be used in various applications as the weight value ranges which can be measured are also almost unlimited. Only a sensor and a load cell are required, which are available for different weight ranges.

In this tutorial we are building a simple Raspberry Pi kitchen scale, whose precision is amazingly accurate. Of course, it is also possible to unscrew an existing (person) scale and read it out using a Raspberry Pi.

 

Accessories for the Raspberry Pi Scale

Raspberry Pi Scale - Load Cell HX711

The most important thing to build your own scale is a “load cell”, which is a metal bar with a hole in the center (see picture on the right). This is available for different weight classes (up to 1kg, up to 5kg, up to 50kg, etc.). Even though some have a different form, all are provided with four cables. To read out the values, the HX711 weight sensor is also required. This sensor is available in two versions: red and green. The pressure sensors probably have small differences, but are – theoretically – both compatible. I have used the green HX711. Fixing material is also required.

In summary, the required components are:

  • Load Cell (US / UK)
  • Green HX711 (US / UK)
  • Breadboard
  • Jumper wire
  • Two boards (the boards should not bend easily, therefore the best is not too thin plywood)
  • Longer bolts + matching nuts

Alternatively, you can also take an existing person or kitchen scale and unscrew it. In any cases, a load cell is available and sometimes also a HX711 weighting sensor. With this you could start directly. Since complete scales cost only slightly more than the load cells, this is definitely worth considering.
If someone has screwed his scale and both are present, I would be pleased about a comment with name / manufacturer of the balance.

 

Raspberry Pi Scale – Assembling

Before the load cell is connected to the HX711 weight sensor, it should be mounted on the two plates. For this I made markings with a ballpoint pen on the wooden boards, where the screws come in. With a drill I drilled the holes and inserted the screws. Between the screw and the load cell, there should be a nut, which serves as a protection to the board (see pictures).

Raspberry Pi Waage Wägezelle
Attach the underside of the balance first.

The nuts should be well tightened so that the screws do not slip off the board.

Raspberry Pi Waage Wägezelle seitlich
Side view of the scale after both boards are mounted.

If the construction is complete, we can go to the HX711. The four cables of the Load Cell must be connected to the weight sensor. The green HX711, however, has six connections, of which we only need four for the cables. The connection is as follows:

  • Red: E+
  • Black: E-
  • Green: A-
  • White: A+

The pins labeled B+/B- remain empty. Apparently there are versions of the sensor. Where the pins are labeled S+/S- instead of A+/A-.

Now you just have to connect the sensor to the Raspberry Pi. Since this also has only four connections, the wiring is quite simple:

  • VCC to Raspberry Pi Pin 2 (5V)
  • GND to Raspberry Pi Pin 6 (GND)
  • DT to Raspberry Pi Pin 29 (GPIO 5)
  • SCK to Raspberry Pi Pin 31 (GPIO 6)

Schematically, the connection to a Raspberry Pi 3 then looks as follows:

Raspberry Pi HX711 Steckplatine

Of course, you can also change the pin assignments of DT and SCK, e.g. If you have an older model. However, you have to adjust the corresponding pins then synonymous in the code.

 

 

Raspberry Pi Weight Sensor Software

To measure the weight and to read out the value we use a Python library. Although there are corresponding C ++ libraries, however, I have no good experience with that. First, we will clone the project:

git clone https://github.com/tatobari/hx711py

It contains an example.py file which shows the function of the library and can also be used. Before that, however, a few adjustments are necessary.

First we will edit this file:

cd hx711py
sudo nano example.py

We are looking for the line in which the reference unit is set and comment it out with a hashtag sign, so that the line looks as follows:

Python
1
#hx.set_reference_unit(92)

Save it with CTRL+O and exit with CTRL+X. This reference unit is the divisor, but we must first find it out in the next step. Meanwhile you can run the example (abort with CTRL+C). The values should appear in the range 0 to 200, but this is not important at this point.

sudo python example.py

 

First Test of our Raspberry Pi Scale

The correct calibration of the weight sensor and the Raspberry Pi balance is crucial. For this we need a comparison object whose weight we know. For example, I have taken two packs of rice (1kg each), since it is recommended to choose an average value of the maximum (my load cell could be used up to 5 kilograms). Place it on the scale and run it again with sudo python example.py. The displayed values can be positive as well as negative. In my case were displayed at 2kg (= 2000 gramm) values around -882000. My reference value is thus -882000 ÷ 2000 = -441.

We then edit the sample file in the same way as above descirbed, remove the comment hashtag and enter this value accordingly. My line now looks as follows:

Python
1
hx.set_reference_unit(-441)

After saving and starting the file, the weights should now be displayed as shown in the following video. Since I had the problem that sometimes values below 0 slipped and this should not be possible, I have extended the line, in which the value is read out. This displays no longer negative weights.

Python
1
val = max(0, int(hx.get_weight(5)))

 

In my tests I took a load cell with up to 5kg and calibrated with 2kg. As seen in the video, the measurement is astonishingly accurate. It is important, however, to ensure that the mounted plate does not bend too much (especially the floor plate must be fixed). However, you should be aware that the values outside the range (e.g. above 5kg) will no longer be accurate – a different load cell with its own calibration is required.

How to show text on a LCD display, I have described in this tutorial and in the video also used.

Featured HX711 python weighting sensor
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleControl a HD44780 LCD display via I2C with the Raspberry Pi
Next Article Kapazitiven Erdfeuchtigkeitssensor “Giess-o-Mat” am Raspberry Pi auslesen

Related Posts

Control all GPIOs with the Raspberry Pi REST API via Python

How to build a ESP8266 Scale (with Weight Sensor HX711)

Using TensorFlow Lite with Google Coral TPU on Raspberry Pi 4

How-To: Bluetooth Connection between ESP32’s and Raspberry Pi’s

92 Comments

  1. jude on 31. August 2017 13:51

    Very nice tutorial, i would like to know if it can measure a weight of 60 grams thank you

    Reply
    • Felix on 9. September 2017 9:48

      Depends on your load cell.

      Reply
      • jude mark 2 on 4. September 2022 14:50

        Thanks for your answer, I too would also like to know if this can measure a weight of 120grams thank you

  2. JR on 3. September 2017 3:22

    Using a 0-50kg load cell that looks just like yours with same wire colors. About 1 in 5 values is very high or just random. I followed instructions in the code to show the bit/byte info but I do not know what to do with the info that is displayed. Can you advise?

    Reply
    • greg on 7. July 2018 5:02

      Load cells with bigger range while having a higher maximum weight have a less accurate weight. That being said a 50kg load cell shouldn’t be used for anything lower than 1kg really to be “accurate”… that also being said your load cell can be damage, calibrated wrong, or any number of things

      Reply
  3. Daniel on 30. September 2017 16:01

    Hey nice tutorial, thanks!
    I have 2 questions about this:

    1. Does the weight of the plate that is fixed to the top of the load cell factor in to the maximum weight? So if your plate weighs 500g will the maximum amount of weight you should put on it be 4.5kg? Or is it purely relative?

    2. Does accuracy of the load cell degrade with increasing maximum load? So will a load cell with a max. weight of 50kg sense a weight difference of 50g as accurately as a load cell with a max. weight of 5kg would?

    Reply
    • Felix on 30. September 2017 16:05

      Hi Daniel,
      i haven’t tested both scenarios, so these are just my guesses:
      1. Should be absolute (500g plate will decrease the maximum amount)
      2. Yes, the nearer you weight is to the boundaries, the less accurate it is. But load cells with higher maximum weights are not as accurate in small regions (bigger “weight steps”).

      Reply
  4. billynux on 1. October 2017 13:10

    first thank you for this nice tutorial.
    I try monitoring beehives (8) . Every day I receive the internal T° and an external. Now I’d like to have te weight.
    Can I connect several load cell (8) to my raspberry?

    Reply
    • Beek in Aus on 12. January 2018 3:04

      I’m Looking at Doing Similar. Weight of my behive and other sensors I’ve been looking @ using hivetool.org as the base …

      Reply
    • Phil on 17. February 2018 18:33

      Hi Billynux,
      I too am a bee keeper and would like to monitor the internal temp, humidity and weight of my colonies. Do you have a material list you could post or email me at service@heatwavellc.com
      Thanks
      Phil

      Reply
      • A Genchev on 17. December 2018 22:08

        @Phil are you interested in buying a solution for doing this or you prefer DIY ?

    • Eug on 25. May 2020 11:38

      Funny how many beekeepers end up here. I’m keen to do this as a DIY and will start soon. Just interested to know where in the hive you folks put your internal temp and humidity sensors? Do the bees end up putting propolis and wax over the sensors? ie. do the sensors get “fouled”.
      @ A Genchev ….. for now I’m keen on a DIY solution but some of my beekeeping friends might not be. Are there some off the shelf kits one can buy?

      Reply
  5. Sander Weernink on 16. October 2017 10:49

    I have cloned the file and it seems to have done so but now i can’t open it. It says -bash: cd: hx711: No such file or directory.

    what to do?

    Reply
    • Sander Weernink on 16. October 2017 11:03

      I have a VNC remote desktop now and can open it.

      Reply
  6. Dharmesh on 21. October 2017 3:01

    Is there anyway to get the value from the scale recorded into an array in python , as I am hoping to use something like this to make a very simple fruit sorting machine.

    Reply
    • Felix on 21. October 2017 12:37

      Yes, the example is python code, so you just have to change it the way you need it.

      Reply
      • Tyler Wusterbarth on 21. April 2022 18:56

        Do you need to copy the code and paste it into python? Or is the “import” calling out that code? I’m looking to use a 10kg load cell to ouput force data on a raspberry pi.

        TIA

  7. Royce on 2. November 2017 15:56

    Hi,
    You have powered the HX711 module from 5V, and you are giving it’s Data-Out line directly to the Pi’s GPIO, won’t the 5V level damage the pi ?

    Reply
    • Felix on 2. November 2017 19:14

      It has resitors onboard.

      Reply
      • Royce on 4. November 2017 21:50

        Do you mean the load cell module, or the raspberry pi ?

      • Felix on 6. November 2017 21:16

        The HX711 module

  8. Gordon on 10. November 2017 4:54

    Hi, this is a great article, thank you. I’ve two questions, I’d like to use this with the small E shaped load sensors found in kitchen and ‘human’ or bathroom scales. 4 of them are often used to make a total of 200kgs. Am not sure if I should provide a link to where they’re sold or not, so thought best not. They each have 3 wires, red, black, and white. Should these also be wired through an HX 711? and how? And also, is it possible for the Pi to have 4, or even 8, different load cell inputs and hence readings? If so, what would the connections be? I’m afraid I’ve very little experience in this.

    Reply
    • Felix on 11. November 2017 3:08

      I haven’t seen load cells with only 3 wires, but you should be able to use several HX711 (when having enough GPIOs).

      Reply
    • Asaf on 6. July 2018 22:27

      Hello Gordon, I have the same question about the load cell with 3 wires. I too am very inexperienced. Did you find a solution?

      Reply
    • Jim on 18. February 2023 13:18

      Load cells with four wires are “differential”, I forget the term for the three wire style of load cell. The voltage differential between the “A” or the “B wires is used to determine the load. I *think* the three wire version determines the load by comparing the A/B wire to ground. Please do not quote me…

      Reply
  9. Marcel on 19. November 2017 14:23

    I have my free open source implementation for HX711 on my git repo: https://github.com/gandalf15/HX711
    Check examples if you want.

    Reply
    • Israel Alejo Luciano on 26. February 2020 17:48

      Hello @Marcel, i tried your library.
      it looks so well, but when i run the example.py only read few values and stop it.
      and say this error
      statistics.StatisticsError: no median for empty data.
      Could you help me?
      thanks for your work

      Reply
  10. Deepak on 23. November 2017 2:42

    When I execute the python 2.7 code, it errors out after pressing enter for the input. Any ideas to resolve it?

    Reply
    • Felix on 23. November 2017 10:56

      Which error?

      Reply
  11. Deepak on 23. November 2017 17:48

    in example.py
    input(‘Put known weight on the scale and then press Enter’)
    after pressing enter it throws out error File….at line 1
    I am not able to execute the example.py
    Pls. help

    Reply
    • Felix on 23. November 2017 22:49

      Is input(..) in line 1?

      Reply
  12. Chris on 30. November 2017 4:17

    Just wanted to know how you got the RX711 amplifier part for FRITZING. I’d greatly appreciate it!!

    Reply
    • Felix on 30. November 2017 17:30

      Just google for it 😉 https://github.com/brucetsao/Fritzing/blob/master/HX711%20Weighing%20Sensor%20Module.fzpz

      Reply
  13. Nick on 2. December 2017 2:34

    Nice tutorial! Although the directory name is actually “hx711py” not “hx711” so to edit the file you need:
    cd hx711py
    sudo nano example.py

    Reply
    • Felix on 10. December 2017 19:54

      You are right, thanks for the hint!

      Reply
  14. M.Nagendra babu on 14. December 2017 10:12

    I want total code for 40kg load cell for our project please help me

    Reply
    • Felix on 14. December 2017 17:21

      It is the total code – you just need another load cell and have to adjust it.

      Reply
  15. Jack on 11. January 2018 21:23

    I cant calibrate it as the weight value doesn’t change when I add a weight to the load cell. It just comes up with random values. what do?

    Reply
  16. Ashley on 13. January 2018 20:33

    Excellent tutorial. I have everything connected and working, using a reference unit of 8200 for a 5 gram weight. When I place the weight on the scale I get an accurate reading of 5 grams. However I’d like to get a reading to the nearest two decimal places – 4.995, for example. My Python skills are a bit rusty, does anyone know how I might accomplish this?

    Reply
  17. Jon on 17. January 2018 13:58

    I also have this issue please help

    I am at the calibration stage and have tried 2 different hx711 boards so i know they are not faulty?

    when i run example.py:

    python ./example.py

    I get random numbers that range from -90000 to (+)20000

    knowing this isnt right I worked out an average using your calculations which came to 53.3

    now when i run it i still get random numbers only smaller random numbers?!:

    Monitor:~/fuel/hx711py $ sudo python example.py
    195
    99
    28
    765
    36
    0
    77
    38
    88
    208
    81
    96
    91
    861
    37
    100
    99
    6974
    44
    1511
    0
    45
    153
    316
    0
    281
    285
    0
    592
    0
    430
    0
    138
    439
    51
    0
    468
    0
    233
    1669
    238
    0
    0
    0
    5709
    1555
    847
    1081
    0
    0
    0
    0
    0
    0
    0
    0
    0
    ^CCleaning…
    Bye!

    Please Help

    Reply
  18. afedupkid on 5. February 2018 11:22

    Getting a lot of random values when i run the code. the values do no change even if load is applied to the load cell. please do reply.

    Reply
    • Jack on 17. February 2018 14:33

      I had the same problem. Turns out it was a broken load cell- remove it from the plates and you’ll probably see broken wires running between the white bits of the bar. All you can really do is buy a new load cell

      Reply
  19. aar on 8. March 2018 5:09

    can i get java code for the same???

    Reply
    • Felix on 8. March 2018 7:50

      You could translate it to Java.

      Reply
  20. Jad Saba on 12. March 2018 21:00

    Hello
    When I run the code, I get completely random values, even when nothing is on the board.
    The boards I placed on the load cell are not very stable, could it be the reason?
    Also, I am using a 50kg load cell.

    Please reply.

    Reply
  21. A-Aron on 19. March 2018 1:58

    Hi there,

    Just a quick note. I think the wiring schematic provided *might* be incorrect. As an example, I wired up the hx711 as per your instruction, and ran the example script to ensure that I had everything correct and the load cell worked as expected. When run, the output yielded:

    “`
    ~/hx711py $ python example.py
    0
    18236
    18236
    18236
    18236
    18236
    18236
    18236
    18236
    “`

    No matter what I did, the load cell (I’m using the TAS606, which has a nearly identical wiring scheme from what I can tell) gave the results listed above. After doing a bit of digging and swapping out the wires on the Raspi’s #29 & #31 pins, I received the following:

    “`
    ~/hx711py $ python example.py
    -6
    -18029
    18230
    -18171
    -15963
    -18207
    -18029
    -18207
    “`

    Which seemed to indicate a working load cell. Is it possible that the wiring scheme in your tutorial has the pins swapped? I currently have DAT going to #31 and CLK going to #29.

    Reply
    • Rob on 20. March 2018 18:13

      You are correct there is a typo on the wiring schematic. The green wire should be labeled A+ not A-. White is A-.

      Reply
  22. neha on 24. March 2018 13:17

    i have got so many values which varies a lot should i take average

    Reply
  23. EENGJRG on 8. April 2018 4:41

    Great article, but I have a question when you state ” since it is recommended to choose an average value of the maximum (my load cell could be used up to 5 kilograms). ” I don’t understand what that means. The average value of the maximum of what? Are you saying the average value of the heaviest item you intend to weigh? Everything work great even small increments like 10g, 20g. Only issue is when I try to weight 4k to 5k items. (I have a 5K load cell btw) that when he accuracy is off. So my question is do I use something close to 5k when I’m getting the reference value? and why did you use 2k for your 5K load cell? Thanks for your time.

    Reply
  24. Robert on 28. May 2018 18:17

    I have also similar issue: my output keep on decreasing regardles the weight i apply to it 🙁

    Reply
    • Marcus Wolschon on 10. September 2019 11:42

      Yes, that is creep.
      The load cell is deforming and thus the meassured stress decreases.
      I experienced the same in my “Ultimate Filament monitor” (that also uses a second load cell for pulling force on the filament and a rotary encoder for odometry of used filament)

      You’d need a way to unload the cell and tare again regularly.

      Reply
  25. Jesper on 28. May 2018 21:44

    I have a problem with this setup. I only get:
    0
    0
    0
    0
    0
    0
    Etc.

    When i unplug the cables from hx711 i get random values from -100 000 to 100 000.

    Any ideas of what’s could be wrong?

    Reply
    • alex on 20. March 2019 16:14

      me too,how can resolve?

      Reply
  26. Mark Read on 10. July 2018 14:29

    Could this be built to read grains then fire a relay it out of spec.
    Like 120-125gr fire relay 1
    > 120gr fire relay 2
    <125gr fire relay 3

    Reply
  27. Robert on 10. July 2018 15:01

    Does anyone has a solution for this issue above? Getting random values like this:

    -1641 g
    1063 g
    -149 g
    -149 g
    -149 g
    -149 g
    -149 g
    2834 g
    -149 g
    -4624 g
    -149 g
    -149 g
    1342 g
    -3132 g
    -149 g
    -4624 g
    -149 g
    -149 g
    -4624 g
    -5370 g

    Regardless how much force I apply. Is the load cell broken?

    Thanks!

    Reply
  28. Stefan on 1. August 2018 15:33

    Great tutorial, thanks a lot. Can the HX711 also be used for permanent measurement? I’d like to put a bottle of liquid on the scale for several years. This bottle will be filled and emptied, so there is a change in the weight. Will that work?
    Thanks
    Regards
    Stefan

    Reply
  29. A Genchev on 17. December 2018 22:01

    @Stefan
    No, it won’t work. You need to tare very soon before a weight measurement .
    Also your load sensor may change it’s characteristics (transfer function) because of the constant weight applied and wind, sun, water, aging.
    Btw there are more stable (and expensive) solutions – capacitive load cells, magneto-laser systems, etc.

    Reply
  30. Jonas on 6. February 2019 23:33

    Hi,

    Have a question. How can I use more weight sensor same time with a Pi3 and that measure data at programmed time to a logfile?

    Reply
  31. Scott Goodman on 12. February 2019 22:24

    Your setup was fantastic. I am looking to take this one step further with some help. I need to be able to generate a 5V signal when it hits a specific weight to switch a valve.

    Reply
  32. Kira0tori on 28. February 2019 17:43

    Hi,
    Thanks for this tutorial.
    I get a strange issue, no matter what I put into the reference unit, the output remains the same.
    However, if I input zero, it raises an error (as expected).
    Any clue on the problem ?
    Thanks in advance,
    Cheers from France.

    Reply
    • Kira0tori on 28. February 2019 18:05

      Forget that, the example code was printing hx.read_long() and not the hx.get_weight() value. The second one is actually affected by the reference unit. After un-commenting the hx.tare() at startup, it works like a charm now.
      Thanks !

      Reply
  33. Ross on 14. May 2019 4:36

    For the record, using cheap generic chinese hx711 and 5kg loadcell, I discovered that the output was horribly unstable until I moved the hx711 power from the 5v supply to the 3.5v supply pin – seems the hx711 works better at lower voltage. Go figure – but worth experimenting for all those with wild fluctuation problems. Now to deal with temperature and drift over time effects on the wheatstone bridge resistors.

    Reply
  34. Donald Dixon on 24. June 2019 8:05

    sparkfun makes a load cell combiner board to setup 4 of the 3 wire load sensors in a Wheatstone bridge that will allow you to wire it to the HX711 in the same manner as the 4 wire load cell

    Reply
  35. Donald Dixon on 24. June 2019 8:05

    sparkfun makes a load cell combiner board to setup 4 of the 3 wire load sensors in a Wheatstone bridge that will allow you to wire it to the HX711 in the same manner as the 4 wire load cell .

    Reply
  36. Frederick on 27. June 2019 21:59

    Would this application work with two HX711’s? I’d like to do a pair of scales for bilateral measurements. I’d be curious how you would approach that!! I’m thinking a second HX711 powered off of pin 4 and another pair of GPIO’s would do the trick. Then you could just do the math on the Pi

    Reply
  37. Rahul on 27. July 2019 19:44

    How to display measured weight on LCD display…please help

    Reply
  38. DjCombo on 22. August 2019 22:30

    Works really good, but im getting voltage drift (100 in 32768 div), probably would be better with a ratiometric system… Any sugestion to correct this problem by software? Thanks in advance!

    Reply
  39. bgabiz on 20. October 2019 1:40

    me too, could you please help?

    Reply
  40. Eric on 18. January 2020 8:42

    The best sample rate I can manage seems to be about 0.5 s. Has anyone had success speeding this up?

    Reply
  41. Lars Bodin on 16. June 2020 9:48

    This is working great, thanks!
    Do you know about any ready code for displaying weight on Initial state or some other dashboard.
    I don’t know how to write my own code (I am to old for such things, lol), so I do need tutorials…
    /Lars

    Reply
    • -- on 9. October 2020 10:23

      hi, may I know how does your current code for this looks like? I tried to use the 20kg load sensor but my values are inconsistent and very weird… thank u so much!

      Reply
  42. Rajkamal on 29. July 2020 21:28

    Weight are not accurate dear @3kg u r showing around 200gms loss

    Reply
  43. Shane on 9. August 2020 14:22

    I would like to use this scale with a series of LEDs. The (val) would be monitored and would be the logic to control one of 6 LEDs (each on its own GPIO). The LEDs would indicate “percentage” of a weight range, so the actual values are not relevant. With a full load on the cell, I am reading about 505000, empty is around 8000. How do I convert this data to a GPIO state for LED control?

    Reply
  44. Yosi on 14. September 2020 10:49

    few people asked it but didn’t saw any answer, how to connect more than one load cell to a single pi?

    Reply
    • Chris on 23. September 2020 13:28

      @Yosi – just hook the 2nd one up to different pins, and run a second copy of the code with the new pin numbers in it.

      Reply
      • Rasmus Winther on 5. February 2022 11:19

        So How many can you connect ?

  45. iotgrp on 9. October 2020 6:37

    Hi, I am trying the codes now and may i know how can I solve this error:

    Traceback (most recent call last):
    File “example.py”, line 11, in
    import RPi.GPIO as GPIO
    ImportError: No module named ‘RPi’

    thank you very much!

    Reply
  46. Carlos on 30. October 2020 19:29

    Super cool tutorial, and it works very good.
    There is not too much info about HX711 to RPI, so this is a great help. Even when is not perfect, it’s valuable information, so don’t paid attention to childish and useless replays.

    I have a question for you, Do you think there is a chance to export the scale values to a website?
    I tried Flask SocketIO, but I don’t know how to call the values out.
    Thanks.

    Reply
  47. Panos on 30. January 2021 19:47

    1) Can more than one load cells be used in the same weight scale, so that the weight is distributed for more accuracy?
    2) Can someone suggest reliable / accurate load cells for max. 50kg with accuracy of +- 50g (or better)?
    3) Can someone suggest the optimal placement of one or more load cells for a top weight scale plate of 50x50cm?
    Thanks in advance.

    Reply
  48. Bastian on 27. February 2021 21:57

    I’m using a tensile load cell, I followed your tutorial but regardless of the weight that you install in the load cell, the value shown is 0. Apparently the load cell is good because I checked the resistance of its cables. What could be the problem?

    Reply
    • Dan on 16. March 2021 7:28

      For sparkfun’s new version of the HX711 board, you need to connect both the VCC and VDD pins to the RasPi’s +5V.

      Reply
  49. Dan on 16. March 2021 7:26

    The hookup instructions and schematic appear to be for an old version of SparkFun’s HX711 board ( https://www.sparkfun.com/products/retired/13230 ). The new version ( https://www.sparkfun.com/products/13879 ) has separate VCC and VDD pins (voltage supplies for the analog and digital circuitry, respectively). These *both* need to be hooked up to the RasPi’s +5V. If you only connect VCC, then the DAT pin will have a floating voltage, which means the RasPi will not see sensible data. Due to the quirks of the circuitry, it appears to interpret the improper digital signal as one number repeated over and over, which with the auto-taring of the example code results in a perpetual displayed weight of 0.

    Reply
    • Luise on 22. March 2023 19:24

      thank you so, so, so, so much. you saved me a lot of headache

      Reply
  50. Manish ES on 21. July 2021 10:12

    Will this work with Raspberry pi 4b ??

    Reply
    • Mitch on 22. July 2021 23:15

      I just used this tutorial with a 5Kg load cell (which came with an HX711 board) with the Raspberry Pi 4b. It works really well. I also successfully added an LCD (as in the video) with the tutorial linked to in the last line of this tutorial.

      Reply
  51. Marc on 1. September 2021 18:06

    Hello,

    would it be possible to connect the
    HX711 board VCC, GND, DT, SCK to a uart to USB adapter (see
    https://www.amazon.com/Terminal-Connector-terminals-Pluggable-Converter/dp/B07H53X194/ref=pd_bxgy_2/145-6464520-2106139?pd_rd_w=sLRjm&pf_rd_p=c64372fa-c41c-422e-990d-9e034f73989b&pf_rd_r=677RTEMPX7P2BVPHCFP5&pd_rd_r=5eb2f586-74d8-4d48-af2b-b30350c142a0&pd_rd_wg=S4R1P&pd_rd_i=B07H53X194&psc=1) ?

    Reply
  52. Chaymoss on 6. October 2021 16:11

    Hello,
    I’m wondering how can I install the correct HX711 because I’m getting the following error :
    hx.set_reading_format(“MSB”, “MSB”)
    AttributeError: ‘HX711’ object has no attribute ‘set_reading_format’
    My second question is it possible to use this HX711 : https://www.robotshop.com/eu/fr/amplificateur-cellule-force-hx711.html?gclid=Cj0KCQjw-NaJBhDsARIsAAja6dND02ygF0lhFjIgFbMZVXD17ldPzmzd7EKpSBGLxpqhJ5ufT20zlh0aAuc_EALw_wcB
    Thank you in advance.

    Reply
  53. Simon on 7. June 2022 15:25

    Hello,

    As part of a college project, I’m trying to come up with a device that stores pills, and if it still feels their weight past a certain point, reminds the user to take their pills. The weight sensor would have to be precise enough to detect just a few miligrams of pressure, but I’m not sure if that’s feasible while still keeping the device at a size that allows the user to take it with them when they go out. Any advice on this matter would be greatly appreciated.

    Reply
    • Duane on 17. November 2022 0:05

      I am interested in the same project. How did yours turn out?

      Reply
    • Jim on 19. February 2023 14:01

      Are you handing the case of multi-cell pill box (morning, noon, evening, and night)?

      Reply

Leave A Reply Cancel Reply

Raspberry Pi Pico: Programming with the Affordable Microcontroller

MCP3008: Read out Analog Signals on the Raspberry Pi

How to use a Raspberry Pi Fingerprint Sensor for Authentication

Installing WiringPi (and pin allocation) – Raspberry Pi

Raspberry Pi Robot Kit – Assembly (Part 1)

Raspberry Pi GPIO Explanation for Beginners + Programming (Part 2)

Subscribe to Blog
Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!
Subscribe

Thank you!

We will contact you soon.

Tutorials for Raspberry Pi
Facebook Twitter YouTube
  • Contact & Disclaimer

Type above and press Enter to search. Press Esc to cancel.