How to Build Digital Weighing Scale

Introduction

This article will take you through a simple guide on how to make a digital weighing scale, maybe for fun, learning or as part of your school projects. Also, the terms used are simplified so that a layman can at least try to understand them and get the device ready in no time. However, you will still need a little understanding of basic electronics and computer programming.

Furthermore, the components used for this article can easily be obtained from online through brands such as Tacuna Systems, Omega Engineering, Vishay PG transducers, Sparkfun, Arduino and many more.

So, follow me as I walk you through how to build a scale.

What Is A Digital Weighing Scale?

You have definitely seen a digital weighing scale somewhere at home or retail stores used for inventories, where the object to be weighed is placed on the device and its weight is displayed as numbers with its unit of measurement besides it as shown in the figure below. Also, a popular type of digital weighing scale is the bathroom weighing scale.

Digital Weighing Scale
Digital Weighing Scale

A digital scale is, therefore, an electronically operated device that basically displays the weight/size of an object placed on it. It displays the weight as numbers and digits by using a liquid crystal display or an array of 7 segment display.

The next section describes the components needed to set up a simple digital scale, it also describes the function of each of these components. This will help to better understand how to couple them together later on.

Oh, and before you carry on making a digital weighing scale, we also offer a range of scales for every purpose, check out below:

The Basic Components Required And Their Functions

  1. A Load Cell Transducer: This is a device that senses an applied weight to give an observable output quantity that is proportional to the applied weight. There are different types of load cells and not all load cell sensors are transducers, but all load cell transducers are sensors. In case you are confused, a sensor is a device that detects a physical phenomenon such as a force and then produces a change in a physical parameter. A transducer, on the other hand, senses this physical phenomenon and then converts it to an electrical output signal. Examples of load cells are the pneumatic load cell, hydraulic load cell, strain gauge load cell, capacitive load cell etc. The most common type used in digital scales is the strain gauge load cell. The strain gauge load cell is a transducer device, that senses a weight placed on its load application point and then gives an electrical signal output that is proportional to the weight1. This device has an underlying mechanism that enables it to sense and transduce weights, it is called the strain gauge. The strain gauge is a resistive and elastic metal foil material that is fixed and attached to the bending parts of the load cell as shown in the figures below.
  1. A strain gauge load cell is therefore made up of the physical and electrical connection of one or more strain gauges. Electrically, the strain gauge(s) are set up as a wheatstone bridge in connection with other strain gauges or with resistors. The diagram below which shows the electrical connection between four strain gauges of a load cell helps to explain this better.
The Electrical Connection of Four Strain Gauges into a Wheatstone Bridge
  1. The Electrical Connection of Four Strain Gauges into a Wheatstone Bridge This, therefore, means that in a load cell, these strain gauges can be electrically connected into three distinct types of configurations which are:
    • The Full bridge, with all the arms of the Wheatstone bridge, consisting of strain gauges (SG).
    • The Half-bridge, with two alternating arms of the bridge, made up of SG
    • The Quarter-bridge, in which just one of the arms of the bridge is made up of SG and the remaining arms consist of resistors and a dummy gauge is placed opposite the SG. Based on the explanations and the figures above, you should, therefore, be able to understand that when a weight/object is placed on the load cell, it makes the strain gauges to change their dimensions and resistance, hence an electrical voltage is produced at its output.This load cell output is rated in mV/V and you can get more specification details about the device through its datasheet.
  2. The Signal Conditioner: This is a circuit device whose function is to amplify the load cell output voltage and filter both its input and output signals. Amplification is needed since the output of the load cell is always very small, measured in mV as stated under the explanation of a load cell. The process of application is done by the amplifier. A simple amplifier is the Op-Amp which by default has a theoretical infinite open-loop gain, which practically means the gain is very high but not infinite. This gain can then be regulated by using feedback networks to any of its inputs. The feedback networks can consist of resistors, capacitors, and inductors of certain values which help to set the maximum gain value of the amplifier. Load cell signal processing requires a special type of amplifier called the Instrumentation amplifier, which is the most efficient type to use. It offers better amplification characteristics which a normal Op-Amp does not possess. The Filter circuit can also be embedded with the amplifier together on a single chip. This circuit serves to filter off noise signals and EMI that might compromise the value of the load cell’s amplified signal. It decouples AC signals from the DC output signals. Read about: Tacuna Systems load cell signal conditioner
  3. The Microcontroller: This is the central processing unit of the whole digital scale. The output of the signal conditioner is sent to the analog input of the microcontroller, which then performs analog to digital conversion on this signal. It should be noted that some signal conditioner also has an inbuilt analog to digital converter circuit embedded together with the amplifier circuit and the filter circuits on a single chip. This will then go to reduce the workload on the microcontroller, as the output of the signal conditioner is sent to the digital input of the microcontroller. The microcontroller will then read the clocked digital pulses from the conditioner so as to retrieve the data to be processed in determining the weight of the object placed on the load cell. Furthermore, after processing either of the analog or digital signals from the signal conditioner, the microcontroller computes the weight and then displays it through an LCD connected to it.
  4. The Liquid Crystal Display: This is wired to the microcontroller to display the weight.

