{"id":62308,"date":"2019-06-10T18:32:59","date_gmt":"2019-06-10T12:32:59","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=62308"},"modified":"2022-01-09T23:43:56","modified_gmt":"2022-01-09T17:43:56","slug":"mcp3421-%d0%b0%d1%86%d0%bf-18-bit-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=62308","title":{"rendered":"MCP3421 &#8212; \u0410\u0426\u041f 18 bit (Arduino)"},"content":{"rendered":"<p>\u041c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430 MCP3421 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microchip \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 18-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0434\u043d\u043e \u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0433\u043c\u0430-\u0434\u0435\u043b\u044c\u0442\u0430 \u0410\u0426\u041f, \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u0432 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u043e\u043c 6-\u0432\u044b\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u0435 SOT23-6 . \u0410\u0426\u041f \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044c. \u0421\u0432\u044f\u0437\u044c \u0441 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 I2C.<\/p>\n<div id=\"attachment_62310\" style=\"width: 382px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/762346632487.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-62310\" class=\"wp-image-62310 size-full\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/762346632487.png\" alt=\"\" width=\"372\" height=\"378\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/762346632487.png 372w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/762346632487-200x203.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/762346632487-45x45.png 45w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/a><p id=\"caption-attachment-62310\" class=\"wp-caption-text\">VIN+,VIN- &#8212; \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0445\u043e\u0434\u044b \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430, VSS \u0438 VDD &#8212; \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u0438\u0442\u0430\u043d\u0438\u044f, SDA, SCL \u2013 \u043b\u0438\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043b\u0438\u043d\u0438\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0448\u0438\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0445 I2C<\/p><\/div>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u043e\u0435 \u0410\u0426\u041f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u00b1 2,048 \u0412 \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044f 1, \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u0445 2, 4 \u0438 8 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u00b1 1,024 \u0412, \u00b1 0,512 \u0412 \u0438 \u00b1 0,256 \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0410\u0426\u041f \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f 18, 16, 14 \u0438 12 \u0431\u0438\u0442, \u043f\u0440\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f 3.75 SPS, 15 SPS, 60 SPS \u0438 240 SPS \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u043e\u0442\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0437\u043d\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b MCP3421 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0442 2,7 \u0434\u043e 5,5 \u0412.<\/p>\n<div id=\"marketWidget\"><\/div>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/612386283719.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62311\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/612386283719.png\" alt=\"\" width=\"154\" height=\"151\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/612386283719.png 154w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/612386283719-45x45.png 45w\" sizes=\"auto, (max-width: 154px) 100vw, 154px\" \/><\/a><\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 &#8212; <a href=\"https:\/\/github.com\/liman324\/MCP3421.git\">https:\/\/github.com\/liman324\/MCP3421.git<\/a><\/strong><\/p>\n<p style=\"text-align: center;\"><b>datasheet &#8212; <a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/MCP3421.pdf\">MCP3421.pdf<\/a><\/b><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Arduino \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0410\u0426\u041f MCP3421, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0439 \u0432\u043e\u043b\u044c\u0442\u043c\u0435\u0442\u0440, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0432\u00a0 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430:<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;Wire.h&gt;<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;MCP3421.h&gt;<\/span>\r\n  MCP3421 mcp;\r\n\u00a0\r\n  long dig;\r\n  float u;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> \r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;Wire.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  mcp.<span style=\"color: #006600;\">setConfig<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">3<\/span>,<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 12 14 16 18 bit - 0-3 \/\/ 1x 2x 4x 8x gain - 0-3<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n dig = mcp.<span style=\"color: #006600;\">readWire<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n u = dig <span style=\"color: #66cc66;\">*<\/span> <span style=\"color: #cc66cc;\">2.048<\/span> <span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">131071<\/span>;\r\n Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>dig<span style=\"color: #66cc66;\">)<\/span>;\r\n Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"  \"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>u,<span style=\"color: #cc66cc;\">6<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n <span style=\"color: #808080; font-style: italic;\">\/* 1x = 2.048V; 2x = 1.024V; 4x = 0.512V; 8x = 0.256V\r\n\u00a0\r\n 18 bit = 17 bit (dec 131071)  + 1 bit (\u043f\u043e\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f) *\/<\/span><\/pre>\n<p style=\"text-align: center;\">\u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0438\u0442\u0430\u043d\u0438\u044f 1,5 \u0412.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62312\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/8767687687687.png\" alt=\"\" width=\"612\" height=\"344\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/8767687687687.png 612w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/8767687687687-200x112.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/8767687687687-500x281.png 500w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62313\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/687568687.png\" alt=\"\" width=\"603\" height=\"344\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/687568687.png 603w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/687568687-200x114.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/687568687-500x285.png 500w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430 MCP3421 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microchip \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 18-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0434\u043d\u043e \u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0433\u043c\u0430-\u0434\u0435\u043b\u044c\u0442\u0430 \u0410\u0426\u041f, \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u0432 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u043e\u043c 6-\u0432\u044b\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u0435 SOT23-6 . \u0410\u0426\u041f \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044c. \u0421\u0432\u044f\u0437\u044c \u0441 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 I2C. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u043e\u0435 \u0410\u0426\u041f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u00b1 2,048 \u0412 \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044f 1, \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u0445 2, 4 \u0438 8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":62311,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239,17],"tags":[],"class_list":["post-62308","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-17"],"views":14086,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/62308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=62308"}],"version-history":[{"count":7,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/62308\/revisions"}],"predecessor-version":[{"id":111369,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/62308\/revisions\/111369"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/62311"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=62308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=62308"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=62308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}