{"id":1182,"date":"2018-02-10T19:09:11","date_gmt":"2018-02-10T18:09:11","guid":{"rendered":"http:\/\/yarogniew.net\/arduino\/?p=1182"},"modified":"2019-09-23T01:26:54","modified_gmt":"2019-09-22T23:26:54","slug":"tranzystory","status":"publish","type":"post","link":"https:\/\/arduino.net.pl\/index.php\/tranzystory\/","title":{"rendered":"Tranzystory"},"content":{"rendered":"\n<p>P\u0142ytka Arduino ma pewne znacz\u0105ce ograniczenie, kt\u00f3re powoduje, \u017ce do pin\u00f3w wyj\u015bciowych nie mo\u017cemy sobie bezpo\u015brednio pod\u0142\u0105czy\u0107 grza\u0142ki akwaryjnej czy nawet wi\u0119kszego buzera, bo przepalimy wyj\u015bcie\/wej\u015bcie. Przyj\u0119\u0142o si\u0119, \u017ce bezpieczny pr\u0105d jaki mo\u017cemy czerpa\u0107 z pin\u00f3w to 40mA. Wi\u0119cej informacji na ten temat znajdziemy w internecie. Polecam artyku\u0142 <a href=\"http:\/\/mikrokontrolery.blogspot.com\/2011\/03\/datasheet-mikrokontroler-prad-pinu-io.html\" target=\"_blank\" rel=\"noopener noreferrer\">Datasheet: Mikrokontroler &#8211; pr\u0105dy pin\u00f3w I\/O<\/a>.<br>Bardzo dobrym rozwi\u0105zaniem, kt\u00f3re umo\u017cliwia sterowanie pr\u0105do\u017cernymi urz\u0105dzeniami jest stosowanie tranzystor\u00f3w. Poni\u017cej prosty przyk\u0142ad umo\u017cliwiaj\u0105cy p\u0142ynn\u0105 regulacj\u0119 obrotami ma\u0142ego silniczka.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">SCHEMAT:<\/h6>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/yarogniew.net\/arduino\/wp-content\/uploads\/2018\/02\/Zrzut-ekranu-2018-02-11-o-19.23.45.png\"><img loading=\"lazy\" decoding=\"async\" width=\"674\" height=\"474\" src=\"http:\/\/yarogniew.net\/arduino\/wp-content\/uploads\/2018\/02\/Zrzut-ekranu-2018-02-11-o-19.23.45.png\" alt=\"\" class=\"wp-image-1204\" srcset=\"https:\/\/arduino.net.pl\/wp-content\/uploads\/2018\/02\/Zrzut-ekranu-2018-02-11-o-19.23.45.png 674w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2018\/02\/Zrzut-ekranu-2018-02-11-o-19.23.45-300x211.png 300w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2018\/02\/Zrzut-ekranu-2018-02-11-o-19.23.45-427x300.png 427w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">CZ\u0118\u015aCI:<\/h6>\n\n\n\n<ul class=\"wp-block-list\"><li>Arduino Uno<\/li><li>Tranzystor \u00a02N2222<\/li><li>Dioda 1N4007<\/li><li>Rezystor 1k\u03a9<\/li><li>Potencjometr 5k\u03a9<\/li><li>Silniczek DC 5V<\/li><li>Zasilacz DC 5V<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">KOD:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\nint potPin = A0;\nint motorPin = 3;\nint potValue = 0;\nint motorValue = 0;\nvoid setup() {\n Serial.begin(9600);\n}\nvoid loop() {\n potValue = analogRead(potPin);\n motorValue = map(potValue, 0, 1023, 0, 255);\n analogWrite(motorPin, motorValue);\n Serial.print(\"potentiometer = \" );\n Serial.print(potValue);\n Serial.print(\"t motor = \");\n Serial.println(motorValue);\n delay(2);\n}\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\"><pre class=\"brush: plain; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\nint potPin = A0;\nint motorPin = 3;\nint potValue = 0;\nint motorValue = 0;\nvoid setup() {\n Serial.begin(9600);\n}\nvoid loop() {\n potValue = analogRead(potPin);\n motorValue = map(potValue, 0, 1023, 0, 255);\n analogWrite(motorPin, motorValue);\n Serial.print(\"potentiometer = \" );\n Serial.print(potValue);\n Serial.print(\"t motor = \");\n Serial.println(motorValue);\n delay(2);\n}\n<\/pre><\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">LINKI:<\/h6>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.homemade-circuits.com\/how-to-make-relay-driver-stage-in\/\">https:\/\/www.homemade-circuits.com\/how-to-make-relay-driver-stage-in\/<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"http:\/\/yarogniew.net\/arduino\/wp-content\/uploads\/2018\/02\/pn2222arlrag.pdf\" target=\"_blank\">Tranzystor pn2222 (2N2222)-specyfikacja<\/a><\/li><li><a href=\"https:\/\/www.dummies.com\/computers\/arduino\/how-to-control-the-speed-of-a-dc-motor-with-the-arduino\/\">How to Control the Speed of a DC Motor with the Arduino<\/a><\/li><li><a href=\"https:\/\/electronics.stackexchange.com\/questions\/324795\/are-bjts-suitable-for-level-shifters-it-seems-fets-are-more-common-how-do-they\">https:\/\/electronics.stackexchange.com\/questions\/324795\/are-bjts-suitable-for-level-shifters-it-seems-fets-are-more-common-how-do-they<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>P\u0142ytka Arduino ma pewne znacz\u0105ce ograniczenie, kt\u00f3re powoduje, \u017ce do pin\u00f3w wyj\u015bciowych nie mo\u017cemy sobie bezpo\u015brednio pod\u0142\u0105czy\u0107 grza\u0142ki akwaryjnej czy nawet wi\u0119kszego buzera, bo przepalimy wyj\u015bcie\/wej\u015bcie. Przyj\u0119\u0142o si\u0119, \u017ce bezpieczny&#8230;<\/p>\n","protected":false},"author":3,"featured_media":1204,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":21,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":3101,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1182\/revisions\/3101"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/categories?post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/tags?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}