Jump to content
OFF HOSTINGER CLOUD: Secure SSL + Professional Email + Free Domain ×
AdBlock Detection and Evasion

HX711 load cell transmitter tutorial, Digital Scale


369

Recommended Posts

HX711 load cell transmitter tutorial, Digital Scale

471501

In this tutorial we will work with the HX711 Load Cell Transmitter ModuleI have indicated all the steps for connection and programming with the aim of assembling a digital scale.

CONTENT:

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

I. HARDWARE:

Load cells

A load cell is a transducer capable of converting a force into an electrical signal, this is done through one or more internal gauges connected in a Wheatstone bridge configuration.

There are various types of load cells in various models and load capacities. The model that we will use in this tutorial is the one shown in the image: a

This is the hidden content, please
, 5Kg being the maximum load value that this cell can sense. The tutorial also applies to other cells such as:
This is the hidden content, please
/
This is the hidden content, please
/
This is the hidden content, please
and other models.

Load cell 5Kg load cell

HX711 Load Cell Transmitter

This module is an interface between the load cells and the microcontroller, allowing the weight to be read easily. Internally it is in charge of reading the wheatstone bridge formed by the load cell, converting the analog reading to digital with its internal 24-bit A/D converter. It communicates with the microcontroller digitally through 2 pins (Clock and Data), in a serial manner very similar to I2C.

It is widely used in industrial processes, automated measurement systems and the medical industry.

HX711 Module

Assembling the mechanical part of our Digital Scale

To install the load cell it must be done with separators or spacers, which must provide distance between the base and container of the cell so that the central part is free; It must also be taken into account that the direction of the arrow in the cell indicates the direction of the force or weight to be measured.

The following figure shows an example of how to install the load cell, but it will depend on your

This is the hidden content, please
to make the necessary variations:

Balance Design

Connection between the Load Cell, HX711 module and Arduino.

Connection between the load cell and HX711 module:

Load cell

HX711 Module

Red Wire

Pin E+

Black Cable

Pin E-

Green cable

Pineapple-

White Cable

Pin A+

Connection between HX711 and Arduino:

HX711 Module

Arduino UNO, MEGA, NANO

Pin GND

Pin GND

DT Pin

Pin A1

Pin SCK

Pin A0

VCC Pin

Pin 5V

The final connection would be as shown in the image:Connections HX711 Arduino load cell

II. SOFTWARE:

HX711 library for Arduino


We will work with the HX711 library developed by Bogde. It can be downloaded from Github:

This is the hidden content, please

Or import it directly from the Arduino IDE library manager.

Let’s explore the main functions of the library:

begin(byte PinData, byte PinClock);

Initialize the HX711, you can work with any of the pins.

tare(byte n);

Set the current weight as the tare weight, n indicates the number of readings that are performed to obtain the tare, by default n=10;

set_scale(floatscale);

Sets the scale value, which is the conversion factor to convert reading value to a value with weight units. By default it is scale=1;

read();

Wait until the device is ready and return the reading from the HX711 ADC

read_average(byte n);

Makes n times the ADC reading and returns the average

get_value(byte n);

Returns the current value subtracting the tare weight. Equivalent to (read_average() – OFFSET) . If a value of n is specified, returns the average of n readings.

get_units(byte n);

Returns the current value subtracted from the tare weight and divided by the scale. It is equivalent to (get_value()/SCALE). If a value of n is specified, returns the average of n readings.

III. EXAMPLES:

1. Calibrating our Scale

The first thing to do is calibrate the scale, which is basically finding the value of the scale that will be used; That is, find the conversion factor to convert the reading value into a value with weight units. The scale is different for each cell and changes according to the way of installation, the maximum weight or load cell model, even if they are the same cell model they do not necessarily have the same scale value.

First we need to get an object with a known weight, in other words we must previously know the real weight of the object. It is recommended that the known weight be close to the maximum value of the load cell’s working range. In our case we will use a weight of 4Kg since our cell is 5Kg.

The next step is to upload the following Sketch to our Arduino:

#include "HX711.h"
const int DOUT=A1;
const int CLK=A0;


