{"id":241653,"date":"2023-12-02T12:09:57","date_gmt":"2023-12-02T11:09:57","guid":{"rendered":"https:\/\/emariete.com\/?p=241653"},"modified":"2023-12-26T18:00:13","modified_gmt":"2023-12-26T17:00:13","slug":"mini-hat-pwm-raspberry-pi","status":"publish","type":"post","link":"https:\/\/emariete.com\/en\/mini-hat-pwm-raspberry-pi\/","title":{"rendered":"eMariete PWM Mini Hat for Raspberry Pi"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Build a small PWM Hat for Raspberry Pi that allows you to easily connect a fan, LEDs, a motor or anything else you need to control with it! Introducing <strong>the PWM Mini-Hat by eMariete<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Following this tutorial, you will be able to build, with very few components, a small controller for the Raspberry Pi to control by PWM low and medium power loads, such as a fan.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-por-que-un-mini-hat-para-la-raspberry-pi\">Why a Mini Hat for Raspberry Pi?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I wanted to put a temperature-controlled fan on my Raspberry Pi 4, and I wanted it to work really well and be small and unobtrusive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This PWM driver for Raspberry Pi does not differ much from other existing drivers. <strong>Its great advantage lies in its mounting format<\/strong>which allows it to be installed easily, safely and discreetly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What does this Mini Hat do?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Raspberry Pi 4, by itself, is capable of delivering very little power on its pins. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When we want to connect something to the Raspberry Pi that consumes more than what its pins are capable of providing we need to <em>a push<\/em>a circuit that increases that energy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This PWM Mini Hat allows you to connect many devices to the Raspberry Pi that you would otherwise not be able to.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Mini Hat PWM scheme<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The circuit diagram is as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp-1024x576.png\" class=\"wp-image-241663\" alt=\"Fan controller circuit with MOSFET transistor and PWM 25 kHz.\" srcset=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp-1024x576.png 1024w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp-300x169.png 300w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp-768x432.png 768w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp-1536x864.png 1536w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Esquema-Driver-PWM-con-transistor-MOSFET-Transp.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/> <\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">It is the same as the one we already used in the article <strong><a href=\"https:\/\/emariete.com\/en\/driver-pwm-transistor-bjt-2\/\">PWM driver with MOSFET transistor<\/a><\/strong> and which you can find here with all the details on how it works. <strong>I recommend you to read it!<\/strong><\/p>\n\n\n<div class=\"gb-container gb-container-46610061\">\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-emariete wp-block-embed-emariete\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"UsWDclONsX\"><a href=\"https:\/\/emariete.com\/en\/driver-pwm-transistor-bjt-2\/\">PWM driver with MOSFET transistor<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&quot;PWM driver with MOSFET transistor&quot; - eMariete\" src=\"https:\/\/emariete.com\/driver-pwm-transistor-mosfet\/embed\/#?secret=axvg6up4z3#?secret=UsWDclONsX\" data-secret=\"UsWDclONsX\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Assembly of the PWM Mini Hat<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Basically, what we are going to do is to assemble the circuit in a compact way, but without complicating our lives, over a <strong>perforated prototype plate<\/strong> (a Perf-board).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The important thing, and what makes it different, is that we are going to mount a <strong>DuPont female connector<\/strong> which will allow us to mount it directly on the 40-pin connector of the Raspberry Pi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As we will see, once we close the box, you can hardly see that it is there.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"461\" src=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi-1024x461.jpg\" class=\"wp-image-241655\" alt=\"Raspberry Pi electronic circuit, components, soldering, soldering, technology, repair, electronics, DIY, router, microprocessor, digital devices.\" srcset=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi-1024x461.jpg 1024w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi-300x135.jpg 300w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi-768x346.jpg 768w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi-1536x691.jpg 1536w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-Raspberry-Pi.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/> <\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The assembly is very simple. The only difficulty you may encounter is that the MOSFET is an SMD component and needs a bit of attention, pulse and holding your breath when soldering it. Nothing you can't do.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Solder Si2300 SOT23 on perfboard\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/olbh1nOnf7o?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"494\" height=\"808\" src=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Distribucion-PCB-PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi.png\" class=\"wp-image-241658 size-full\" alt=\"Raspberry Pi board with WPM Mini Hat module, innovative technological project, key piece for automation.\" srcset=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Distribucion-PCB-PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi.png 494w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Distribucion-PCB-PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-183x300.png 183w\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" \/>  <\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\">In this image you can see the approximate distribution of components that we want to achieve.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don't have to make it exactly as it is here. In fact, you may get a better distribution of components.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If so, please leave a message in the comments telling us about your achievements.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">PWM Mini Hat assembly video by eMariete<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To make it easier for you, here is a video of the assembly of the Mini Hat PWM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope that, between the video and the information in this article, you won't have any problems setting it up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you still encounter any difficulties or have any questions, leave a message in the comments and I'll try to solve them for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<div class=\"gb-container gb-container-9273ec54\">\n<div class=\"gb-container gb-container-d837ac58\">\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\ud83c\udfc5 PWM Driver with MOSFET for Raspberry Pi. The Mini Hat PWM. COOL! \ud83c\udfc5\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/JO81I35oMKw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n<\/div>\n<\/div>\n\n<div class=\"gb-container gb-container-68641a62\">\n\n<p class=\"wp-block-paragraph\"><strong>Making these videos takes a lot of work<\/strong>. If you like the video don't forget to \"Like\" and subscribe to the channel. That's&nbsp;<strong>will motivate me to keep making more videos like this one.<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-1024x462.jpg\" alt=\"\" class=\"wp-image-241245\" srcset=\"https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-1024x462.jpg 1024w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-300x135.jpg 300w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-768x347.jpg 768w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-1536x693.jpg 1536w, https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/Mesa-laboratorio-2048x924.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n<\/div>\n\n<div class=\"gb-container gb-container-1f704b4a\"><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Use of the Mini Hat PWM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Although you can do a lot of things with this circuit, one of the most common uses is for <strong>connecting a fan to a Raspberry Pi<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don't miss the following tutorial, where you have <strong>a great solution<\/strong>with a step-by-step explanation and all the necessary software to control the fan based on the CPU temperature:<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-emariete wp-block-embed-emariete\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"reW3jSfydP\"><a href=\"https:\/\/emariete.com\/en\/fan-speed-variable-raspberry-pi\/\">Tutorial: Temperature-controlled variable speed fan for Raspberry Pi<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&quot;Tutorial: Temperature-controlled variable speed fan for Raspberry Pi&quot; - eMariete\" src=\"https:\/\/emariete.com\/ventilador-velocidad-variable-raspberry-pi\/embed\/#?secret=hIzp7D6rHY#?secret=reW3jSfydP\" data-secret=\"reW3jSfydP\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I hope that something as simple as using a strip of cut pins will give you some ideas to use it in other similar cases. Many times, you don't need specific connectors (expensive and hard to get) to do interesting things.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please note that this assembly, although it has turned out very well and is fully functional, <strong>is a first version, a first prototype<\/strong>. I'm sure the next one I build will be much better. For example, now I know how to cut the terminals of the components to use them to make the connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are some related articles that may be useful for you to go deeper into the subject:<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-emariete wp-block-embed-emariete\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"UsWDclONsX\"><a href=\"https:\/\/emariete.com\/en\/driver-pwm-transistor-bjt-2\/\">PWM driver with MOSFET transistor<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&quot;PWM driver with MOSFET transistor&quot; - eMariete\" src=\"https:\/\/emariete.com\/driver-pwm-transistor-mosfet\/embed\/#?secret=axvg6up4z3#?secret=UsWDclONsX\" data-secret=\"UsWDclONsX\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-emariete wp-block-embed-emariete\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"8D87ilzeNz\"><a href=\"https:\/\/emariete.com\/en\/fan-speed-variable-raspberry-pi\/\">Tutorial: Temperature-controlled variable speed fan for Raspberry Pi<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&quot;Tutorial: Temperature-controlled variable speed fan for Raspberry Pi&quot; - eMariete\" src=\"https:\/\/emariete.com\/ventilador-velocidad-variable-raspberry-pi\/embed\/#?secret=PBsoeslocB#?secret=8D87ilzeNz\" data-secret=\"8D87ilzeNz\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-emariete wp-block-embed-emariete\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"dIQ85vEdSP\"><a href=\"https:\/\/emariete.com\/en\/control-the-speed-of-a-fan-with-pwm\/\">Controlling the speed of a fan with PWM<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&quot;Controlling the speed of a fan with PWM&quot; - eMariete\" src=\"https:\/\/emariete.com\/controlar-la-velocidad-de-un-ventilador-con-pwm\/embed\/#?secret=stsk32HK8L#?secret=dIQ85vEdSP\" data-secret=\"dIQ85vEdSP\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n<div class=\"essb_break_scroll\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Build a small Hat for Raspberry Pi to easily connect a fan, LEDs, a motor or whatever you want!<\/p>","protected":false},"author":1,"featured_media":241656,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"categories":[63],"tags":[67,46],"class_list":["post-241653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi","tag-pwm","tag-raspberry-pi"],"modified_by":"Mariete","uagb_featured_image_src":{"full":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi.png",1920,1080,false],"thumbnail":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-150x150.png",150,150,true],"medium":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-300x169.png",300,169,true],"medium_large":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-768x432.png",768,432,true],"large":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-1024x576.png",1024,576,true],"1536x1536":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi-1536x864.png",1536,864,true],"2048x2048":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi.png",1920,1080,false],"trp-custom-language-flag":["https:\/\/emariete.com\/wp-content\/uploads\/2023\/11\/PWM-Mini-Hat-de-eMariete-para-Raspberry-Pi.png",18,10,false]},"uagb_author_info":{"display_name":"Mariete","author_link":"https:\/\/emariete.com\/en\/author\/admin_xlyz052h\/"},"uagb_comment_info":0,"uagb_excerpt":"\u00a1Construye un peque\u00f1o Hat para la Raspberry Pi para conectar f\u00e1cilmente un ventilador, unos LEDs, un motor o lo que quieras!","_links":{"self":[{"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/posts\/241653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/comments?post=241653"}],"version-history":[{"count":15,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/posts\/241653\/revisions"}],"predecessor-version":[{"id":241954,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/posts\/241653\/revisions\/241954"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/media\/241656"}],"wp:attachment":[{"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/media?parent=241653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/categories?post=241653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emariete.com\/en\/wp-json\/wp\/v2\/tags?post=241653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}