My GPU Fan Saga

Posted on Mon 21 July 2025 in Programming

Having a problem-solving mindset is incredibly valuable and rewarding, especially when it leads to exciting DIY adventures. My latest experience with a noisy GPU fan turned into just such an opportunity. It guided me through fascinating explorations involving ATX power, MOSFET motor drivers, Pulse Width Modulation (PWM), ATTiny85's bit-banged 1-wire bus, and a DS18B20 temperature sensor. While many ready-made solutions exists, this project provided me with invaluable learning and immense satisfaction. 😊

Tiny85 Fan Controller PCB 3D previes

Background

The GPU in question isn't particularly high-end, nor is the use case too demanding. I use this VisionTek Radeon RX 550 SFF GDDR5 mainly because it supports Wayland on Linux. Nvidia, on the other hand, has great support for Linux, only if you're running CUDA. So, my setup has been to use Nvidia for CUDA/ML related tasks and AMD for Wayland. But last winter, my AMD graphics card decided to annoy me with a high-pitched whine, a clear sign that the fan was nearing its end. To prevent further damage (or perhaps just out of sheer annoyance), I swiftly snipped the fan's power cable. Silence returned, and through the cold months, the GPU seemed perfectly fine without active cooling.

That blissful silence lasted until May. With rising temperatures, my GPU began to complain again, this time visually. The screen started having episodes of random flickers and periodic blackouts. At idle, the GPU temperature hovered around 80 °C, clearly unhealthy no matter how modest its workload. It was obvious that a solution was needed, preferably one that wouldn't break the bank.

Solution Part 1: Using an Old Fan

Being a long-time tinkerer, I typically have random spare parts lying around. Among these was a small 12V DC brushless fan from a past project. Unfortunately, the connectors didn't match. Undeterred, I stripped a spare Molex connector and wired it up. If you're curious, Wikipedia offers great documentation on Molex connectors pinout and I have confirmed them with my own measurements as well. Here is a quick reference on the pinout:

Pin Color Type
Pin 1 Yellow +12 V
Pin 2 Black Ground
Pin 3 Black Ground
Pin 4 Red +5 V

I mounted the fan onto the GPU with some double-sided tape, right under the defunct fan. Initially, it seemed perfect: the GPU temperature dropped significantly; hovering around 40 °C even under load. But a new issue emerged: the fan ran at full speed constantly, turning my workspace from a serene environment back into a slightly noisier one.

Solution Part 2: Pulse Width Modulation (PWM)

PWM is used everywhere. From dimming LED lights and creating powerful yet efficient audio amplifiers to voltage regulation for large power convertors. It's a very simple concept build on many complex ideas. Sure, I could have powered the fan from the 5V rail of the Molex connector, but this brought two issues: first, the fan required a higher voltage to initially start spinning; second, even if it did run at 5V, the speed might be insufficient to keep the GPU cool enough.

There are many ways to generate a PWM signal. In analog world, it can be achieved with a 555 timer IC. But, I had my eyes set for a more complex approach, which is by using a cheap microcontroller. Luckily, I have a bunch of ATtiny85 laying around ready to be used. Using a microcontroller allows us to add a bit of logic to the PWM, which we will explore in the next section. PWM can be generated by using timer registers on the ATtiny, and can be explored in the code on Github or Codeberg.

Solution Part 3: Automatically Adjust Fan Speed Based on Temperature

DS18B20 may seem like a mouthful, nor does it roll of the tongue easily. However, with enough practice, we can recite these characters, which incidentally look like a solid low-entropy password. Jokes aside, this is one of the most widely-used temperature sensors in hobby electronics, commonly included in many beginner electronics kits. I also just happen to have a few of these in my parts bin.

