{"id":1637,"date":"2023-08-16T19:26:18","date_gmt":"2023-08-16T16:26:18","guid":{"rendered":"http:\/\/arduinolab.pw\/?p=1637"},"modified":"2026-07-14T10:06:30","modified_gmt":"2026-07-14T07:06:30","slug":"datchik-temperatury-i-vlazhnosti-htu21d","status":"publish","type":"post","link":"https:\/\/arduinolab.pw\/index.php\/2023\/08\/16\/datchik-temperatury-i-vlazhnosti-htu21d\/","title":{"rendered":"\u0414\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 HTU21D"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u041d\u0435\u0434\u043e\u0440\u043e\u0433\u043e\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0432\u044b\u0441\u043e\u043a\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">\u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b: \u043e\u0442 -40 \u0434\u043e +125 \u00b0C<\/li>\n\n\n\n<li>\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438: \u043e\u0442 0 \u0434\u043e 100% RH<\/li>\n\n\n\n<li>\u0421\u0432\u044f\u0437\u044c: I\u00b2C. \u0430\u0434\u0440\u0435\u0441 0x40.<\/li>\n\n\n\n<li>\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435: 14 Bit.<\/li>\n\n\n\n<li>\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u00b12% (\u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f)<\/li>\n\n\n\n<li>\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u00b10,3 \u00b0C (\u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f)<\/li>\n\n\n\n<li>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u0431\u0430\u0442\u0430\u0440\u0435\u0438 (\u0444\u043b\u0430\u0433, \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0436\u0435 2.25 \u0412)  <\/li>\n\n\n\n<li>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0433\u0440\u0435\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438: 5.5mW\/\u0394T=+0.5-1.5\u00b0C<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u042d\u043b\u0435\u043a\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:<\/td><td>\u043c\u0438\u043d.<\/td><td>\u0442\u0438\u043f.<\/td><td>\u043c\u0430\u043a\u0441.<\/td><td>\ufeff<\/td><\/tr><tr><td>\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f<\/td><td>1.5<\/td><td>3.0<\/td><td>3.6<\/td><td>\u0412<\/td><\/tr><tr><td>\u041f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f<\/td><td>300<\/td><td>450<\/td><td>500<\/td><td>\u03bcA<\/td><\/tr><tr><td>\u041f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u043f\u044f\u0449\u0435\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/td><td>\ufeff<\/td><td>0.02<\/td><td>2.0<\/td><td>\u03bcA<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0442\u0447\u0438\u043a 3,3 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u0439, \u043d\u043e \u0442\u043e\u043b\u0435\u0440\u0430\u043d\u0442\u043d\u044b\u0439 \u043a 5 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u044f\u043c. \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a 5 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u043e\u0439 arduino, \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u043b\u0430\u0442\u0435.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0420\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">\u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0442 SparkFun \u0438 \u0435\u0433\u043e \u043a\u043b\u043e\u043d\u044b (HW-220):<\/h4>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/HTU21D.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"219\" src=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/HTU21D-300x219.png\" alt=\"\" class=\"wp-image-1869\" srcset=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/HTU21D-300x219.png 300w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/HTU21D-624x456.png 624w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/HTU21D.png 763w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 SHT20 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u043e\u043c. \u041c\u043e\u0434\u0443\u043b\u044c 3.3 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u0439, \u0431\u0435\u0437 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u044b, \u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0437\u0430\u043f\u0430\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u044b\u0447\u043a\u0443 \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043d\u0443\u0436\u043d\u0430.  <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">GY-21:<\/h4>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"219\" src=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff-300x219.png\" alt=\"\" class=\"wp-image-1871\" srcset=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff-300x219.png 300w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff-768x562.png 768w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff-624x457.png 624w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/ff.png 954w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">\u041c\u043e\u0434\u0443\u043b\u044c \u0441 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u0439, \u0442\u0430\u043a \u0436\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u043e\u043c. \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0438 \u0441\u0442\u0430\u0431 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u043b\u0430\u0442\u044b. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f 5 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u0445 \u043f\u043b\u0430\u0442.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0445\u0435\u043c\u0430:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original-300x225.jpg\" alt=\"\" class=\"wp-image-1873\" srcset=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original-300x225.jpg 300w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original-768x576.jpg 768w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original-624x468.jpg 624w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/22281_original.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043a Arduino:<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"226\" src=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2-300x226.jpg\" alt=\"\" class=\"wp-image-1872\" srcset=\"https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2-300x226.jpg 300w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2-768x578.jpg 768w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2-624x470.jpg 624w, https:\/\/arduinolab.pw\/wp-content\/uploads\/2023\/08\/GY-21-HTU2.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u0430\u043a, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439. \u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0442 SparkFun \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 3.3 \u0432\u043e\u043b\u044c\u0442\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u043f\u043b\u0430\u0442\u0430\u043c\u0438 \u0441 ESP \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043f\u043b\u0430\u0442 Arduino, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c GY-21, \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f 5 \u0432\u043e\u043b\u044c\u0442. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u043e\u0444\u0442:<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0435\u0441\u0442\u044c \u0438 \u0438\u0445 \u043c\u043d\u043e\u0433\u043e:<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/enjoyneering\/HTU21D\" target=\"_blank\">HTU21D<\/a> <\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/sparkfun\/SparkFun_HTU21D_Breakout_Arduino_Library\" target=\"_blank\">SparkFun_HTU21D<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/adafruit\/Adafruit_HTU21DF_Library\" target=\"_blank\">Adafruit_HTU21DF<\/a>  <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Arduino IDE<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0411\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Wire.h&gt;\n\nconst int htu21_addr = 0x40; \/\/ \u0430\u0434\u0440\u0435\u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 htu21d\n\nvoid setup() {\n  Serial.begin(9600);\n  Wire.begin(); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f i2c\n}\n\nvoid loop() {\n  ReadTemperature();  \n  ReadHumidity();\n  delay(1000);\n}\n\n\/\/ \u0427\u0438\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 HTU21D \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 COM-\u043f\u043e\u0440\u0442.\nvoid ReadTemperature() {\n  Wire.beginTransmission(htu21_addr); \/\/ \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c\n  Wire.write(0xF3); \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b\n  Wire.endTransmission(); \/\/ \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438\n\n  delay(100); \/\/ \u0436\u0434\u0451\u043c \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\n  Wire.requestFrom(htu21_addr, 3); \/\/ \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 3 \u0431\u0430\u0439\u0442\u0430  \n\n  int Stemp; \/\/ \"\u0441\u044b\u0440\u044b\u0435\" \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b\n  while (Wire.available()) { \n    int tmsb = Wire.read(); \/\/ \u0447\u0438\u0442\u0430\u0435\u043c MSB \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430\n    int tlsb = Wire.read() &amp; 0xFC; \/\/ \u0447\u0438\u0442\u0430\u0435\u043c LSB \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c 2 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0431\u0438\u0442\u0430\n    int crc = Wire.read(); \/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443    \n    Stemp = tmsb * 256 + tlsb; \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Stemp\n    \/\/ *256 \u044d\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0441\u0434\u0432\u0438\u0433\u0443 \u043d\u0430 8 \u0431\u0438\u0442 \u0432\u043b\u0435\u0432\u043e: &lt;&lt;8 \n    \/\/Serial.println(Stemp, HEX);\n  }\n  double t = ConvertTemp(Stemp); \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443\n  Serial.println(\"T = \" + (String)t + \"C\"); \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 COM-\u043f\u043e\u0440\u0442\n}\n\n\/\/ \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438\u0437 \"\u0441\u044b\u0440\u044b\u0445\" \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 HTU21D \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u044b \u0426\u0435\u043b\u044c\u0441\u0438\u044f.\ndouble ConvertTemp(int stemp){\n  double t = stemp * 0.00268127 - 46.85; \/\/ 0.00268127 = 175.72\/0x10000\n  return t;\n}\n\n\/\/ \u0427\u0438\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 HTU21D \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 COM-\u043f\u043e\u0440\u0442.\nvoid ReadHumidity() {\n  Wire.beginTransmission(htu21_addr); \/\/ \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c\n  Wire.write(0xF5); \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438\n  Wire.endTransmission(); \/\/ \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438\n\n  delay(100); \/\/ \u0436\u0434\u0451\u043c \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\n  Wire.requestFrom(htu21_addr, 3); \/\/ \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 3 \u0431\u0430\u0439\u0442\u0430  \n\n  int Srh; \/\/ \"\u0441\u044b\u0440\u044b\u0435\" \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438\n  while (Wire.available()) { \n    int rmsb = Wire.read(); \/\/ \u0447\u0438\u0442\u0430\u0435\u043c MSB \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430\n    int rlsb = Wire.read() &amp; 0xFC; \/\/ \u0447\u0438\u0442\u0430\u0435\u043c LSB \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c 2 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0431\u0438\u0442\u0430\n    int crc = Wire.read(); \/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443\n    Srh = rmsb * 256 + rlsb ; \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Srh\n    \/\/Serial.println(Srh, HEX);\n  }\n  double rh = ConvertRH(Srh); \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c\n  Serial.println(\"RH = \" + (String)rh + \"%\"); \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 COM-\u043f\u043e\u0440\u0442\n}\n\n\/\/ \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \"\u0441\u044b\u0440\u044b\u0445\" \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 HTU21D \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u044b.\ndouble ConvertRH(int srh) {\n  double rh = srh * 0.0019073 - 6; \/\/ 0.0019073 = 125\/0x10000\n  return rh;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">STM8 \u0438 \u041a\u043e\u0434 \u043d\u0430 \u0421:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">.<\/p><div class=\"cakjh6ab4462be75b1\" ><hr>\n<!-- Yandex.RTB R-A-1793072-2 -->\n<div id=\"yandex_rtb_R-A-1793072-2\"><\/div>\n<script>window.yaContextCb.push(()=>{\n  Ya.Context.AdvManager.render({\n    renderTo: 'yandex_rtb_R-A-1793072-2',\n    blockId: 'R-A-1793072-2'\n  })\n})<\/script><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.cakjh6ab4462be75b1 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.cakjh6ab4462be75b1 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.cakjh6ab4462be75b1 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.cakjh6ab4462be75b1 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.cakjh6ab4462be75b1 {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0412\u0438\u0434\u0435\u043e:<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0434\u043e\u0440\u043e\u0433\u043e\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0432\u044b\u0441\u043e\u043a\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b.<\/p>\n","protected":false},"author":1,"featured_media":1870,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[7],"tags":[123,70,69],"class_list":["post-1637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-video","tag-htu21","tag-datchik-vlazhnosti","tag-datchik-temperatury"],"_links":{"self":[{"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/posts\/1637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/comments?post=1637"}],"version-history":[{"count":0,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/posts\/1637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/media\/1870"}],"wp:attachment":[{"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/media?parent=1637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/categories?post=1637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduinolab.pw\/index.php\/wp-json\/wp\/v2\/tags?post=1637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}