A friend of mine has all of his home network gear in a little space in his desk. It’s one of those compartments where you would normally put the computer, but his doesn’t fit, so he put his network gear in it instead. Anyway, it gets hot in there, especially in the Summer. So I’m making a fan that will turn on when it warms up and adjust its speed based on the heat level. I’m using an Arduino for the brain. It also has an LCD screen to tell you the critical stats. And of course, LEDs.
- Turn on/off the fan at a user settable temperature.
- Hysteresis at the on/off set point to prevent erratic power cycling.
- Reach full speed at a user settable maximum temperature.
- Automatically adjust fan speed in proportion to the min/max set-points.
- Min fan PWM set internally via trimpot.
- Display mode 1: Temp, Min set-point, Animated fan output indicator.
- Display mode 2: Temp, Fan RPM, Min set-point, Max set-point.
- Display mode 3: Temp, Deg C/F, Min fan PWM %
- LEDs in the control box change color based on temperature.
The early stages
Once I got the LCD working, I set it up as a debug output. The four elements being displayed are Temperature, Fan % output (inverse), miNimum set-point and maXimum set-point so I can tune the code. The red LED on the left is showing the main fan PWM output. The bright orange RGB LED is for effect. It will actually be a couple larger LEDs behind the LCD screen, lighting up the clear control box. As the temperature rises, the RGB LED changes from dark -> red -> orange -> white -> white/blue, like metal heating up (it’s sort of close). The LCD display will be a 16×2 blue background w/ white text. I’ve also got 4 pots in there: 2 to adjust the Min and Max set-points, one for the LCD contrast and one for calibrating the LM335 temperature sensor.
PWM or Linear fan speed?
Hmmm. Well there’s benefits and drawbacks to both, and it depends on the fan too. Right now, all the fans I have in my Box-O-Fans are three-pin fans where the third pin is a tachometer output. They have no PWM input lead, so I’m having to duty-cycle the power lead to vary the speed. This has two problems. First, you can hear the PWM signal in the fan – and it’s LOUD. Second, during the low side of the PWM signal, there’s no power to the fan, rendering the tach output useless. So for two and three-pin fans, I’ll need to use linear voltage regulation to control the fan speed.
I figured out I can run the PWM frequency at about 31KHz, which eliminates the noise. But I also need to use 4-pin fans instead of 2 or 3-pin fans.