{"id":600,"date":"2025-07-06T22:30:43","date_gmt":"2025-07-06T20:30:43","guid":{"rendered":"https:\/\/blog.bratfisch.net\/?p=600"},"modified":"2025-07-09T23:33:08","modified_gmt":"2025-07-09T21:33:08","slug":"a-beelogger-on-esp32-basis-part-7-test-setup-the-scale-part-2","status":"publish","type":"post","link":"https:\/\/blog.bratfisch.net\/index.php\/2025\/07\/06\/a-beelogger-on-esp32-basis-part-7-test-setup-the-scale-part-2\/","title":{"rendered":"A beelogger on ESP32 basis, part 7: Test setup: The scale part 2"},"content":{"rendered":"\n<p>I built four bee-hive scales according to the <a href=\"https:\/\/beelogger.de\/stockwaage\/aufbauanleitung-double\/\" data-type=\"link\" data-id=\"https:\/\/beelogger.de\/stockwaage\/aufbauanleitung-double\/\">great instructions of the Beelogger project<\/a>.<\/p>\n\n\n\n<p>As the <a href=\"https:\/\/blog.bratfisch.net\/index.php\/2025\/06\/02\/a-beelogger-on-esp32-basis-part-3-the-scale\/\" data-type=\"link\" data-id=\"https:\/\/blog.bratfisch.net\/index.php\/2025\/06\/02\/a-beelogger-on-esp32-basis-part-3-the-scale\/\">HX711-breakout-boards are not suitable for setups with 3.3V<\/a>, I&#8217;m trying it with a NAU7802-breakout-board now.<br>It doesn&#8217;t have problems when being driven with 3.3V and should be more precise than the HX711.<br>As an additional feature it has an internal temperature sensor which could help compensating the temperature drift, sadly its esphome-component doesn&#8217;t support it (yet).<br>According to the documentation it has an external calibration mode that may only be used without load, so it cannot be used for our use case.<br>It also has an internal calibration mechanism that can be used with load, it somehow uses the internal temperature sensors&#8217; values, sadly the datasheet doesn&#8217;t say anything about how it really works.<br>The result of the internal calibration is getting read back by the esphome-component as it just sets the offset and the gain.<\/p>\n\n\n\n<p>The breakout-board <a href=\"https:\/\/www.aliexpress.com\/item\/1005008497660401.html?spm=a2g0o.productlist.main.1.5e5540803ClCeJ\" data-type=\"link\" data-id=\"https:\/\/www.aliexpress.com\/item\/1005008497660401.html?spm=a2g0o.productlist.main.1.5e5540803ClCeJ\">I bought<\/a> only exposes one ADC channel, Adafruit has an <a href=\"https:\/\/www.adafruit.com\/product\/4538\">updated version<\/a> since June 23rd, 2025<strong>&nbsp;<\/strong>that exposes both channels, but sadly I couldn&#8217;t find any way to get it in Europe yet. <br>It&#8217;s also not supported by the esphome-component (yet).<\/p>\n\n\n\n<p><br> I connected it like this:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"665\" src=\"https:\/\/blog.bratfisch.net\/wp-content\/uploads\/2025\/06\/beelogger-scale-nau7802_bb-1024x665.png\" alt=\"\" class=\"wp-image-601\" style=\"width:auto;height:300px\" srcset=\"https:\/\/blog.bratfisch.net\/wp-content\/uploads\/2025\/06\/beelogger-scale-nau7802_bb-1024x665.png 1024w, https:\/\/blog.bratfisch.net\/wp-content\/uploads\/2025\/06\/beelogger-scale-nau7802_bb-300x195.png 300w, https:\/\/blog.bratfisch.net\/wp-content\/uploads\/2025\/06\/beelogger-scale-nau7802_bb-768x498.png 768w, https:\/\/blog.bratfisch.net\/wp-content\/uploads\/2025\/06\/beelogger-scale-nau7802_bb.png 1188w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The code for the test setup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>i2c:\n  sda: GPIO4\n  scl: GPIO5\n  frequency: 400khz\n  scan: true\n\nsensor:\n  - platform: nau7802\n    name: \"NAU7802 Weight\"\n    gain: 128\n    ldo_voltage: \"3.0V\"\n    update_interval: ${update_interval}\n    filters:\n     - calibrate_linear:\n          datapoints:\n          # measuring at 25 \u00b0C\n           -  64429 -&gt; 0\n           -  166362 -&gt; 4.58    # super with empty frames + tension belt\n           -  392628 -&gt; 14.58   # super with empty frames + tension belt + 10kg\n           ...\nbutton:\n  - platform: template\n    name: \"Toggle Internal Calibration\"\n    on_press:\n      - logger.log: \"Internal calibration toggled\"\n      - nau7802.calibrate_internal_offset  <\/code><\/pre>\n\n\n\n<p>This code exposes the internal calibration via a button. The documentation says the internal calibration should be called on temperature or parameter changes, this is an open TODO as well as compensating the temperature drift.<\/p>\n\n\n\n<p>Additional new TODOs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Support for the internal temperature sensor for the NAU7802-eshome-component<\/li>\n\n\n\n<li>Support for channel B for the NAU7802-esphome-component<\/li>\n\n\n\n<li>A proper state machine for the NAU7802-esphome-component (similar to the suggestion to the HX711-component in <a href=\"https:\/\/github.com\/esphome\/esphome\/pull\/8899\">this pull-request<\/a>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I built four bee-hive scales according to the great instructions of the Beelogger project. As the HX711-breakout-boards are not suitable for setups with 3.3V, I&#8217;m trying it with a NAU7802-breakout-board now.It doesn&#8217;t have problems when being driven with 3.3V and should be more precise than the HX711.As an additional feature it has an internal temperature [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,4,5],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-beelogger","tag-esp32","tag-esphome"],"_links":{"self":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":64,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":903,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/600\/revisions\/903"}],"wp:attachment":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}