{"id":10253,"date":"2020-12-14T22:15:23","date_gmt":"2020-12-14T22:15:23","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/hx711-based-balance"},"modified":"2025-01-30T18:12:26","modified_gmt":"2025-01-30T18:12:26","slug":"hx711-based-balance","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance","title":{"rendered":"HX711 based balance"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About the post<\/h2>\n\n<p>With an HX711 module and a load cell, it is easy to build an amazingly exact scale. In this article, I would like to show how this works in principle.<\/p>\r\n\r\n<p>My goal was to achieve the same functionality as my digital kitchen scale:<\/p>\r\n<ul>\r\n \t<li>Output of the weight on a display<\/li>\r\n \t<li>Only one button to turn on and for tare<\/li>\r\n \t<li>Automatic shutdown after a certain time<\/li>\r\n<\/ul>\r\n<p>The article is structured as follows:<\/p>\r\n<ul>\r\n \t<li><a href=\"#wasihrbraucht\">What you need<\/a><\/li>\r\n \t<li><a href=\"#messprinzip\">The measuring principle<\/a><\/li>\r\n \t<li><a href=\"#einbau\">Installing the load cell<\/a><\/li>\r\n \t<li><a href=\"#hx711_adc_bibliothek\">Using the HX711 ADC Library<\/a><\/li>\r\n \t<li><a href=\"#oled_ausgabe\">Output via an OLED display<\/a><\/li>\r\n \t<li><a href=\"#schlafen_schicken\">How to send the scale to sleep<\/a><\/li>\r\n \t<li><a href=\"#ganz_ausschalten\">How the balance can turn itself off completely<\/a><a id=\"wasihrbraucht\"><\/a><\/li>\r\n<\/ul>\n\n<h2 class=\"wp-block-heading\">What you need<\/h2>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/12\/Waegeeinheit_und_HX711.jpg\"><img decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/W&#xE4;geeinheit_und_HX711-1024x463.jpg\" alt=\"Typical kit of load cell and HX711 module \" class=\"wp-image-5643\"\/><\/a><figcaption class=\"wp-element-caption\">Typical kit of load cell and HX711 module<\/figcaption><\/figure>\n\n<p>To build the scale, you need a load cell and an HX711 module. You can buy both as a kit. If you search for &#8220;HX711 load cell&#8221; on <a href=\"https:\/\/smile.amazon.de\/s?k=hx711+W%C3%A4gezelle&amp;__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&amp;ref=nb_sb_noss_2\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon<\/a> or <a href=\"https:\/\/www.ebay.de\/sch\/i.html?_from=R40&amp;_trksid=m570.l1313&amp;_nkw=hx711+W%C3%A4gezelle&amp;_sacat=0\" target=\"_blank\" rel=\"noopener noreferrer\">eBay,<\/a> for example, you&#8217;ll get dozens of offers for a few euros. Select a load cell with the weight range that is right for you. For this post, I chose a 2 kg cell.&nbsp;<\/p>\r\n<p>That being said, I can&#8217;t provide you with a detailed shopping list because it depends too much on your specific wants and needs. I recommend reading first this article and then decide for yourself. <a id=\"messprinzip\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">The measuring principle<\/h2>\n\n<p>The load cell is slightly bent by the weight of the load to be weighed. Under the white glue there are four strain gauges which build a Wheatstone bridge. Their resistance value changes with the degree of elongation, i.e. with the weight. The resistance generates a voltage drop, which in turn is evaluated with an A\/D converter. In my <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/strain-gauges\" target=\"_blank\" rel=\"noopener\">blog post about strain gauges<\/a>, I explain the details.<\/p>\r\n<p>The change in voltage drop with increasing weight is small. I measured a few millivolts per kilogram. The A\/D converter of an Arduino UNO or an ATmega328P is not suitable for this purpose. The HX711, on the other hand, has an impressive resolution of 24 bits (= 16,777,216).<\/p>\r\n<p>The HX711 itself is actually the sixteen pin chip on the module. Since it still needs a few parts to work properly, it is convenient to use the ready-to-use module. If you are interested in more technical details of the HX711, you find a data sheet <a href=\"https:\/\/cdn.sparkfun.com\/datasheets\/Sensors\/ForceFlex\/hx711_english.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">here.<\/a> <a id=\"einbau\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">Installing the load cell<\/h2>\n\n<p>You can&#8217;t avoid some tinkering. The load cell must be installed in a way that it will bend under weight. I just took a board which I found in my cellar and sawed off two equally sized pieces. I placed the load cell between the boards with spacers.<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-1024x768.jpg\" alt=\"The load cell with spacers between two boards \" class=\"wp-image-5646\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-1024x768.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-300x225.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-768x576.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-1536x1152.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite-1320x990.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Seite.jpg 1800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The load cell with spacers between two boards<\/figcaption><\/figure>\n\n<p>I drilled two holes through the bottom board and attached the load cell with two M5 screws. In addition, I added some rubber spacers to the underside.&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-1024x624.jpg\" alt=\"Underside of the HX711 scale\" class=\"wp-image-5648\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-1024x624.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-300x183.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-768x468.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-1536x935.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten-1320x804.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_unten.jpg 1800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Underside of the scale<\/figcaption><\/figure>\n\n<p>For the other side, M4 screws are actually provided. However, in order to have a smooth support surface for the weighing material, I did not want to pierce the upper board. That&#8217;s why I just took a few wood screws.&nbsp;&nbsp;<\/p>\r\n\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\">\r\n<figure><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Schrauben4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5650\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Schrauben4.jpg\" alt=\"Screws chosen by me\" width=\"292\" height=\"317\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Schrauben4.jpg 583w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Schrauben4-276x300.jpg 276w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/a><\/figure>\r\n<figcaption>Screws chosen by me<\/figcaption>\r\n<\/figure>\r\n<\/div>\r\n\n<p>Connect the load cell cables to the module as follows:<\/p>\r\n<ul>\r\n<li>Red on E+<\/li>\r\n<li>Black on E-<\/li>\r\n<li>White on A-<\/li>\r\n<li>Green on A+<\/li>\r\n<\/ul>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln-1024x466.jpg\" alt=\"Connection of the load cell to the HX711 module\" class=\"wp-image-5651\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln-1024x466.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln-300x136.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln-768x349.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln-1320x600.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/HX711_mit_Kabeln.jpg 1416w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Connection of the load cell to the HX711 module<\/figcaption><\/figure>\n\n<p>This is the interim status: <a id=\"hx711_adc_bibliothek\"><\/a><\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-1024x768.jpg\" alt=\"The HX711 based balance in raw condition\" class=\"wp-image-5652\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-1024x768.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-300x225.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-768x576.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-1536x1152.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh-1320x990.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_roh.jpg 1800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The balance in raw condition<\/figcaption><\/figure>\n\n<h2 class=\"wp-block-heading\">Using the HX711 ADC Library<\/h2>\n\n<p>I used <a href=\"https:\/\/github.com\/olkal\" target=\"_blank\" rel=\"noopener noreferrer\">Olav Kallhovd&#8217;s<\/a> HX711 ADC library to control the module. You can download it directly from Github <a href=\"https:\/\/github.com\/olkal\/HX711_ADC\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> or install it via the Arduino IDE library manager.&nbsp;<\/p>\r\n\n<h3 class=\"wp-block-heading\">HX711 Basic wiring<\/h3>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung-1024x521.png\" alt=\"Minimum connection of the HX711 to the Arduino UNO\" class=\"wp-image-5655\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung-1024x521.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung-300x153.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung-768x391.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Grundschaltung.png 1279w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Minimum connection of the HX711 to the Arduino UNO<\/figcaption><\/figure>\n\n<p>The module can be operated with voltages between 2.6 and 5.5 volts. The module is &lt;&nbsp;quite economical. Its power consumption is 1.5 milliamperes. The DT pin is connected to the Arduino Pin 4, SCK is attached to pin 5. You can choose other pins if you want.&nbsp;<\/p>\r\n\n<h3 class=\"wp-block-heading\">Calibration of the balance<\/h3>\n\n<p>To calibrate, you need an object with a known weight. The weight should be exactly known to the gram and not too small. It is best to take a second balance.&nbsp;<\/p>\r\n<p>The beauty of the library used here is that it makes life &#8211; or at least the balance calibration \ud83d\ude09 &#8211; easy for you. Select the &#8220;Calibration.ino&#8221; sketch from the library&#8217;s examples. I have printed it here unchanged:<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"Calibration.ino\" data-enlighter-title=\"Calibration.ino\">\/*\r\n   -------------------------------------------------------------------------------------\r\n   HX711_ADC\r\n   Arduino library for HX711 24-Bit Analog-to-Digital Converter for Weight Scales\r\n   Olav Kallhovd sept2017\r\n   -------------------------------------------------------------------------------------\r\n*\/\r\n\r\n\/*\r\n   This example file shows how to calibrate the load cell and optionally store the calibration\r\n   value in EEPROM, and also how to change the value manually.\r\n   The result value can then later be included in your project sketch or fetched from EEPROM.\r\n\r\n   To implement calibration in your project sketch the simplified procedure is as follow:\r\n       LoadCell.tare();\r\n       \/\/place known mass\r\n       LoadCell.refreshDataSet();\r\n       float newCalibrationValue = LoadCell.getNewCalibration(known_mass);\r\n*\/\r\n\r\n#include &lt;HX711_ADC.h&gt;\r\n#if defined(ESP8266)|| defined(ESP32) || defined(AVR)\r\n#include &lt;EEPROM.h&gt;\r\n#endif\r\n\r\n\/\/pins:\r\nconst int HX711_dout = 4; \/\/mcu &gt; HX711 dout pin\r\nconst int HX711_sck = 5; \/\/mcu &gt; HX711 sck pin\r\n\r\n\/\/HX711 constructor:\r\nHX711_ADC LoadCell(HX711_dout, HX711_sck);\r\n\r\nconst int calVal_eepromAdress = 0;\r\nunsigned long t = 0;\r\n\r\nvoid setup() {\r\n  Serial.begin(57600); delay(10);\r\n  Serial.println();\r\n  Serial.println(\"Starting...\");\r\n\r\n  LoadCell.begin();\r\n  \/\/LoadCell.setReverseOutput(); \/\/uncomment to turn a negative output value to positive\r\n  unsigned long stabilizingtime = 2000; \/\/ preciscion right after power-up can be improved by adding a few seconds of stabilizing time\r\n  boolean _tare = true; \/\/set this to false if you don't want tare to be performed in the next step\r\n  LoadCell.start(stabilizingtime, _tare);\r\n  if (LoadCell.getTareTimeoutFlag() || LoadCell.getSignalTimeoutFlag()) {\r\n    Serial.println(\"Timeout, check MCU&gt;HX711 wiring and pin designations\");\r\n    while (1);\r\n  }\r\n  else {\r\n    LoadCell.setCalFactor(1.0); \/\/ user set calibration value (float), initial value 1.0 may be used for this sketch\r\n    Serial.println(\"Startup is complete\");\r\n  }\r\n  while (!LoadCell.update());\r\n  calibrate(); \/\/start calibration procedure\r\n}\r\n\r\nvoid loop() {\r\n  static boolean newDataReady = 0;\r\n  const int serialPrintInterval = 0; \/\/increase value to slow down serial print activity\r\n\r\n  \/\/ check for new data\/start next conversion:\r\n  if (LoadCell.update()) newDataReady = true;\r\n\r\n  \/\/ get smoothed value from the dataset:\r\n  if (newDataReady) {\r\n    if (millis() &gt; t + serialPrintInterval) {\r\n      float i = LoadCell.getData();\r\n      Serial.print(\"Load_cell output val: \");\r\n      Serial.println(i);\r\n      newDataReady = 0;\r\n      t = millis();\r\n    }\r\n  }\r\n\r\n  \/\/ receive command from serial terminal\r\n  if (Serial.available() &gt; 0) {\r\n    char inByte = Serial.read();\r\n    if (inByte == 't') LoadCell.tareNoDelay(); \/\/tare\r\n    else if (inByte == 'r') calibrate(); \/\/calibrate\r\n    else if (inByte == 'c') changeSavedCalFactor(); \/\/edit calibration value manually\r\n  }\r\n\r\n  \/\/ check if last tare operation is complete\r\n  if (LoadCell.getTareStatus() == true) {\r\n    Serial.println(\"Tare complete\");\r\n  }\r\n\r\n}\r\n\r\nvoid calibrate() {\r\n  Serial.println(\"***\");\r\n  Serial.println(\"Start calibration:\");\r\n  Serial.println(\"Place the load cell an a level stable surface.\");\r\n  Serial.println(\"Remove any load applied to the load cell.\");\r\n  Serial.println(\"Send 't' from serial monitor to set the tare offset.\");\r\n\r\n  boolean _resume = false;\r\n  while (_resume == false) {\r\n    LoadCell.update();\r\n    if (Serial.available() &gt; 0) {\r\n      if (Serial.available() &gt; 0) {\r\n        char inByte = Serial.read();\r\n        if (inByte == 't') LoadCell.tareNoDelay();\r\n      }\r\n    }\r\n    if (LoadCell.getTareStatus() == true) {\r\n      Serial.println(\"Tare complete\");\r\n      _resume = true;\r\n    }\r\n  }\r\n\r\n  Serial.println(\"Now, place your known mass on the loadcell.\");\r\n  Serial.println(\"Then send the weight of this mass (i.e. 100.0) from serial monitor.\");\r\n\r\n  float known_mass = 0;\r\n  _resume = false;\r\n  while (_resume == false) {\r\n    LoadCell.update();\r\n    if (Serial.available() &gt; 0) {\r\n      known_mass = Serial.parseFloat();\r\n      if (known_mass != 0) {\r\n        Serial.print(\"Known mass is: \");\r\n        Serial.println(known_mass);\r\n        _resume = true;\r\n      }\r\n    }\r\n  }\r\n\r\n  LoadCell.refreshDataSet(); \/\/refresh the dataset to be sure that the known mass is measured correct\r\n  float newCalibrationValue = LoadCell.getNewCalibration(known_mass); \/\/get the new calibration value\r\n\r\n  Serial.print(\"New calibration value has been set to: \");\r\n  Serial.print(newCalibrationValue);\r\n  Serial.println(\", use this as calibration value (calFactor) in your project sketch.\");\r\n  Serial.print(\"Save this value to EEPROM adress \");\r\n  Serial.print(calVal_eepromAdress);\r\n  Serial.println(\"? y\/n\");\r\n\r\n  _resume = false;\r\n  while (_resume == false) {\r\n    if (Serial.available() &gt; 0) {\r\n      char inByte = Serial.read();\r\n      if (inByte == 'y') {\r\n#if defined(ESP8266)|| defined(ESP32)\r\n        EEPROM.begin(512);\r\n#endif\r\n        EEPROM.put(calVal_eepromAdress, newCalibrationValue);\r\n#if defined(ESP8266)|| defined(ESP32)\r\n        EEPROM.commit();\r\n#endif\r\n        EEPROM.get(calVal_eepromAdress, newCalibrationValue);\r\n        Serial.print(\"Value \");\r\n        Serial.print(newCalibrationValue);\r\n        Serial.print(\" saved to EEPROM address: \");\r\n        Serial.println(calVal_eepromAdress);\r\n        _resume = true;\r\n\r\n      }\r\n      else if (inByte == 'n') {\r\n        Serial.println(\"Value not saved to EEPROM\");\r\n        _resume = true;\r\n      }\r\n    }\r\n  }\r\n\r\n  Serial.println(\"End calibration\");\r\n  Serial.println(\"***\");\r\n  Serial.println(\"To re-calibrate, send 'r' from serial monitor.\");\r\n  Serial.println(\"For manual edit of the calibration value, send 'c' from serial monitor.\");\r\n  Serial.println(\"***\");\r\n}\r\n\r\nvoid changeSavedCalFactor() {\r\n  float oldCalibrationValue = LoadCell.getCalFactor();\r\n  boolean _resume = false;\r\n  Serial.println(\"***\");\r\n  Serial.print(\"Current value is: \");\r\n  Serial.println(oldCalibrationValue);\r\n  Serial.println(\"Now, send the new value from serial monitor, i.e. 696.0\");\r\n  float newCalibrationValue;\r\n  while (_resume == false) {\r\n    if (Serial.available() &gt; 0) {\r\n      newCalibrationValue = Serial.parseFloat();\r\n      if (newCalibrationValue != 0) {\r\n        Serial.print(\"New calibration value is: \");\r\n        Serial.println(newCalibrationValue);\r\n        LoadCell.setCalFactor(newCalibrationValue);\r\n        _resume = true;\r\n      }\r\n    }\r\n  }\r\n  _resume = false;\r\n  Serial.print(\"Save this value to EEPROM adress \");\r\n  Serial.print(calVal_eepromAdress);\r\n  Serial.println(\"? y\/n\");\r\n  while (_resume == false) {\r\n    if (Serial.available() &gt; 0) {\r\n      char inByte = Serial.read();\r\n      if (inByte == 'y') {\r\n#if defined(ESP8266)|| defined(ESP32)\r\n        EEPROM.begin(512);\r\n#endif\r\n        EEPROM.put(calVal_eepromAdress, newCalibrationValue);\r\n#if defined(ESP8266)|| defined(ESP32)\r\n        EEPROM.commit();\r\n#endif\r\n        EEPROM.get(calVal_eepromAdress, newCalibrationValue);\r\n        Serial.print(\"Value \");\r\n        Serial.print(newCalibrationValue);\r\n        Serial.print(\" saved to EEPROM address: \");\r\n        Serial.println(calVal_eepromAdress);\r\n        _resume = true;\r\n      }\r\n      else if (inByte == 'n') {\r\n        Serial.println(\"Value not saved to EEPROM\");\r\n        _resume = true;\r\n      }\r\n    }\r\n  }\r\n  Serial.println(\"End change calibration value\");\r\n  Serial.println(\"***\");\r\n}<\/pre>\r\n<p>\u00a0<\/p>\r\n<\/div>\r\n\n<p>Start the sketch and open the serial monitor. Wait until the following message is displayed:<\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"349\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_1.png\" alt=\"Carriage calibration on the serial monitor\" class=\"wp-image-15485\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_1.png 767w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_1-300x137.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/a><figcaption class=\"wp-element-caption\">Balance calibration on the serial monitor, input of the known weight<\/figcaption><\/figure>\n\n<p>Then take the weight, put it on the scale, enter the weight in grams and press Enter or click on Send. Write down the &#8220;calibration value&#8221; or have it written in the EEPROM of the Arduino UNO. The balance is now calibrated and provides the weight.<\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"349\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_2.png\" alt=\"Result of the balance calibration\" class=\"wp-image-15487\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_2.png 767w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/calib_output_2-300x137.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/a><figcaption class=\"wp-element-caption\">Result of the balance calibration<\/figcaption><\/figure>\n\n<p>If the weight drifts a little, then repeat the calibration and try a longer &#8220;stabilizing time&#8221; (line 145).&nbsp;&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"682\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-1024x682.jpg\" alt=\"Regular operation on the PC\" class=\"wp-image-5660\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-1024x682.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-300x200.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-768x512.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-1536x1023.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker-1320x879.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_Zucker.jpg 1800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">My &#8220;calibration measure&#8221;<\/figcaption><\/figure>\n\n<h3 class=\"wp-block-heading\">Regular operation of the HX711 balance<\/h3>\n\n<p>After calibrating the scale, you can now go into regular operation. The sketch &#8220;Read_1x_load_cell.ino&#8221; is a good starting point for this. You only have to enter your calibration factor in line 44 or &#8211; if you have it in the EEPROM &#8211; uncomment line 48. Otherwise, the sketch works &#8220;out of the box&#8221;. If you are using an ESP8266, you will also need to uncomment on line 46.<\/p>\r\n<p>For the tare, you enter a &#8220;t&#8221; in the serial monitor.<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"Read_1x_load_cell.ino\" data-enlighter-title=\"Read_1x_load_cell.ino\">\/*\r\n   -------------------------------------------------------------------------------------\r\n   HX711_ADC\r\n   Arduino library for HX711 24-Bit Analog-to-Digital Converter for Weight Scales\r\n   Olav Kallhovd sept2017\r\n   -------------------------------------------------------------------------------------\r\n*\/\r\n\r\n\/*\r\n   Settling time (number of samples) and data filtering can be adjusted in the config.h file\r\n   For calibration and storing the calibration value in eeprom, see example file \"Calibration.ino\"\r\n\r\n   The update() function checks for new data and starts the next conversion. In order to acheive maximum effective\r\n   sample rate, update() should be called at least as often as the HX711 sample rate; &gt;10Hz@10SPS, &gt;80Hz@80SPS.\r\n   If you have other time consuming code running (i.e. a graphical LCD), consider calling update() from an interrupt routine,\r\n   see example file \"Read_1x_load_cell_interrupt_driven.ino\".\r\n\r\n   This is an example sketch on how to use this library\r\n*\/\r\n\r\n#include &lt;HX711_ADC.h&gt;\r\n#if defined(ESP8266)|| defined(ESP32) || defined(AVR)\r\n#include &lt;EEPROM.h&gt;\r\n#endif\r\n\r\n\/\/pins:\r\nconst int HX711_dout = 4; \/\/mcu &gt; HX711 dout pin\r\nconst int HX711_sck = 5; \/\/mcu &gt; HX711 sck pin\r\n\r\n\/\/HX711 constructor:\r\nHX711_ADC LoadCell(HX711_dout, HX711_sck);\r\n\r\nconst int calVal_eepromAdress = 0;\r\nunsigned long t = 0;\r\n\r\nvoid setup() {\r\n  Serial.begin(57600); delay(10);\r\n  Serial.println();\r\n  Serial.println(\"Starting...\");\r\n\r\n  LoadCell.begin();\r\n  \/\/LoadCell.setReverseOutput(); \/\/uncomment to turn a negative output value to positive\r\n  float calibrationValue; \/\/ calibration value (see example file \"Calibration.ino\")\r\n  calibrationValue = 887.24; \/\/ uncomment this if you want to set the calibration value in the sketch\r\n#if defined(ESP8266)|| defined(ESP32)\r\n  \/\/EEPROM.begin(512); \/\/ uncomment this if you use ESP8266\/ESP32 and want to fetch the calibration value from eeprom\r\n#endif\r\n  \/\/EEPROM.get(calVal_eepromAdress, calibrationValue); \/\/ uncomment this if you want to fetch the calibration value from eeprom\r\n\r\n  unsigned long stabilizingtime = 2000; \/\/ preciscion right after power-up can be improved by adding a few seconds of stabilizing time\r\n  boolean _tare = true; \/\/set this to false if you don't want tare to be performed in the next step\r\n  LoadCell.start(stabilizingtime, _tare);\r\n  if (LoadCell.getTareTimeoutFlag()) {\r\n    Serial.println(\"Timeout, check MCU&gt;HX711 wiring and pin designations\");\r\n    while (1);\r\n  }\r\n  else {\r\n    LoadCell.setCalFactor(calibrationValue); \/\/ set calibration value (float)\r\n    Serial.println(\"Startup is complete\");\r\n  }\r\n}\r\n\r\nvoid loop() {\r\n  static boolean newDataReady = 0;\r\n  const int serialPrintInterval = 0; \/\/increase value to slow down serial print activity\r\n\r\n  \/\/ check for new data\/start next conversion:\r\n  if (LoadCell.update()) newDataReady = true;\r\n\r\n  \/\/ get smoothed value from the dataset:\r\n  if (newDataReady) {\r\n    if (millis() &gt; t + serialPrintInterval) {\r\n      float i = LoadCell.getData();\r\n      Serial.print(\"Load_cell output val: \");\r\n      Serial.println(i);\r\n      newDataReady = 0;\r\n      t = millis();\r\n    }\r\n  }\r\n\r\n  \/\/ receive command from serial terminal, send 't' to initiate tare operation:\r\n  if (Serial.available() &gt; 0) {\r\n    char inByte = Serial.read();\r\n    if (inByte == 't') LoadCell.tareNoDelay();\r\n  }\r\n\r\n  \/\/ check if last tare operation is complete:\r\n  if (LoadCell.getTareStatus() == true) {\r\n    Serial.println(\"Tare complete\");\r\n  }\r\n}<\/pre>\r\n<p> <\/p>\r\n<\/div>\r\n\n<p>Maybe you don&#8217;t want to tare the balance when you switch it on? Then, in line 48, change the value of _tare to false. You will then get a &#8220;fantasy value&#8221; as a measurement result. Write down this value and subtract it from future measurement results. You have frozen the tare, so to speak. <\/p>\r\n<p>I then tested the HX711 based balance against my kitchen balance&#8230;. <\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"705\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-1024x705.jpg\" alt=\"It's coming up: my kitchen scales...\" class=\"wp-image-5665\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-1024x705.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-300x206.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-768x528.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-1536x1057.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage-1320x908.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_Standardwaage.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">It&#8217;s coming up: my kitchen scales&#8230;<\/figcaption><\/figure>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"693\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-1024x693.jpg\" alt=\"... against the self-built HX711 construction. \" class=\"wp-image-5666\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-1024x693.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-300x203.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-768x520.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-1536x1040.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage-1320x894.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Nutella_HX711_Waage.jpg 1690w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">&#8230; against the self-built HX711 construction.<\/figcaption><\/figure>\n\n<p>&#8230; and the results were right on the gram!<a id=\"oled_ausgabe\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">Output via an OLED display<\/h2>\n\n<p>To make the scale independent of the PC, you need an output medium. I have selected a small OLED display that requires only a few milliamperes of power. It is controlled via I2C using the libraries <a href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\" rel=\"noopener noreferrer\">Adafruit GFX<\/a> and <a href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\" target=\"_blank\" rel=\"noopener noreferrer\">Adafruit SSD1306.<\/a> If you want to do the same, you can download the Github libraries from the links or install them via the library manager of the Arduino IDE. I do not go into the details here because that would go beyond the scope. In addition, you might want to use completely different displays or seven-segment displays.<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-1024x420.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"420\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-1024x420.png\" alt=\"Output via a TFT display\" class=\"wp-image-15489\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-1024x420.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-300x123.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-768x315.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display-1320x541.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/HX711_Waage_mit_Display.png 1329w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Output via a TFT display<\/figcaption><\/figure>\n\n<p>A few notes on the following sketch. To display the weight, the function <code>dtostrf(in, min_width, digits_after_decimal, out)<\/code> is used. It allows to create a string (out) from float or integer values (in). The parameter <code>min_width<\/code> is the minimum width and <code>digits_after_decimal<\/code> sets the number of digits after the decimal. Actually, <code>dtostrf()<\/code> would also process the weight variable directly. However, my detour via the conversion into an integer prevents the display from constantly swinging back and forth between &#8220;0&#8221; and &#8220;-0&#8221; after a tare.<\/p>\r\n<p>Tare measurements are requested via interrupts at pin 2. The interrupt is triggered by a button. When the button is pressed, the variable <code>taraRequest<\/code> turns true and thus a tare measurement is initiated in the main loop. During tare measurement, the balance outputs &#8220;Wait&#8221; on the display.&nbsp;<\/p>\r\n<p>The rest of the sketch should be reasonably self-explanatory (of course, everyone claims that for their code&#8230;). If you have questions, ask!<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"balance_with_tft_display.ino\" data-enlighter-title=\"balance_with_tft_display.ino\">#include &lt;Wire.h&gt;\r\n#include &lt;HX711_ADC.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n#include &lt;Adafruit_SSD1306.h&gt;\r\n\r\n#define OLED_RESET -1 \/\/ we don't have a reset, but the constructor expects it\r\n#define SCREEN_WIDTH 128 \/\/ OLED display width, in pixels\r\n#define SCREEN_HEIGHT 32\r\n\r\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, OLED_RESET);\r\nHX711_ADC LoadCell(4, 5);\r\n\r\nbyte interruptPin=2;\r\nvolatile bool taraRequest = false;\r\n\r\nvoid setup()   {                \r\n  pinMode(interruptPin, INPUT);\r\n  attachInterrupt(digitalPinToInterrupt(interruptPin), taraEvent, RISING);\r\n  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  \/\/ initialize with the I2C addr 0x3C (for the 128x64)\r\n  display.clearDisplay();\r\n  display.setTextSize(4);\r\n  display.setTextColor(WHITE);\r\n  display.setCursor(10,4);\r\n  display.println(\"Wait\");\r\n  display.display();\r\n  LoadCell.begin();\r\n  LoadCell.start(2000); \r\n  LoadCell.setCalFactor(883.24); \r\n}\r\n\r\n\r\nvoid loop() {\r\n  float weightAsFloat = 0.0;\r\n  static unsigned long t = 0;\r\n  \r\n  LoadCell.update();\r\n  \r\n  if (millis() &gt; t + 250) {\r\n    weightAsFloat = LoadCell.getData();\r\n    displayWeight(weightAsFloat);\r\n    t = millis();  \r\n  }\r\n  if(taraRequest){\r\n    doTara();\r\n    taraRequest = false;\r\n  }\r\n}\r\n\r\nvoid displayWeight(float weight){\r\n  char weightAsString[6] = {0}; \/\/ sign (-) + 4 digits + Null character = 6\r\n  dtostrf(weight,5,0,weightAsString);\r\n  display.clearDisplay();\r\n  display.setCursor(0,4);\r\n  display.println(weightAsString);\r\n  display.display();\r\n}\r\n\r\nvoid doTara(){\r\n  LoadCell.tareNoDelay();\r\n  display.clearDisplay();\r\n  display.setCursor(10,4);\r\n  display.println(\"Wait\");\r\n  display.display();\r\n  while(LoadCell.getTareStatus()== false){\r\n    LoadCell.update();\r\n    delay(50);\r\n  }\r\n}\r\n\r\n\/\/ IRAM_ATTR void taraEvent(){ for ESP32 \/ ESP8266\r\nvoid taraEvent(){\r\n  taraRequest = true;\r\n}<\/pre>\r\n<p>\u00a0<\/p>\r\n<\/div>\r\n\n<p>Here&#8217;s what it looks like:<a id=\"schlafen_schicken\"><\/a><\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"614\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-1024x614.jpg\" alt=\"HX711 balance with OLED display and tare button\" class=\"wp-image-5676\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-1024x614.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-300x180.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-768x460.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-1536x921.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display-1320x791.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Display.jpg 1800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">OLED display and tare button<\/figcaption><\/figure>\n\n<h2 class=\"wp-block-heading\">The next evolutionary step: The scale goes to sleep<\/h2>\n\n<p>Then I wanted the scale and its components to go into standby mode when there is no change in weight or a new tare measurement being requested for some time. Since the Arduino UNO still consumes a lot of power in sleep mode (see my penultimate post about <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/sleep-modes-and-power-management\" target=\"_blank\" rel=\"noopener noreferrer\">Sleep Modes<\/a>), I used the bare ATmega328P here. I have described <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/sleep-modes-and-power-management\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> how to program the ATmega328P with the Arduino IDE. The circuit for this is as follows:&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"601\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett-1024x601.png\" alt=\"Complete circuit for the scale with display and tare button\" class=\"wp-image-5682\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett-1024x601.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett-300x176.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett-768x451.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett-1320x775.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_am_328P_komplett.png 1460w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Complete circuit for the scale with display and tare button<\/figcaption><\/figure>\n\n<p>In the sketch for this variant, I introduced the variable <code>lastWeightAsFloat<\/code> that stores the value of the last measurement. This value is compared to the current result. As long as the last and the current weight differ (difference &lt; 1 g), the balance is obviously busy. And during that time the variable <code>tLastChange<\/code> is repeatedly updated to <code>millis<\/code>&nbsp;. The same happens during tare measurement. Once per main loop <code>tLastChange<\/code> is being compared with <code>millis<\/code>&nbsp;. If the difference exceeds 120,000 (= 2 min), the balance is sent to sleep. First the display is switched off, then the HX711 module and finally the ATmega328P is put into deep sleep mode.<\/p>\r\n<p>An interrupt awakens the ATmega328P. Since the button for tare measurement triggers an interrupt, it also acts as awake-up function.<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"balance_with_sleep_mode.ino\" data-enlighter-title=\"balance_with_sleep_mode.ino\">#include &lt;Wire.h&gt;\r\n#include &lt;HX711_ADC.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n#include &lt;Adafruit_SSD1306.h&gt;\r\n#include &lt;avr\/sleep.h&gt;\r\n\r\n#define OLED_RESET -1 \/\/ we don't have a reset, but the constructor expects it \r\n#define SCREEN_WIDTH 128 \/\/ OLED display width, in pixels\r\n#define SCREEN_HEIGHT 32\r\n\r\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, OLED_RESET);\r\nHX711_ADC LoadCell(4, 5);\r\n\r\nint interruptPin = 2;   \/\/ tara and wake-up pin \r\nint powerOnPin = 6;\r\nvolatile bool taraRequest = false;\r\nfloat weightAsFloat = 0.0; \/\/ current weight (as float)\r\nfloat lastWeightAsFloat = 9999.0;  \/\/ former weight\r\nunsigned long t = 0;    \/\/ system time of last weight measurement \r\nunsigned long tLastChange = 0;  \/\/ system time of last change of weight\r\n\r\nvoid setup()   {  \r\n  pinMode(interruptPin, INPUT);\r\n  pinMode(powerOnPin, OUTPUT);\r\n  digitalWrite(powerOnPin, HIGH);\r\n  initBalance();\r\n  attachInterrupt(digitalPinToInterrupt(interruptPin), taraEvent, RISING);\r\n}\r\n\r\nvoid loop() {\r\n  LoadCell.update();\r\n  \/* In one loop a) measurement is done or b) a tara or c) the balance will be send to sleep\r\n  or d) nothing happens *\/\r\n  if (millis() &gt; (t + 250)) {\r\n    weightAsFloat = LoadCell.getData();\r\n    displayWeight(weightAsFloat);\r\n    if(abs(weightAsFloat-lastWeightAsFloat) &gt;=1){\r\n      tLastChange = millis();\r\n      lastWeightAsFloat = weightAsFloat;  \r\n    }\r\n    t = millis();\r\n  }\r\n  \r\n  if(taraRequest){\r\n    doTara();\r\n    taraRequest = false;\r\n  }\r\n  \r\n  if(millis() &gt; (tLastChange + 120000)){ \/\/ after 2 min of no weight change or tara the balance shall fall asleep\r\n    sleepAndWakeUp();\r\n  }\r\n}\r\n\r\nvoid initBalance(){\r\n  taraRequest = false;\r\n  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  \/\/ initialize with the I2C addr 0x3C (for the 128x64)\r\n  display.clearDisplay();\r\n  display.setTextSize(4);\r\n  display.setTextColor(WHITE);\r\n  display.setCursor(10,4);\r\n  display.println(\"Wait\");\r\n  display.display();\r\n  LoadCell.begin();\r\n  LoadCell.start(2000); \r\n  LoadCell.setCalFactor(883.24); \r\n  weightAsFloat = 0.0;\r\n  lastWeightAsFloat = 9999.0;\r\n  t = 0;\r\n}\r\n\r\nvoid displayWeight(float weight){\r\n  char weightAsString[6] = {0};\r\n  dtostrf(weight,5,0,weightAsString);\r\n  display.clearDisplay();\r\n  display.setCursor(0,4);\r\n  display.println(weightAsString);\r\n  display.display();\r\n}\r\n\r\nvoid doTara(){    \/\/ tara\r\n  LoadCell.tareNoDelay();\r\n  display.clearDisplay();\r\n  display.setCursor(10,4);\r\n  display.println(\"Wait\");\r\n  display.display();\r\n  while(LoadCell.getTareStatus()== false){\r\n    LoadCell.update();\r\n    delay(50);\r\n  }\r\n  tLastChange = millis();\r\n}\r\n\r\nvoid taraEvent(){\r\n  taraRequest = true;\r\n}\r\n\r\nvoid sleepAndWakeUp(){\r\n  LoadCell.powerDown();            \/\/ switch off HX711\r\n  display.ssd1306_command(SSD1306_DISPLAYOFF);\r\n  set_sleep_mode(SLEEP_MODE_PWR_DOWN);  \/\/ deep sleep mode\r\n  cli();\r\n  sleep_enable();\r\n  sleep_bod_disable(); \/\/ disable brown-out detector\r\n  sei();\r\n  sleep_cpu();\r\n  \/* ATmega328P sleeps *\/\r\n  sleep_disable();\r\n  LoadCell.powerUp();            \/\/ switch on HX711\r\n  display.ssd1306_command(SSD1306_DISPLAYON);\r\n  initBalance();\r\n}<\/pre>\r\n<p>\u00a0<\/p>\r\n<\/div>\r\n\n<p>With this setup, I have measured a power consumption of 139 microamperes in sleep mode. That&#8217;s 3.3 milliampere hours per day. So a battery should last for some time.<a id=\"ganz_ausschalten\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">Turn off the balance completely<\/h2>\n\n<p>Then I thought about how to turn off the scale completely without installing an additional switch (because everyone can!). Strictly speaking, the question is how the scale can turn itself off.<\/p>\r\n<p>I solved the task with a <a href=\"https:\/\/de.wikipedia.org\/wiki\/Thyristor\" target=\"_blank\" rel=\"noopener noreferrer\">thyristor<\/a>. A thyristor has some similarities with a transistor. It has three connections, namely the cathode, the anode and the gate. A small current pulse at the gate opens the connection from anode to cathode. Unlike the transistor, the thyristor remains conductive as long as the current does not fall below a certain threshold. The <a href=\"https:\/\/datasheet.octopart.com\/MCR100-6G-ON-Semiconductor-datasheet-9729370.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">MCR100-6<\/a> I used has a typical threshold of 0.5 milliamperes. Since the power consumption in sleep mode is much lower, the thyristor locks. The thyristor is &#8220;ignited&#8221; when the tare button is pressed. This is what the circuit looks like:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"702\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom-1024x702.png\" alt=\"Circuit for the HX711 balance with automatic shutdown\" class=\"wp-image-5685\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom-1024x702.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom-300x206.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom-768x527.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom-1320x905.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Waage_mit_Null_Strom.png 1426w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Circuit for the balance with automatic shutdown<\/figcaption><\/figure>\n\n<p>But there was a problem: As long as the thyristor is open, the voltage at gate remains high. Since we have a connection to the tare function, the voltage at the interrupt pin remains also high (orange line). This means that the tare request no longer works. That&#8217;s why I&#8217;ve installed a diode that blocks the way in that direction.<\/p>\r\n<p>You can use the previous sketch. Lines 122 to 125, i.e. the actions after the wake-up, are of course never executed and can be deleted accordingly.&nbsp;<\/p>\r\n<p>When designing the power supply, it should be noted that about 0.8 volts fall off the thyristor. Accordingly, less voltage is available to the components. With 5 volt power supply, this is no problem for the components used here.&nbsp;<\/p>\r\n\n<h2 class=\"wp-block-heading\">Acknowledgement<\/h2>\n\n<p>I would like to thank <a href=\"https:\/\/github.com\/olkal\" target=\"_blank\" rel=\"noopener noreferrer\">Olav Kallhovd<\/a> for his great library. The libraries of <a href=\"https:\/\/www.adafruit.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Adafruit<\/a> helped me control the display. <\/p>\r\n<p>I owe the scales on the post picture to <a href=\"https:\/\/pixabay.com\/de\/users\/Gellinger-201217\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2026222\" target=\"_blank\" rel=\"noopener noreferrer\">Gerhard Gellinger<\/a> on <a href=\"https:\/\/pixabay.com\/de\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2026222\" target=\"_blank\" rel=\"noopener noreferrer\">Pixabay.<\/a> I have used the Arduino in the background several times. It comes from <a href=\"https:\/\/pixabay.com\/de\/users\/Seven_au-4857820\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2168193\" target=\"_blank\" rel=\"noopener noreferrer\">Seven_au<\/a> on <a href=\"https:\/\/pixabay.com\/de\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2168193\" target=\"_blank\" rel=\"noopener noreferrer\">Pixabay<\/a>. <\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to install an automatic shut-off system. <\/p>\n","protected":false},"author":1,"featured_media":8461,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[571,572],"tags":[1116,1117,1123,1107,1114,1121],"class_list":["post-10253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-sensors","tag-balance-en","tag-calibration","tag-hx711-en-3","tag-hx711-adc-library-2","tag-load-cell","tag-turn-off-the-balance-completely-en-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HX711 based balance &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HX711 based balance &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-14T22:15:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-30T18:12:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1300\" \/>\n\t<meta property=\"og:image:height\" content=\"1300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"HX711 based balance\",\"datePublished\":\"2020-12-14T22:15:23+00:00\",\"dateModified\":\"2025-01-30T18:12:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance\"},\"wordCount\":1828,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/Beitrag.jpg\",\"keywords\":[\"balance\",\"Calibration\",\"HX711\",\"HX711 ADC library\",\"load cell\",\"turn off the balance completely\"],\"articleSection\":[\"Projects\",\"Sensors\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance\",\"name\":\"HX711 based balance &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/Beitrag.jpg\",\"datePublished\":\"2020-12-14T22:15:23+00:00\",\"dateModified\":\"2025-01-30T18:12:26+00:00\",\"description\":\"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/Beitrag.jpg\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/Beitrag.jpg\",\"width\":1300,\"height\":1300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/hx711-based-balance#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HX711 based balance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HX711 based balance &#8226; Wolles Elektronikkiste","description":"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance","og_locale":"en_US","og_type":"article","og_title":"HX711 based balance &#8226; Wolles Elektronikkiste","og_description":"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance","og_site_name":"Wolles Elektronikkiste","article_published_time":"2020-12-14T22:15:23+00:00","article_modified_time":"2025-01-30T18:12:26+00:00","og_image":[{"width":1300,"height":1300,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg","type":"image\/jpeg"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"HX711 based balance","datePublished":"2020-12-14T22:15:23+00:00","dateModified":"2025-01-30T18:12:26+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance"},"wordCount":1828,"commentCount":4,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg","keywords":["balance","Calibration","HX711","HX711 ADC library","load cell","turn off the balance completely"],"articleSection":["Projects","Sensors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance","url":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance","name":"HX711 based balance &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg","datePublished":"2020-12-14T22:15:23+00:00","dateModified":"2025-01-30T18:12:26+00:00","description":"With an HX711 module and a load cell, you can easily build an astonishingly precise balance. I also show you how to include an automatic shut-off system.","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/03\/Beitrag.jpg","width":1300,"height":1300},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/hx711-based-balance#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"HX711 based balance"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/10253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=10253"}],"version-history":[{"count":2,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/10253\/revisions"}],"predecessor-version":[{"id":23052,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/10253\/revisions\/23052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/8461"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=10253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=10253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=10253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}