- Load Cell Setup
- Hardware Hookup
- Installing the HX711 Arduino Library and Examples
- Arduino Example
- Resources and Going Further
The HX711 load cell amplifier is used to get measurable data out from a load cell and strain gauge. This Hookup Guide will show you how to get started with this amplifier using some of the various load cells we carry at SparkFun.
SparkFun Load Cell Amplifier — HX711
The SparkFun Load Cell Amplifier is a small breakout board for the HX711 IC that allows you to easily read load cells to meas
For this simple hookup guide, we will just be hooking up a load cell with the HX711 amplifier, and showing how you would hook up four load sensors with a combinator board and the HX711 amplifier. To follow along, you’ll need:
Load Cell — 10kg, Straight Bar (TAL220)
This straight bar load cell (sometimes called a strain gauge) can translate up to 10kg of pressure (force) into an electrical
Mini Load Cell — 500g, Straight Bar (TAL221)
This straight bar load cell (sometimes called a strain gauge) can translate up to 500g of pressure (force) into an electrical
Load Cell — 200kg, Disc (TAS606)
This disc load cell (sometimes called a strain gauge) can translate up to a whopping 200kg of pressure (force) into an electr
Mini Load Cell — 100g, Straight Bar (TAL221)
This straight bar load cell (sometimes called a strain gauge) can translate up to 100g of pressure (force) into an electrical
Load Cell — 5kg, Straight Bar (TAL220B)
This straight bar load cell (sometimes called a strain gauge) can translate up to 5kg of pressure (force) into an electrical
Load Cell — 200kg, S-Type (TAS501)
This S-Type load cell (sometimes called a strain gauge) can translate up to 200kg of pressure (force) into an electrical sign
Load Cell — 50kg, Disc (TAS606)
This single disc load cell (sometimes called a strain gauge) can translate up to 50kg of pressure (force) into an electrical
If you are planning on using load sensors 1 you will need to obtain or purchase four units. We recommend our Combinator Board to make it easy to turn the four strain gauges into a wheatstone bridge type load cell. (Single strain gauge load cells only have three wires instead of four.)
If you aren’t familiar with the following concepts, we recommend reviewing them before beginning to work with the HX711 Load Cell Amplifier Board.
How to Solder: Through-Hole Soldering
How to Power a Project
Getting Started with Load Cells
1. [Strain gauges are two wired organized metal foil or wires that are set up in such a way that the resistance changes when it is compressed or stretched. When a strain gauge is placed on something (usually metallic in nature) its resistance changes based on the stress experienced by that something. When a single strain gauge is hooked up to a metallic cell, we are calling that a load sensors, which have three output wires. Load cells usually has four strain gauges hooked up in a wheatstone bridge formation, which have four output wires. For more information on load cells, strain gauges, and wheatstone bridges see our tutorial.]↩
Load Cell Setup
Depending on the type of load cell you are using, the configuration of how it should be hooked up to plates or surfaces will change. We’ll list a few different types of setups below.
Bar-Type Load Cell
Usually with larger, non-push button bar load cells you will want to hook up the load cell between two plates in a "Z" shape.
As shown below, the bar-type load cell is mounted with fitting screws and spacers so that the strain can be correctly measured. Note that only one side of the load cell is screwed into each board when a bar-type load cell is placed between two plates. This provides a moment of force, or torque, on the strain gauge rather than just compression force, which is easier to measure and much more accurate.
S-Type Load Cell
S-type load cells can measure compression, tension, or both due to its design.
Besides placing the load cell between plates, the s-type can be used to measure suspended tanks or hoppers. You can think of this as a load attached to a crane. Below is an s-type load cell with two threaded, rod end bearings.
Single, Strain Gauge Load Cells (i.e. Load Sensors)
For single, strain gauge load cells, they can be placed at equal distances with respect to each other underneath a platform.
The image below shows four, single strain gauge (i.e. the load sensor) arranged in a wheatstone bridge configuration. This configuration is also possible with four button-type load cells.
Button/Disk-Type Load Cells
For smaller, push-button or disc load cells, you will want to make sure to screw in the disc to a bottom plate (or surface you are measuring force against), and center the beam, plate, or whatever else you are wishing to measure the force of onto the "button" on the top.
Usually another plate with a hole is used to make sure whatever you are measuring is hitting the same spot on the load cell each time, but it is not necessary. Below are images of four button-type load cells placed at equal distances with respect to each other under a platform. Make sure to read the datasheet for the load cell you are using and get the correct screws to fit into it.
|Push Button Load Cells from the IoT Industrial Scale tutorial||Push Button Load Cells Inside a Custom Built Scale|
Variances in Measurements
Load cell measurements can be off by +/- 5% due to a range of things including temperature, creep, vibration, drift, and other electrical and mechanical interferences. Before you install your scale, take a moment and design your system to allow for easy calibration or be able to adjust the code parameters to account for these variations.
The HX711 Load Cell Amplifier accepts five wires from the load cell. These pins are labeled with colors; RED, BLK, WHT, GRN, and YLW.
These colors correspond to the conventional color coding of load cells, where red, black, green and white wires come from the strain gauge on the load cell and yellow is an optional ground wire that is not hooked up to the strain gauge but is there to ground any small outside EMI (electromagnetic interference). Sometimes instead of a yellow wire there is a larger black wire, foil, or loose wires to shield the signal wires to lessen EMI.
In general, each load cell has four strain gauges that are hooked up in a wheatstone bridge formation as shown below.
The four wires coming out from the wheatstone bridge on the load cell are "usually":
|Wheatstone Bridge Node||"Typical" Wire Color|
|Excitation+ (E+) or VCC||RED|
|Excitation- (E-) or GND||BLACK or YELLOW|
|Output- (O-), Signal- (S-), or Amplifier- (A-)||WHITE|
|O+, S+, or A+||GREEN or BLUE|
Some load cells might have slight variations in color coding such as blue instead of green or yellow instead of black or white if there are only four wires (meaning no wire used as an EMI buffer). You might have to infer a little from the colors that you have or check the datasheet on the load cell, but in general you will usually see these colors.
Once the load cell is is hooked up to the amplifier, you can hook up VDD, VCC, DAT, CLK, and GND to a microcontroller such as a RedBoard or Arduino board.
Note: VCC is the analog voltage to power the load cell. VDD is the digital supply voltage used to set the logic level.
The example code has DAT and CLK hooked up to pin 3 and 2 respectively, but this is easily changed in the code. Any GPIO pin will work for either. Then VCC and VDD just need to be hooked up to 2.7-5V and GND to ground on your microcontroller.
Strain Gauges with the Load Cell Combinator Board
Now, if you would like to set up four single load sensors with our combinator board and amplifier, connect the five pins labeled RED, BLK, WHT, GRN, YLW on the combinator to the matching pins on the amplifier. Next, connect each of the four load sensors to the following pins:
|Single, Strain Gauge (i.e. Load Sensor)
"Typical" Wire Color
|Load Combinator Board|
Note: The combinator board also has room for an 8 pin RJ45 socket, which can be used to connect your project via Ethernet cables for long distance applications.
RJ45 8-Pin Connector
These are simple through-hole RJ45 sockets with PCB mounting posts. These 8-pin connectors are commonly used in conjunction w
CAT 6 Cable — 3ft
This 3ft Category 6 (CAT 6) Ethernet cable is the solution to your internet working needs. With a speed of up to 500MHz you c
Another nice thing about our combinator board is that most home scales use four single strain gauge load sensors, so this is a handy board for hacking your own scales at home!
For load sensors, there isn’t a set color coded standard. The hacked home scale can have different wire colors. Comparing the scale pictured above with the load sensor schematic, while the black wires matched, the red and white wires were swapped. Also, only two of the four sensors used a white wire for the ‘center tap’ of the load sensor, the other two used green. I connected the black wires to "—", the red to "+", and the white and green wires to "C".
To determine how to hook up your single strain gauge load cells to the combinator, measure the resistance with a multimeter between the three wires. You should find a larger resistance (close to double) between a pair. In our example, the resistance between red and black was 1.6 kΩ (i.e. 1600Ω), and the resistance between white/green and red was 800 Ω. Therefore, the center tap to the strain gauge is the white/green wire. The center tap or center pin of your strain gauge connects to the "C" pin on the combinator. The larger resistance wires (red and black in this example) connect to the "+" and "-" pins on the combinator.
The combinator board hooks up the four load sensors in such a way that two resistors in the wheatstone bridge configuration are constant values and the other two are variable in this way:
Once you have the combinator board successfully soldered to the twelve wires, you can now connect it to the HX711 amplifier board via the 4 standard load cell wires. Connecting the yellow pin is optional. You can use short jumper wires or if your electronics are a long distance away from your scale consider using an RJ45 connector and an ethernet cable to connect the combinator to the HX711 amplifier.
When finished, your setup should look similar to the image below. Make sure to secure the wires before placing it in an enclosure.
Installing the HX711 Arduino Library and Examples
Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.
Now that you have your load cell, amplifier, and microcontroller hooked up, you can add your code and start calibrating your setup. You will need to download the excellent HX711 library from user bogde. As of the writing of this tutorial, the library has been tested on ATmega328P, ESP8266, ESP32, and STM32. Open the Arduino IDE's library manager and search for "HX711 Arduino Library". Click on the library to install. You can also download the *.ZIP file from the GitHub repo to manually install the library.
You will also need to download the most up-to-date example code from the GitHub repository to follow along.
The first thing you will want to work with is the calibration code "SparkFun_HX711_Calibration.ino" from the SparkFun examples.
Once you have calculated your calibration factor of your load cell set up, you can move on to other code, such as the simple scale output example code, "SparkFun_HX711_Example.ino":
Check out the other example codes provided in the GitHub repo for powering down the HX711 and known zero startup ).
Resources and Going Further
Now that you’ve successfully got your HX711 up and running, it’s time to incorporate it into your own project!
For more information, check out the resources below:
Need some inspiration for your next project? Check out some of these related tutorials: