{"id":10881,"date":"2016-05-23T09:25:05","date_gmt":"2016-05-23T07:25:05","guid":{"rendered":"http:\/\/blog.isnochys.de\/?p=10881"},"modified":"2016-05-23T09:40:22","modified_gmt":"2016-05-23T07:40:22","slug":"raspberry-pi-3","status":"publish","type":"post","link":"https:\/\/blog.isnochys.de\/?p=10881","title":{"rendered":"Raspberry Pi 3"},"content":{"rendered":"<p>I got a Pi 3 for my birthday.<br \/>\nInstalled OSMC and just started our new Media Center.<br \/>\nIt works so fine and smooth.<br \/>\nCasing is with fan included.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.isnochys.de\/wp-content\/2016\/05\/picasing-450x266.jpg\" alt=\"picasing\" width=\"450\" height=\"266\" class=\"alignnone size-medium wp-image-10883\" srcset=\"https:\/\/blog.isnochys.de\/wp-content\/2016\/05\/picasing-450x266.jpg 450w, https:\/\/blog.isnochys.de\/wp-content\/2016\/05\/picasing.jpg 469w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>But with the Pis GPIO, there is only 3.3V OUT and no 150 mA.<br \/>\nWhat to do, to let this fan run?<br \/>\n(And not constant on, yes, I could connect it to 5V adn GND, but I want the Pi running 24\/7 and not the fan)<br \/>\nWell, I just transitored it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.isnochys.de\/wp-content\/2016\/05\/schaltplan.jpg\" alt=\"schaltplan\" width=\"370\" height=\"252\" class=\"alignnone size-full wp-image-10882\" \/><br \/>\n(Pic I found on the net)<\/p>\n<p>And here starts my trouble.<br \/>\nAs you can see, there is a 6k Ohm resistor used.<br \/>\nDoesn&#8217;t work for me, my transistor is a N2222.<br \/>\nWith the power of the internet, I calculated following values:<br \/>\n1,7k Ohm<br \/>\n0.5M Ohm<br \/>\nand 47 Ohm<br \/>\nYes, 3 different values.<br \/>\nStarted with 1k Ohm.<br \/>\nNot running.<br \/>\n220 Ohm, there you go.<br \/>\nSo I settled with 470 Ohm, just because.<br \/>\nIf anyone can explain, how to calculate it properly, I would be so glad!<\/p>\n<p>Some soldering, and hacking it into the casing later, it is running!<br \/>\nAnd here is my dirty script:<\/p>\n<pre>\r\n#!\/usr\/bin\/env python\r\nimport RPi.GPIO as GPIO \r\nimport time\r\nGPIO.setmode(GPIO.BCM) \r\nGPIO.setup(14, GPIO.OUT,initial=GPIO.LOW) \r\ndef getTemp():\r\n        f = open(\"\/sys\/class\/thermal\/thermal_zone0\/temp\", \"r\")\r\n        temperature = f.read()\r\n        cleantemp = temperature.rstrip()\r\n        return int(cleantemp)\r\n\r\nfanset = False\r\nhightemp = 70000\r\nlowtemp = 60000\r\ntry:\r\n while(True):\r\n  curtemp = getTemp()\r\n  if(curtemp>hightemp and not fanset):\r\n    fanset = True\r\n    GPIO.output(14,fanset)\r\n  elif(curtemp &lt lowtemp and fanset):\r\n    fanset = False\r\n    GPIO.output(14,fanset)\r\n  time.sleep(30)\r\n\r\nfinally:\r\n GPIO.cleanup()\r\n<\/pre>\n<p>and the real miracle..it works!<br \/>\nstarting at hightemp = 70000 (70\u00c2\u00b0C) and stopping, if below lowtemp = 60000 (60\u00c2\u00b0C)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got a Pi 3 for my birthday. Installed OSMC and just started our new Media Center. It works so fine and smooth. Casing is with fan included. But with the Pis GPIO, there is only 3.3V OUT and no &hellip; <a href=\"https:\/\/blog.isnochys.de\/?p=10881\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-10881","post","type-post","status-publish","format-standard","hentry","category-initializing-devchaos"],"_links":{"self":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10881"}],"version-history":[{"count":10,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10881\/revisions"}],"predecessor-version":[{"id":10893,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10881\/revisions\/10893"}],"wp:attachment":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}