Jump to content
Sign in to follow this  

Raspberry Pi Fan Control HAT

Recommended Posts

Hello everyone, 

Ever since I bought my first Raspberry Pi, the original model, I have wanted to build a HAT (Hardware Attached on Top) for the Raspberry Pi to control my PC. I have been slowly building up exactly what I want the board to do for a long time now. However, I have not had the time nor the perfected skill set to do everything that I wanted. Although I was doing Electronic Engineering as a degree I very rarely got to design a PCB, and when I did it was horrid. So now that I am working as an Electronic Engineer I have gone through more training and am in a position where I can build it to a decent standard!

So lets first discuss what I want the board to be able to:

  • Control at least 8 channels of 3 fans each.
  • Power the PC on and off
  • Modularly connect to additional control boards
  • RGB LED control

With that I started with the schematic design, I have gone through a number of different iterations of the design. First starting in OrCAD the chosen CAD package at university but it is not well documented nor accessible to the masses with a price tag that is so far out of this world it is not worth thinking about. For these reasons I switched to EAGLE PCB which is supported by a huge majority of the hobbyist community as well as PCB houses. Additionally huge libraries are available from Adafruit and Sparkfun.

Below contains most of the features I wanted for the board, fan control for 13 3-pin fans, control for RGB LEDs. I will go through how each of these features shortly but for now have a look at the whole thing.


This is the inputs, on the left, and PWM controller on the right. The inputs include the 20x2 connector for the Raspberry Pi (B+, 2, Zero), a 4-pin MOLEX connector for power (12v, 5v, GND), a voltage regulator for converting the 12V from the PSU to 3.3v needed by the control circuitry and pull up resistors for the two control lines SDA (i2c data) and SCL (i2c clock). The pull up is required to ensure that the two control lines do not drift, by having the "pulled up" to 3.3v with 10k resistors when no data is being sent the signal line is held high (at 3.3v).

Next to the Raspberry Pi connector is the address selector for the PCA9685 (the PWM driver) allowing up to 64 devices to be connected to the i2c bus. This allows us to have modularity while using the same component on different boards all connected to the same i2c connector.

The out puts of the PCA9685 are connected to a 220 ohm resistor, this limits the current on each to 3.3/220 = 15mA which is more than necessary to control the MOSFETs (which I will explain later) and protects the PCA9685 as well.



On a 3-pin fan the three pins are 12v, GND, tachometer. The tachometer is used to show how fast the fan is spinning and works by supplying two pulses for every rotation. These pulses have a 5v high, this would be fine if I was using an Arduino to control everything as they operate on 5v logic but I couldn't make my life easy. Therefore, a line driver is required, this component takes the 5v logic from the fan and converts it to 3.3v, allowing it to safely connect to the Raspberry Pi. I will then use software to detect the pulses and calculate an RPM.

For now this will do, please let me know if you have any questions, I want to create basic electronics guides for you all so please let me know what you want me to cover.


Share this post

Link to post
Share on other sites
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...