HX711 balanza;
void setup() {
  Serial.begin(9600);
  balanza.begin(DOUT, CLK);
  Serial.print("Lectura del valor del ADC:t");
  Serial.println(balanza.read());
  Serial.println("No ponga ningún objeto sobre la balanza");
  Serial.println("Destarando...");
  balanza.set_scale(); //La escala por defecto es 1
  balanza.tare(20);  //El peso actual es considerado Tara.
  Serial.println("Coloque un peso conocido:");
}

void loop() {

  Serial.print("Valor de lectura: \t");
  Serial.println(balanza.get_value(10),0);
  delay(100);
}

The program must run initially without setting the reference weight, since the tare is calculated at the beginning of the program. After opening the serial monitor and waiting for the tare to subtract, the 4Kg object or the available reference weight is placed.

Calibration with 4Kg weight

After putting the weight on the scale, the serial monitor will show the weight readings, they are unscaled readings so large numbers should appear.

Calibration data

With one or the average of these data we calculate the value of the scale that we will use, for this we will use the following formula:

Formula scale HX711

The weight value must be in the units with which we want our scale to work, for example it could be 4Kg or 4000g for Kilogram or grams respectively.

So the Scale value that we will use is:

HX711 Scale Factor

With this data already obtained, we move on to programming the production sketch that we are going to use for weighing.

2. Final program for our Balance

The program that will be used is similar to the program we used to calibrate, with the difference that we already know the scale:

#include "HX711.h"

const int DOUT=A1;
const int CLK=A0;

HX711 balanza;

void setup() {
  Serial.begin(9600);
  balanza.begin(DOUT, CLK);
  Serial.print("Lectura del valor del ADC:  ");
  Serial.println(balanza.read());
  Serial.println("No ponga ningun  objeto sobre la balanza");
  Serial.println("Destarando...");
  Serial.println("...");
  balanza.set_scale(439430.25); // Establecemos la escala
  balanza.tare(20);  //El peso actual es considerado Tara.
  
  Serial.println("Listo para pesar");  
}

void loop() {
  Serial.print("Peso: ");
  Serial.print(balanza.get_units(20),3);
  Serial.println(" kg");
  delay(500);
}

As seen in the code: in the setup the scale is initialized, calibrated and tare, so at the time of starting operation there should not be any additional weight to the tare, otherwise the weight on the scale will be It will be considered tare and the scale will not work correctly. After the serial monitor displays: “Ready to weigh”, we can work with our scale.

The readings are shown below by successively adding weights of approximately 1Kg.

Results

As you can see, the HX711 module is easy to implement in any project, the applications are varied: from a simple digital scale to industrial automatic dosing equipment.

Link to comment
Share on other sites

AdBlock Detection and Evasion

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

