Today, we’ll build a temperature-controlled PWM fan controller with an OLED display and an ESP32. Along the way, we’ll learn all about 4-pin PWM fans and how to use them.
On the outside, a computer fan seems to be a simple device; after all, how complex can a fan be? Turns out they are more complicated than you might think! A computer fan uses a brushless DC motor and has an integrated Electronic Speed Control (ESC). And, once you know how to use them, you can control their speed and measure their rotation.
Today, we will examine how these fans work. We’ll see why some have more than two connections, and we’ll learn how to drive and monitor a fan with a 4-pin connector.
After that, we’ll build a fan controller that can run in both automatic (temperature-controlled) and manual modes. It also has a stall detector, in case the fan blades stop turning. It features an OLED display that indicates the fan's performance and the surrounding temperature.
Here is the table of contents for today's video:
00:00 - Introduction
01:43 - PWM Fan Control
05:00 - PWM Fan Demo
07:27 - Simple Fan Control
14:15 - Using the Tachometer
19:40 - Temperature Controlled Fan
29:09 - Conclusion
These fans are inexpensive and great for cooling off computers, power supplies, or even people! Now that you know how to use them, you can control the world!
Hope you enjoy the video.
Bill
"Never trust a computer you can’t throw out a window." — Steve Wozniak
A comment here on the "deprecated" warning. This was new to me.
The warning is a result of C++20 and applies to volatile variables and for a select set of operators. I'm still trying to figure out the reasoning, but I think here it refers to the atomic operation on the variable.
My point here is that it does not mean the increment operator (++) is deprecated in general; just for variables marked as volatile.
I hope to post more on this as I collect it.
The one who has the most fun, wins!
I purchased 3, 4 wire fans, 12V, and followed the instruction and video and the fan runs all the time. The XAIO and pot is all hooked up and I have a separate 12V power supply for the fan, BUT the fans' power, once turned on, the fan just runs and the PWM, Tach coding all works or shows in the serial monitor, but no POT effect on the fan speed.
Any ideas?
