{"id":111,"date":"2018-12-23T19:15:47","date_gmt":"2018-12-23T19:15:47","guid":{"rendered":"http:\/\/pi.peernix.com\/?p=111"},"modified":"2018-12-23T19:15:47","modified_gmt":"2018-12-23T19:15:47","slug":"pc-fan-control-with-an-attiny85","status":"publish","type":"post","link":"http:\/\/peernix.com\/?p=111","title":{"rendered":"PC Fan Control with an AtTiny85"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I have a computer desk that I like quite well. It it was designed to be used with a desktop computer, and has all the attributes that are common with computer desks, such as keyboard trays and so on. One thing that may be a bit less common however, is that there is a cabinet complete with door to house the actual computer tower. This is great in some ways, and less so in others. Great in the fact that it hides all of your computer cords, as well as the computer tower itself. Less than great, in that to access the rear of the computer to perform work or make changes, great difficulty is required. Another consequence of having your computer in an enclosure is that ventilation is quite limited. Good ventilation is required if there is a lot of load on the computer, where a consequence of load is heat.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To\ncombat this heat, I decided to use some PC fans. I built a boost\nconverter circuit so I could power the 12V computer fans with 5 volts\nfrom USB. This worked quite well, except for the USB on the rear of\nthe computer remained powered when the computer was off, so I would\nhave to use a switch to power them when I used the computer.\nSometimes I\u2019d forget, and things would get quite hot. \n<\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/ZMSjNn7\/2016-02-02-14-59-58.jpg\" alt=\"2016-02-02-14-59-58\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\">This\nled me to design a new system of powering the fans, one where a\nmicrocontroller would be used and power them based on the temperature\nof the interior of the cabinet vs the exterior ambient temperature. \nIn this way, I would not have to remember to turn the fans on or off,\nit would all be automatic. Because of the small amount of inputs and\noutputs required for the project, I decided on using the AtTiny85\nmicrocontroller. It comes in a DIP-8 package, which would also cut\ndown on the  size of the controller board. I decided that I would use\na boost converter as I had before, so I could continue to power the\nfans via USB.<\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/kQbyZCC\/2017-04-28-21-38-39.jpg\" alt=\"2017-04-28-21-38-39\" border=\"0\"><\/a>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/pJLLx92\/2017-04-29-14-23-25.jpg\" alt=\"2017-04-29-14-23-25\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\">For reading the temperature, I decided to use some one wire devices: DS18b20 temperature sensors. I like these sensors, and it would allow me to use just one input for both of them. Again, I chose the MC34063 buck\/boots converter for switching the 5v to 12 and a NPN transistor to switch the power. I decided to use PWM to control the fan speed, as I could use more than just a simple on and off when using a microcontroller and speed up, or slow down the fan depending on the difference in temperature between outside and inside the enclosure. I added a few different color LEDs to indicate the disparity in temperature as well as fan speed. Using Kicad, a layout was done, and single sided PCB etching with ferric chloride gave me a nice circuit board.  I built a panel to mount the fans and the controller on, which I could insert into one of the two back vent areas of the cabinet, and presto, no more worrying about overheating my computer.  <\/p>\n\n\n\n<a href=\"https:\/\/ibb.co\/5hqCmK5\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/9HRB6Zq\/2016-02-06-17-24-27.jpg\" alt=\"2016-02-06-17-24-27\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/ibb.co\/y0qMcF3\"><strong>Schematic<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> <br><a href=\"https:\/\/pastebin.com\/487sqczd\"><strong>Code<\/strong><\/a><strong>    <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a computer desk that I like quite well. It it was designed to be used with a desktop computer, and has all the attributes that are common with computer desks, such as keyboard trays and so on. One thing that may be a bit less common however, is that there is a cabinet<\/p>\n<div class=\"more-link\"><a href=\"http:\/\/peernix.com\/?p=111\">Read More<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[10,19,29,42,46,48],"class_list":["entry","author-datz","post-111","post","type-post","status-publish","format-standard","category-computerwelt","category-electronics","tag-arduino","tag-circuit-board","tag-fan-controller","tag-microcontroller","tag-pc-fan","tag-pcb-etching"],"_links":{"self":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":0,"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"wp:attachment":[{"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}