{"id":11708,"date":"2023-10-02T22:12:55","date_gmt":"2023-10-02T14:12:55","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=11708"},"modified":"2024-05-05T12:31:49","modified_gmt":"2024-05-05T04:31:49","slug":"%e6%a0%91%e8%8e%93%e6%b4%be-pwm-%e8%b0%83%e9%80%9f%e9%a3%8e%e6%89%87%ef%bc%88%e7%bc%96%e8%be%91%e4%b8%ad%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=11708","title":{"rendered":"\u6811\u8393\u6d3e PWM \u8c03\u901f\u98ce\u6247"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=11708\/#%E5%89%8D%E8%A8%80\" >\u524d\u8a00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=11708\/#%E6%9D%90%E6%96%99\" >\u6750\u6599<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.iyatt.com\/?p=11708\/#%E7%BA%BF%E8%B7%AF\" >\u7ebf\u8def<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.iyatt.com\/?p=11708\/#%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0\" >\u9a71\u52a8\u7a0b\u5e8f\u5b9e\u73b0<\/a><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E5%89%8D%E8%A8%80\"><\/span>\u524d\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u6211\u7528\u7684\u662f\u6811\u8393\u6d3e cm4\uff0c\u914d\u7684\u5e95\u677f\u662f\u5fae\u96ea\u7684<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/10\/image-1696252045298.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 442px; --smush-placeholder-aspect-ratio: 442\/648;\" \/><\/p>\n<p>\u5e95\u677f\u4e0a\u6709 4 \u7ebf\u8c03\u901f\u98ce\u6247\u7684\u63d2\u53e3\uff0c\u9644\u5e26\u4e5f\u63d0\u4f9b\u4e86\u5e93 API\uff0c\u53ef\u4ee5\u8c03\u7528\u8bfb\u53d6\u98ce\u6247\u901f\u5ea6\uff0c\u4ee5\u53ca\u63a7\u5236\u98ce\u6247\u901f\u5ea6\u3002\u524d\u6bb5\u65f6\u95f4\u6ce8\u610f\u5230\u98ce\u6247\u5f00\u59cb\u4ea7\u751f\u5f02\u5e38\u566a\u97f3\uff0c\u800c\u4e14\u8f6c\u901f\u8c03\u4e0d\u4e0a\u53bb\u4e86\uff0c\u5f88\u6162\u3002\u6211\u5c31\u4f30\u6478\u7740\u5e94\u8be5\u662f\u673a\u68b0\u8017\u635f\uff0c\u51c6\u5907\u6362\u65b0\uff0c\u7ed3\u679c\u4e00\u770b\u8fd9\u79cd\u56db\u7ebf\u7684\u8c03\u901f\u98ce\u6247\u6700\u4fbf\u5b9c\u7684\u4e5f\u662f\u5341\u51e0\u5757\u94b1\uff0c\u751a\u81f3\u666e\u904d\u7684\u6709\u56db\u4e94\u5341\u5757\u94b1\u4e00\u4e2a\u7684\uff0c\u8fd9\u6362\u7740\u6210\u672c\u4e5f\u592a\u9ad8\u4e86\u3002<br \/>\n\u56e0\u6b64\u51c6\u5907\u7528\u666e\u901a\u7684\u4e24\u7ebf\u98ce\u6247\u66ff\u4ee3\uff0c\u4e70\u4e00\u4e2a\u8fd9\u79cd 4010 \u5c3a\u5bf8\u7684 5V \u98ce\u6247\u4e5f\u5c31\u4e24\u4e09\u5757\u94b1\u4e00\u4e2a\uff0c\u4f46\u662f\u4e0d\u80fd\u8c03\u901f\uff0c\u63a5\u4e0a\u53bb\u7528\u7740\u5f88\u5feb\u5c31\u53d1\u73b0\u8fd9\u73a9\u610f\u5439\u5f97\u547c\u547c\u7684\u54cd\uff0c\u5ba4\u6e29 24\u2103 \u5de6\u53f3\uff0c\u80fd\u4fdd\u6301\u5728\u4e09\u5341\u51e0\u5ea6\uff0c\u4f7f\u7528\u8d77\u6765\u4e5f\u4e0d\u8fc7 40 \u5ea6\u5de6\u53f3\uff0c\u4f46\u5c31\u662f\u592a\u5435\u4e86\u3002\u6240\u4ee5\u8fd8\u662f\u5f97\u641e\u6210\u8c03\u901f\uff0c\u4f46\u662f\u6811\u8393\u6d3e\u7684 GPIO \u80af\u5b9a\u6ca1\u6cd5\u76f4\u63a5\u9a71\u52a8\u98ce\u6247\uff0c\u6211\u6d4b\u8bd5\u4e86\u4e00\u4e0b 5V \u7535\u6e90\u4e0b\u7535\u6d41\u6709 200 mA \u5de6\u53f3\uff0c\u800c\u4e14 GPIO \u7684\u6700\u9ad8\u8f93\u51fa\u662f 3.3V\uff0c\u7535\u538b\u592a\u7a84\u800c\u4e14\u4e5f\u627f\u53d7\u4e0d\u4e86\u98ce\u6247\u9700\u8981\u7684\u7535\u6d41\u3002<br \/>\n\u90a3\u4e48\u5c31\u5f97\u4f7f\u7528\u4e09\u6781\u7ba1\u6765\u653e\u5927\u7535\u6d41\uff0c\u8c03\u901f\u4f7f\u7528 PWM\u3002<\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/10\/image-1696256130966.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 557px; --smush-placeholder-aspect-ratio: 557\/818;\" \/><\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E6%9D%90%E6%96%99\"><\/span>\u6750\u6599<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<ul>\n<li>S8050\uff08NPN\uff09<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/10\/image-1696278469856.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 246px; --smush-placeholder-aspect-ratio: 246\/358;\" \/><br \/>\n\u5f88\u4fbf\u5b9c\uff0c\u4e24\u5757\u591a\u4e70\u4e86 10 \u4e2a<\/li>\n<li>1k\u03a9 \u7535\u963b<\/li>\n<li>4010 5V \u98ce\u6247<br \/>\n\u8fd9\u4e2a\u662f\u4ee5\u524d\u4e70\u7684\uff0c2\u5757\u94b1\u4e00\u4e2a<\/li>\n<\/ul>\n<h1><span class=\"ez-toc-section\" id=\"%E7%BA%BF%E8%B7%AF\"><\/span>\u7ebf\u8def<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/10\/image-1696278779953.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 728px; --smush-placeholder-aspect-ratio: 728\/545;\" \/><\/p>\n<p>\u6700\u5f00\u59cb\u6d4b\u8bd5\u6211\u662f\u6ca1\u52a0\u7535\u963b\u7684\uff0c\u6d4b\u8bd5 PWM \u5e73\u5747\u7535\u538b 0.6V \u65f6\uff0c\u98ce\u6247\u5927\u6982\u53ef\u4ee5\u8d77\u8f6c\uff0c\u98ce\u6247\u7aef\u7535\u6d41\u5927\u7ea6 30mA\uff0cPWM \u5e73\u5747\u7535\u538b 3.3V \u65f6\uff08\u6700\u5927\uff09\uff0c\u98ce\u6247\u7aef\u7535\u6d41\u5927\u7ea6 210mA\u3002\u7136\u540e\u7a81\u7136\u60f3\u7740\u6d4b\u4e86\u4e00\u4e0b PWM \u7aef\uff08b\uff09\u8d70\u7684\u7535\u6d41\u591a\u5927\uff0c\u53d1\u73b0\u5c45\u7136\u6709 35mA\uff0c\u8fd9\u5c5e\u5b9e\u6709\u70b9\u9ad8\u4e86\uff0c\u8981\u662f\u518d\u9ad8\u4e00\u4e9b\u8bf4\u4e0d\u5b9a\u90fd\u53ef\u80fd\u70e7\u6389\u3002\u6240\u4ee5\u6d4b\u8bd5\u4e86\u4e0b\uff0c\u6700\u7ec8\u52a0 1k\u03a9 \u7684\u7535\u963b\uff0c\u5728 PWM \u5e73\u5747\u7535\u538b 3.3V \u7684\u60c5\u51b5\u4e0b\uff0c\u7535\u6d41\u964d\u5230\u4e86 2.3mA\u3002<\/p>\n<p>\u6811\u8393\u6d3e\u7684\u786c\u4ef6 PWM \u6709\uff08BCM\uff0912\u300113\u300118 \u548c 19<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/10\/image-1696255651677.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 634px; --smush-placeholder-aspect-ratio: 634\/415;\" \/><\/p>\n<p>\u4f7f\u7528\u786c\u4ef6 PWM \u4e0d\u4f1a\u989d\u5916\u5360\u7528 CPU \u8d44\u6e90\uff0c\u56e0\u6b64\u5efa\u8bae\u914d\u7f6e\u9009\u5176\u4e2d\u4e00\u4e2a\u3002<\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0\"><\/span>\u9a71\u52a8\u7a0b\u5e8f\u5b9e\u73b0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><a href=\"https:\/\/github.com\/IYATT-yx\/pi-fan\">https:\/\/github.com\/IYATT-yx\/pi-fan<\/a><\/p>\n<p>\u53e6\u5916\u4e5f\u505a\u4e00\u4e0b\u8865\u5145\u8bf4\u660e\uff0c\u6211\u4e4b\u524d\u7528\u8fc7\u4e00\u4e2a PWM \u8c03\u901f\u98ce\u6247\u6269\u5c55\u677f\uff0c\u5728\u975e\u5168\u901f\u6a21\u5f0f\u4e0b\u4f1a\u6709\u9ad8\u9891\u523a\u8033\u7684\u8702\u9e23\u58f0\uff0c\u5728\u505a\u8fd9\u4e2a\u4e4b\u524d\u6211\u4e5f\u4e00\u76f4\u60f3\u7740\u8fd9\u4e2a\u3002\u7136\u540e\u8fd9\u91cc\u6d4b\u8bd5\u7684\u65f6\u5019\u5c1d\u8bd5\u4e86\u591a\u4e2a\u9891\u7387\uff0c\u53d1\u73b0\u5f53 PWM \u9891\u7387\u8d8a\u9ad8\uff0c\u8fd9\u4e2a\u8702\u9e23\u58f0\u5c31\u8d8a\u5c16\u9510\uff08\u5728\u51e0\u5343\u8d6b\u5179\u7684\u65f6\u5019\u5c24\u5176\u660e\u663e\uff09\uff0c\u6240\u4ee5\u5c31\u628a\u9891\u7387\u8c03\u5c0f\u6d4b\u8bd5\uff0c\u8702\u9e23\u58f0\u7684\u95ee\u9898\u5c31\u7f13\u89e3\u4e86\uff0c\u6700\u7ec8\u9879\u76ee\u91cc\u6211\u91c7\u7528\u7684 20Hz\uff0c\u8fd9\u4e2a\u98ce\u6247\u8c03\u901f\u4e5f\u4e0d\u9700\u8981\u591a\u9ad8\u7684\u7cbe\u5ea6\uff0c\u4e0d\u9700\u8981\u90a3\u4e48\u9ad8\u7684\u9891\u7387\uff0c\u800c\u4e14\u8702\u9e23\u58f0\u786e\u5b9e\u592a\u96be\u53d7\u3002\u4e0d\u8fc7\u9891\u7387\u5c0f\u4e86\u4e4b\u540e\u5728\u8bbe\u7f6e\u7535\u538b\u8f83\u4f4e\uff0c\u98ce\u6247\u8f6c\u901f\u6bd4\u8f83\u6162\u7684\u65f6\u5019\uff0c\u505c\u987f\u611f\u4f1a\u6709\u6240\u589e\u5f3a\uff0c\u6709\u70b9\u201c\u8e0f\u8e0f\u8e0f\u201d\u7684\u58f0\u97f3\uff0c\u4f46\u662f\u76f8\u5bf9\u4e8e\u8702\u9e23\u58f0\u4e0d\u662f\u90a3\u4e48\u660e\u663e\u4e86\u3002\u5f53\u7136\u6709\u9700\u8981\u4e5f\u53ef\u4ee5\u5728\u5b89\u88c5\u7684\u65f6\u5019\u81ea\u884c\u4fee\u6539\uff0c\u76f8\u5173\u53c2\u6570\u5728\u5355\u72ec\u4e00\u4e2a\u5934\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u5b8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u6211\u7528\u7684\u662f\u6811\u8393\u6d3e cm4\uff0c\u914d\u7684\u5e95\u677f\u662f\u5fae\u96ea\u7684 \u5e95\u677f\u4e0a\u6709 4 \u7ebf\u8c03\u901f\u98ce\u6247\u7684\u63d2\u53e3\uff0c\u9644\u5e26\u4e5f\u63d0\u4f9b\u4e86\u5e93 API\uff0c\u53ef\u4ee5\u8c03 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,600],"tags":[],"class_list":["post-11708","post","type-post","status-publish","format-standard","hentry","category-all","category-600"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/11708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11708"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/11708\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}