Coupling These Components

The physical coupling of this project is done using each of the following components:

  • A 5kg load cell
  • An HX711 amplifier
  • An Arduino Uno Microcontroller Unit (MCU)

While developing this article, I was unable to lay my hands on an LCD for displaying the weights measured. However, I will use the Arduino IDE Serial Monitor to display the readings.

I have divided the process of building a scale into two parts; the hardware setup and the code.

The Hardware Setup

The 5kg load cell used for the purpose of these article has four wires (some load cells have 5 wires). The wires are labeled as follow, according to the load cell’s datasheet.

  • Red wire is the positive power supply
  • White wire iis the Ground of the power supply
  • Black wire is the positive output
  • Green wire is the negative output

In case of any extra wire, which might be any color such as blue or yellow, it represents the ground wire for EMI which should be connected to the power supply ground.

I will like to re-emphasize again that the wiring diagram depends on the datasheet of the load cell which you purchase, ensure to always request a datasheet from your supplier when purchasing a component.

Now, these wires are fixed to the appropriate pins of the HX711 amplifier device as shown in the sets of pictures below. The HX711 is a special amplifier that has 2 channel inputs A and B, each with different amplifier gains that can be adjusted by a computer program. The channel A has a gain of 128 and 64, while the channel B has a fixed gain of 32.

Also, you should note that this HX711 device matches the description of the type of signal conditioning device that has an amplifier, filter, and ADC embedded together on a single chip. This, therefore, means that its data output goes to the digital input pin of our microcontroller instead of its analog pin.

Therefore, connecting the HX711 and the load cell is as follow:

  • Red wire/Positive supply -> E+
  • White/Negative Supply -> E-
  • Green/Negative Ouput -> A-
  • Black/Positive Output -> A+

Now, the HX711 is connected to the Arduino MCU as follow:

  • VCC -> 5V supply on Ardunio
  • GND ->GND
  • CLK -> D2
  • DOUT -> D3

The Code

Now, that the hardware has been set up, the program code is then uploaded into the MCU from your PC through the Arduino IDE. The process and the code is subdivided into two which are the calibration code and the weighing code.

The calibration code is the program used to calibrate the load cell transducer. Calibration simply means a way of configuring our load cell output to always give a precise value of weight and at the particular S.I unit such as Kilograms, Grams, Tons, Pounds etc.

The HX711 library code contains a good guide on how to calibrate the load cell and it was the guided procedure that was followed in this article.The calibration code is shown below

The results of the calibration process are shown below in the Serial Monitor of the Arduino IDE

The weighing code is then uploaded to the MCU after the calibration process is completed and you have obtained the value of the offset reading and the scale factor. This code and the results are shown below. The results are shown for a 500g weight and a 1kg weight respectively.