The DS18B20 sensor communicates using the 1-Wire bus protocol, which is somewhat similar, in principle, to the WS2812 (another tongue-twister!) addressable RGB LEDs, albeit slightly more complicated. While the 1-Wire bus resembles I²C, it has its own unique quirks. Plenty of excellent tutorials cover the nuances of interfacing with DS18B20, so I’ll leave the detailed exploration of the protocol as an exercise for interested readers. In my case, I mostly mashed the keyboard until I started receiving accurate temperature readings.

For a detailed explanation of the temperature sensor, please check the data sheet of DS18B20. Also, there are other temperature sensors out there that uses simpler protocols, such as:

  • HTU31: Measures both temperature and humidity via I²C. Datasheet.

  • BME688: Provides temperature, humidity, barometric pressure, and gas sensing (e.g., carbon monoxide) also via I²C. Datasheet.

  • TMP35/36/37: Simplest analog sensors, easily read with an Analog-to-Digital Converter (ADC). Datasheet.

Results

No fancy graphs, just vibes. Solution Part 1 (manual fan replacement) immediately eliminated flickers, lowering the GPU’s idle temperature to around 35 °C and peak load temperature to 40 °C. The downside: the fan ran at full blast continuously, creating noticeable noise.

With the introduction of temperature-based PWM control (Solution Part 2 & 3), idle temperatures settled around 40 °C, with peaks near 60 °C under sustained heavy load, well within safe operating limits. Crucially, the fan now remains whisper‑quiet at typical room temperatures, ramping up speed only when required.

Costs

While my time investment was significant, the material costs remain modest when parts are ordered in bulk. Here’s a breakdown of the bill of materials:

Reference Qty Value Unit Cost (10 pcs) Unit Cost (100 pcs) Footprint Datasheet
C1 1 0.1 µF $0.10 $0.07 Capacitor_THT:CP_Radial_D4.0mm_P2.00mm
D1 1 1N4001 $0.07 $0.05 Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal http://www.vishay.com/docs/88503/1n4001.pdf
J1 1 UART_DBG $0.50 $0.10 Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
J2 1 Molex $1.00 $0.20 Connector_Molex:Molex_KK-254_AE-6410-04A_1x04_P2.54mm_Vertical
M1 1 Fan Connector $5.00 $2.00 Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical
Q1 1 IRF3808 $1.59 $1.00 Package_TO_SOT_THT:TO-220-3_Vertical http://www.irf.com/product-info/datasheets/data/irf3205.pdf
R1 1 10 kΩ $0.02 $0.01 Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_Vertical
R2 1 100 Ω $0.36 $0.25 Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_Vertical Can be short to save that money
R3 1 4.7 kΩ $0.05 $0.02 Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_Vertical
U1 1 ATtiny85-20P $1.66 $1.50 Package_DIP:DIP-8_W7.62mm http://ww1.microchip.com/downloads/en/DeviceDoc/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
U2 1 DS18B20 $5.70 $1.20 Package_TO_SOT_THT:TO-92_Inline http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

Total material cost per unit is $6.40–$16.05, plus an additional $5.00 PCB fabrication fee form OSHPark (Based on 1 in² quote). This can be reduced further with using SMD components, and a cheaper microcontroller. Not too bad for a few hours of prototype work.

Conclusion

Was this project valuable? If you’re looking purely at dollars spent versus performance gained, a commercial fan controller might be cheaper. But the journey taught me more about microcontroller, power electronics, and firmware design than any off-the-shelf unit could. The satisfaction of a custom solution, silent, temperature-aware, and built by hands—makes it worth every penny (and every line of code).

Whether you embark on a similar adventure or opt for a plug-and-play controller, I hope this story inspires your next DIY challenge. Happy tinkering!


If you found this project valuable, check out the fully open-sourced code and PCB files on GitHub and Codeberg. I'm planning to add new features—like advanced fan profiles and UI integration—if there’s interest. Additionally, I can develop a more cost-effective version using a cheaper microcontroller to further reduce BOM costs, so let me know if that’s something you’d like to see!