You are on page 1of 9

instructables

How to Build Arduino Weighing Scales

by p_leriche

At the Restart Project in London we hold repair events many kilograms.


where members of the public are invited to bring in all
manner of electrical and electronic items for repair, so as Hence I will concentrate on the electronics, the software
to save them from land ll. A few months ago (at an event and the underlying principles. How you realise your own
I didn't actually attend) someone brought in some faulty project is completely up to you.
kitchen weighing scales which nobody could x.
I will also show you how to calibrate them, even if you
Never having seen inside any digital weighing scales and don't have any standard weights.
not knowing how they work, I took it as a challenge to
research them, in the process, building two versions of Having done my research and having validated it by
my own. building my own scales, I wrote up the principles of
weighing scales, including whatever I could deduce
If you wish to build your own weighing scales or about fault- nding, in the Restart Project Wiki. Go and
incorporate a weighing function in a wider project, you take a look!
can use this Instructable as a basis, whatever your
requirements, from weighing fractions of a gram up to

Step 1: Choosing Your Load Cells

How to Build Arduino Weighing Scales: Page 1


All digital weighing scales are built around either a 4- These are less suitable for heavier loads such as
terminal load cell or four 3-terminal load cells. Which to bathroom scales, where a person's full weight, not
get depends on what sort of scales you want to make. necessarily centred on the platform, is better supported
They are all electrically compatible and fairly cheap so by 4 load cells supporting the 4 corners of the platform.
you can change your mind later, or get more than one
type to experiment with. This is where four 3 terminal load cells are more suitable.
Ones rated at 50kg each are widely available, which
For kitchen or postal scales with a maximum load in the together will weigh up to 200kg.
range of 100g to 10kg, you can get 4-terminal load cells
consisting of an aluminium bar. This is mounted Others with even higher ratings are designed for
horizontally, supported at one end and supporting the suspending the weight to be measured after the fashion
weighing platform at the other. It has 4 strain gauges of luggage scales
attached to it. I explain fully how it works in my wiki
article so I shan't repeat it here.

Step 2: What Else You Need

In addition to your load cell or load cells, you will need:

An Arduino. You can use virtually any type you like but I used the Nano as it has the USB interface built-in
and still only costs a few pounds.
A HX711 module. This may come bundled with your load cell but is available very cheaply as a separate
item from many sources.
For prototyping, a 400 point breadboard, jumper leads, pin and socket strips.

You will also need wood, plastic, screws, glue, or whatever you require for your particular version of the project.

How to Build Arduino Weighing Scales: Page 2


Step 3: Preparing the Parts

To use the HX711 module on the breadboard, solder a 4- mark on the pin socket means I know which way round
wide pinstrip to the interface pins (GND, DT, SCK, VCC) of to connect it, though I don't think it matters.
the HX711.
Di erent load cells colour code the wires di erently, but
For easy connection and disconnection of the load cell it's easy to tell which is which. With a test meter on a
(particularly if you're experimenting with more than one resistance range, measure the resistance between each
sort) solder a 6-wide pin socket strip to the analogue pair of wires. There are 6 possible pairs of 4 wires but you
pins. (You only need the E+, E-, A- and A+ pins but I will only get 2 di erent readings. There will be 2 pairs
tted a 6-wide strip anyway in case I wanted to which read 33% more than the other 4, say, 1,000Ω
experiment with the other two.) instead of 750Ω. One of those pairs is E+ and E- and the
other is A+ and A- (but it doesn't matter which).
If you are using a 4-wire load cell you will then need to
solder the 4 leads from the load cell to a 4-wide pin strip. Once you get everything working, if the scale reads a
The rst two pins will be E+ and E- and the other two A- negative weight when you put something on it, swap E+
and A+. I taped over the solder joints with PVC tape to and E-. (Or A+ and A- if it's easier. But not both!)
protect them. A mark on one end and a corresponding

How to Build Arduino Weighing Scales: Page 3


Step 4: How to Use 3-wire Load Cells

If you are using four 3-wire load cells you will have to readings. Identify the pair that reads twice either of the
wire them us together with a piece of stripboard, and other two. Call this pair A and C. The one you left out is B.
take the E+, E-, A+ and A- connections from the (The resistance between B and either A or C is half the
combination. resistance between A and C.)

Since the wire colours of yours may be di erent from Simply stated, you need to wire the 4 load cells in a
mine, let's call the 3 wire colours of each load cell A, B square, with the A wire of each connected to the A wire
and C. of its neighbour, and the C wire to the C wire of its
neighbour on the other side. The B wires of two load
With a test meter on a resistance range, measure the cells on opposite sides of the square are E+ and E-, and
resistance between each pair of wires. There are 3 the B wires of the other pair are A+ and A-
possible pairs, but you will only measure 2 di erent

Step 5: Wiring Up the Breadboard

Wiring up the breadboard is very simple, needing only 4 you're using a di erent Arduino, wire it up as in the table
jumpers. The Fritzing library only o ered me a slightly below:
di erent version of the HX711 module from mine but
the wiring is the same. You can follow the diagram, or if Arduino Pin HX711 Pin 3V3 VCC GND GND A0 SCK A1 DT

How to Build Arduino Weighing Scales: Page 4


Step 6: Mounting the Load Cells

The aluminium bar type of load cell has two threaded indentations needed a slightly deeper central well so
holes in each end. You can use one pair to mount it on a that two rivets on the bottom didn't rest on the base.
suitable base with a spacer in between. The other pair
you can use in the same way to mount a weighing I used a hot melt glue gun to hold the load cells in place
platform, again, with a spacer. Just for experimental on the base and also to x the stripboard onto the base
purposes you can use whatever pieces of scrap wood or in the middle. I then pressed the weighing platform hard
plastic you have to hand, but for a polished end product down on them so that the pimples on the tops of the
you will want to take more care. load cells made slight indentations. I deepened these
with the router and checked they still aligned nicely with
The easiest way to mount the four 3-wire load cells is the load cells. I then put hot melt glue on and around
between two pieces of chipboard. I used a router to each indentation and quickly pressed the weighing
make 4 shallow indentations in the base so as to platform onto the load cells before the glue hardened.
positively locate the four cells. In my case the

How to Build Arduino Weighing Scales: Page 5


Step 7: Programming the Arduino

I assume you have the Arduino IDE installed on your computer and know how to use it. If not, check out one of the many
Arduino tutorials - that is not my purpose here.

From the IDE drop-down menus, select Sketch - Include Library - Manage Libraries...

Type hx711 in the search box. It should nd HX711-master. Click Install.

Download the attached le HX711.ino example sketch. From the IDE File drop-down menu, open the le you just
downloaded. The IDE will say it needs to be in a folder - allow it to put it in one.

Compile and upload the sketch, then click on the serial Monitor in the IDE.

Below is some example output. In the initialisation phase it displays an average of 20 raw readings from the HX711, then
sets the tare (i.e. the zero point). After this it gives a single raw reading, an average of 20 and an average of 5 less the tare.
Finally, an average of 5 less the tare and divided by the scale factor to give a calibrated reading in grams.

For each reading it gives the calibrated average of 20, and the standard deviation. The standard deviation is the rage of
values within which 68% of all measurements are expected to lie. 95% will lie within twice this range and 99.7% within
three times the range.It's therefore useful as a measure of the range of random errors in the result.

In this example, after the rst reading I placed a new pound coin on the platform, which should weigh 8.75g.

HX711 Demo<br>Initializing the scale


Raw ave(20): 1400260

After setting up the scale:


Raw: 1400215
Raw ave(20): 1400230
Raw ave(5) - tare: 27.00
Calibrated ave(5): 0.0

Readings:
Mean, Std Dev of 20 readings: -0.001 0.027
Time taken: 1.850Secs

Mean, Std Dev of 20 readings: 5.794 7.862


Time taken: 1.848Secs

Mean, Std Dev of 20 readings: 8.766 0.022


Time taken: 1.848Secs

Mean, Std Dev of 20 readings: 8.751 0.034


Time taken: 1.849Secs

Mean, Std Dev of 20 readings: 8.746 0.026


Time taken: 1.848Secs

Download

https://www.instructables.com/ORIG/FBE/L0BW/J961EQWG/FBEL0BWJ961EQWG.ino

Step 8: Calibration
How to Build Arduino Weighing Scales: Page 6
The Arduino sketch in the previous step contains two careful note of the weight. Or you could take it to a
calibration values (or scale factors) relating to my 1kg trader such as a friendly local greengrocer. Any reputable
and my set of four 50kg 3-wire load cells. These are on trader should have their scales calibrated regularly to
lines 19 and 20. You will need to perform your own comply with trading standards.
calibration, starting with any arbitrary calibration value
such as 1 (on line 21). You now have an object of known weight. Place it on
your scales and note the reading. Multiply your current
I didn't have any standard weights, so for the 1kg load scale factor by the reading you got and divide the result
cell I used a new £1 coin, which weighs 8.75g. Ideally you by what the reading should have been, whether in
should use something weighing at least a tenth of the grams, kilograms, pounds, micro-elephants or whatever
scale's maximum. units you choose. The result is your new scale factor. Try
your know weight again, and if necessary, repeat the
Find something - anything - of a roughly suitable weight. process.
Take it down to your local post o ce, pretend you need
to post it, and put it on the scales there and make a

Hello,
nice project!
I could realize a first draft setup quite easily... only point is that I think that your figure on step 4,
about wiring the 4 3-wides load cells, has a bug: the A terminals are connected cross wise, and if
one follows that exactly (as I did at first) then the readouts are not good, they come out all
zeroes... (after the first setup lines). Instead your text and the scheme given in the wiki link are
good and specify that the A and C terminals should connect to opposite cells on the sides of
each cell. After changing that it all worked. I see actually the comment of somebody having all
zero readings, he/she might have done the same as me...
Bye
Daniel
Thank you Daniel, and sorry for taking a little while to reply. You're dead right, and I've changed
the diagram accordingly. Does that look right now? Amazing that it's taken 3½ years and nearly
75,000 pairs of eyes to spot this - you get teacher's gold star!
Hello. Thanks for your kind answer. I also hesitated before posting a comment after seeing
nobody had noticed it since a long time! I thought I was getting something wrong. Anyway, the
scheme looks good to me now.
hi, I am just wondering if i could get in contact to ask some questions about a school project
similar to this.
How to Build Arduino Weighing Scales: Page 7
By all means ask what you like!

where would you buy these components in Australia? Because I can't seem to find a load cell
anywhere (or does it have alternative names?) Also can you use an Ardunio uno instead of a
bread board?
I'm afraid I have no direct knowledge of the antipodean market but I'm sure you should be able to
find all you need on eBay, either from local sellers (if they exist) and if not, from the Far East.
Took at least one day to make the project!

Brilliant - well done! I do like the cardboard box - you are a true engineer at heart!
How about writing your own Instructable to describe how you added the display?
Hello, My prototype is a 4 load cells and apparently I assembled it all correctly but the readings
are always zeros. I replaced the HX711 module, the load cells and the Arduino board but still
reading zeros. Not sure what else to try to fix it.
Hmm... hard to know what to suggest. But if it's truly reading zero then that implies the Arduino
isn't communicating with the HX711 properly rather than a problem with the load cells or their
wiring - maybe the pin numbers are wrong or one of the Arduino pins is dead (less likely). You
double-checked everything, didn't you? Now check it again, having put it aside for a few days. If
you're still puzzled, try explaining it all to your granny - she might not understand a word of it
(though some amazing grandmothers might!) but the process of explaining it to someone else
often turns on the light bulb in your head.
I'm doing a self-conversion of a van into a full-time camper, fixing all of the annoying things I've
put up with in pre-built ones. As well as networking the entire system to simplify wiring and
modularise the system, I'm correcting the damned water gauges.
Normally, these have three electrodes up the side of the tank to show which third the fresh/gray
water is currently covered. For my version, I have two 40L detachable tanks and I'm going to use
the weight (1L of water weighs 1Kg) to more accurately indicate the state of water, broadcasting
the result across the internal network.
Just another possible use for this.
Sounds like a great idea! I hope it works out well.

A very easy to go instruction. Connected all as you said. Even though I used a Teensy 3.5 insted
of an Arduino the code worked from the first flash and first try.
I´m impressed. Thanks
I used almost the same equipment, only instead of an Arduino nano I used a Teensy 3.5.
Thanks for the instrucitons, very helpful and straight forward.
Here a picture of my setup.

Very useful for me. But I have a problem, I have to made weighing scale with 4 loadcell. how is it
possible ? Please help. Thanks in advance.
See Step 4: How to use 3-wire load cells. Connect the 4 together as described.

How to Build Arduino Weighing Scales: Page 8


Hi there! First of all, thanks for share you made an excellent work! In a subject of my university i
have to do a project like this, but i need to make a NI LABview interface from where i can reset
the weighing machine, see the exact value, etc. I don´t have any knowledge about it :c ... Have
you use this program? Any help it's welcome. Thanks for all, by the way
I'm sorry but I don't know anything about LABview. Googe is your friend. The key to getting the
right answer out of Google is to ask the right question.
Hi, I have recently undertaken this project and am running into some difficulties. Whenever I look
at the serial monitor this is what is shown:

Any ideas on what may be causing this? Thanks

Very easily sorted. You see the box at the bottom where it says 300 baud? Click on the down
arrow next to it and select 38400 baud. This must match the line Serial.begin(38400); in setup() in
the sketch.

The baud rate is the rate in bits per second that data is transmitted to and from the serial
connection. Both ends must agree or the data appears as garbage, as you saw.
You have mentioned this line for 4 connection of Load cells. Is this line correct?
"The C wires of two load cells on opposite sides of the square are E+ and E-, and the B wires of
the other pair are A+ and A-"
or should this be
"The B wires of two load cells on opposite sides of the square are E+ and E-, and the B wires of
the other pair are A+ and A-"
You're quite right and well spotted! Thank you - I've corrected it.

Very useful. Thanks.

How to Build Arduino Weighing Scales: Page 9

You might also like