AdBlock Detection and Evasion


  • Posts

    • Season 5, Episode 03 – “Stephen Colbert and Evie McGee-Colbert” Ina Garten welcomes old and new friends into her home for good food, great conversation and lots of fun. Her guests include actress Julianna Margulies, broadcaster Willie Geist and chef and restaurateur Erin French. Links: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Be.My.Guest.With.Ina.Garten.S05E03.1080p.WEB.H264-EDITH MKV | AC3 / dolby digital plus | 1.42GB This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Be.My.Guest.With.Ina.Garten.S05E03.WEB.H264-RBB [P2P] MP4 | AAC | 178MB This is the hidden content, please Sign In or Sign Up - This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up
    • Season 7, Episode 81 – "Tinned Tomatoes" A pantry staple becomes the hero tonight as Adam and his guests, comedian Mel Buttle and chef Dom Wilton make magic with tinned tomatoes. Links: This is the hidden content, please Sign In or Sign Up –  This is the hidden content, please Sign In or Sign Up The.Cook.Up.With.Adam.Liaw.S07E81.WEB-DL.x264-JiVE MP4 | AAC | 198MB This is the hidden content, please Sign In or Sign Up - Subtitles – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up
    • Plot: Sideshow Bob sings his own version of a Christmas song for Halloween along with several Disney villains, Genre: Short IMDB Rating Live: This is the hidden content, please Sign In or Sign Up IMDB Rating: 5.3/10 From 56 Users Rotten Rating: N/A Metacritic Rating: N/A Directed by: David Silverman Starring: Nancy Cartwright , Chris Edgerly , Tress MacNeille Release Name: The.Most.Wonderful.Time.Of.The.Year.2024.720p.WEB.H264-JFF Size: 66.5MB Video: MKV | 1280x720 | 2 867 kb/s | 23.976 FPS Audio: English | AC3 / dolby digital plus | 256 kb/s Runtime: 2 min 55 s Subtitles: English, Czech, Danish, German, Greek, Spanish, Finnish, French, Hungarian, Italian, Japanese, Korean, Dutch, Norwegian, Polish, Portuguese, Romanian, Slovak, Swedish, Turkish, Chinese [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | Trailer | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 720p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Release Name: The.Most.Wonderful.Time.Of.The.Year.2024.720p.DSNP.WEB-DL.DDP5.1.H.264-Kitsune Size: 74.4MB Video: MKV | 1280×720 | 3 302 kb/s | 23.976 FPS Audio: English | AC3 / dolby digital plus | 256 kb/s Runtime: 2 min 55 s Subtitles: English, Czech, Danish, German, Greek, Spanish, Finnish, French, Hungarian, Italian, Japanese, Korean, Dutch, Norwegian, Polish, Portuguese, Romanian, Slovak, Swedish, Turkish, Chinese [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | Trailer | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 720p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Release Name: The.Most.Wonderful.Time.Of.The.Year.2024.1080p.DSNP.WEB-DL.DDP5.1.H.264-Kitsune Size: 132MB Video: MKV | 1920×1080 | 6 073 kb/s | 23.976 FPS Audio: English | AC3 / dolby digital plus | 256 kb/s Runtime: 2 min 55 s Subtitles: English, Czech, Danish, German, Greek, Spanish, Finnish, French, Hungarian, Italian, Japanese, Korean, Dutch, Norwegian, Polish, Portuguese, Romanian, Slovak, Swedish, Turkish, Chinese [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | Trailer | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 1080p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up
    • This is the hidden content, please Sign In or Sign Up 2 wins & 5 nominations This is the hidden content, please Sign In or Sign Up » Plot: Sylvia is a social worker who leads a simple and structured life. This is blown open when Saul follows her home from their high school reunion. Their surprise encounter will profoundly impact both of them as they open the door to the past. Genre: Drama IMDB Rating Live: This is the hidden content, please Sign In or Sign Up IMDB Rating: 6.7/10 From 6,751 Users Rotten Rating: 86% Metacritic Rating: N/A Directed by: Michel Franco Starring: Alan Nehama , Dutch Welch , Aliya Campbell Release Name: Memory.2023.720p.BluRay.DD5.1.x264-PTer Size: 5.05GB Video: MKV | 1280x536 | 6 358 kb/s | 24.000 FPS Audio: English | AC3 / dolby digital | 640 kb/s Runtime: 1 h 43 min Subtitles: English, Chinese, French [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 720p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up
    • Plot: When a young nomad begins the journey home from his ex-girlfriend’s funeral, he finds himself desperately trying to escape increasingly real visions of her vengeful ghost. Genre: Drama | Horror IMDB Rating Live: This is the hidden content, please Sign In or Sign Up IMDB Rating: N/A Rotten Rating: N/A Metacritic Rating: N/A Directed by: Jaron Lanier , Olivia Lanier Starring: Cailin Lanier , Jaron Lanier , Judah Relly Release Name: Haunted.By.Her.Name.2024.WEB.H264-RBB Size: 749MB Video: MP4 | 720×400 | 998 kb/s | 23.976 FPS Audio: English | AAC | 160 kb/s Runtime: 1 h 29 min Subtitles: Avestan [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download MP4: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Release Name: Haunted.By.Her.Name.2024.720p.WEB.H264-JFF Size: 1.21GB Video: MKV | 1280x720 | 1 800 kb/s | 23.976 FPS Audio: English | AAC Runtime: 1 h 29 min Subtitles: Avestan [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 720p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Release Name: Haunted.By.Her.Name.2024.1080p.WEBRip-SMILEY Size: 1.75GB Video: MKV | 1920×1080 | 23.976 FPS Audio: English | AAC Runtime: 1 h 29 min Subtitles: Avestan [Selectable] or ( This is the hidden content, please Sign In or Sign Up ) Samples: Video @ This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up Links: This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up | This is the hidden content, please Sign In or Sign Up Download 1080p: This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up – This is the hidden content, please Sign In or Sign Up
×
×
  • Create New...

Important Information

Términos y Condiciones

×
  • Home
    Activities
    Sign In
    Search
    More
    ×