Arduino fan controller

Control: management of fans, temp/rpm monitoring via soft/hardware

Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee

Post Reply
smith
Posts: 2
Joined: Tue Jan 29, 2013 12:10 pm

Arduino fan controller

Post by smith » Tue Jan 29, 2013 12:44 pm

I'm working on a project at the moment to create a smart fan controller using an Arduino UNO and I thought others might be interested to read about it.

The idea is to connect teh Arduino to the motherboard's SMBus to read the motherboard's sensors directly. The controller will also be able to control the motherboard's fans as well as up to 15 additional PWM fans (although I will not add connectors for all 15 of these).
I would like to implement a control algorithm where I enter a desired maximum temperature for a 'zone' and the system maintains it, I will be implementing a PID controller and hopefully that does the job, otherwise I'll experiment with other techniques. If the more complcated techniques don't provide any benefit over a simple temperature->fan speed mapping then I will revert to that.
The controller should be configurable via the SMBus also but I'm not sure if I'll get that far when it can be configured via USB anyway..
Another nice thing will be that the fan's will be controlled 100% of the time that the PC is on without depending on software on the PC, so no fans @ 100% on startup/shutdown.

So far I have successfully connected the Arduino to my motherboard's SMbus by using a PCI riser card like this one:

Image

I removed one of the ribbon cables as well as the slot part and inserted wires in the to ribbon cable's connector. I didn't realise that PCIe also has pins for SMBus and I would have tried this if I'd have thought of it because the x1 slots are nice and small, not sure if Intel actually routed SMbus to the PCIe slots on my board though.

The SMBus on my motherboard (Intel DX58SO) is routed to pins on the PCI slot (and it doesn't have an SMbus header as far as i'm aware). I'm not sure that all motherboard's actually connect these pins but both the PCI and PCIe spec have pins reserved for SMBus.
I found this method to be much easier than soldering wires to my DIMM's and it can be easily removed.

I was able to read the temperatures with the Arduino and they matched the readings reported by speedfan.

The next stage will be implementing PWM control using a TLC5940 'sheild' and then implementing the control logic and packaging things up neatly. I had seen prototyping PCI boards which would have been cool for mounting everything on but I thought they were a bit expensive.

I'd be interested to hear if anyone has done anything similar and has any comments? I guess the Arduino is probably overkill for this but it makes it straightforward for me to develop. I want to build what for me is the 'ultimate' in fan control which means integration with the motherboard, controller independent of the PC, multiple PWM fan's and a sophisticated control algorithm. I may add an LCD screen for showing status and buttons for cycling the information and cooling profiles at a later date if I'm still inclined. further suggestions are welcome!

For reference my system is an i7 920 on an Intel DX58SO in a coolermaster CM690II case. CPU cooling is via Corsair H50 with push/pull fan's.
You do not have the required permissions to view the files attached to this post.

dewy721
Posts: 2
Joined: Sun Feb 10, 2013 6:22 pm

Re: Arduino fan controller

Post by dewy721 » Sun Feb 10, 2013 6:42 pm

I have a Arduino-based fan controller,
Its a quad-channel + 10 segment programmable RGB led.

However, for me I chose to use a USB+software solution. My fans and leds default to full power and the lights go bright white when there is no connection. (Safest fault response)

The toolchain I use is:
OpenHardwareMonitor+LCDsmartie+sensorBridge.dll

Like your SMBus tie-in card, this allows me to get all the sensor readings but without using up a card slot.
Unlike your solution, I have to load software to control it. But it allows me to alter the readings so I can change the way the controller responds on the fly without reprogramming the controller.

That said, I think I like your approach better. As hardware always beats software for reliability.

Had I known that the SMBus was available through the card interfaces when I built mine. I probably would have gone that way too. But thanks to you I know now. <:)

If you'd like to compare notes I'd love to see how you got the Arduino firmware setup and how to tie in to it.

smith
Posts: 2
Joined: Tue Jan 29, 2013 12:10 pm

Re: Arduino fan controller

Post by smith » Tue Feb 12, 2013 9:33 am

OpenHardwareMonitor sounds interesting, I'll have to look at that. Not all sensor's are on the SMBus, some are accessible via ISA and it might be nice to have access to those as well somehow.

I guess you are using the Arduino's standard PWM port's for the fan control? Are you reading the fan speed with the Arduino as well? I would like to do this but I'll only be able to read a subset of the fan's since I'm running out of pin's.

I now have the TLC5940 set up and controlling a single fan - the only PWM fan that I have at the moment.

The fan is attached to the side of the case and using a PID controller tied to the internal case temperature it is working well. I'm not sure how well it would work with the CPU temp which can fluctuate a lot. There's a fuzzy logic library for the Arduino which I would like to use as well.

I bought a 20x4 LCD screen + I2C backpack as well as a rotary encoder with the idea of creating a simple interface to the fan controller. Unfortuanately I've discovered that the LCD's I2C backpack is pulling the I2C bus up to 5V when the motherboard's bus is only 3.3V. oops.. Hardware is definitely riskier than software! It doesn't seem to have caused any damage but I have pulled it out until a logic level converter arrives to protect the motherboard.

Using up a card slot isn't a problem for me either because I only have one card in there anyway - the graphics card. It would be a problem on my HTPC though because it's full of tuner card's. It's a shame that an SMBus header isn't standard. Then again, my HTPC's motherboard doesn't have any sensor's on the SMBus anyway.

I'll upload all of the code etc and a bit more information on the build when things are in a more finished state.

dewy721
Posts: 2
Joined: Sun Feb 10, 2013 6:22 pm

Re: Arduino fan controller

Post by dewy721 » Mon Feb 18, 2013 7:23 pm

REVISED & UPDATED:

Actually I'm using the Arduino (plus some external transistors/capacitors) to dampen down the noise profile (and the blinding LED light show) of the four stock LED 2-wire dumb fans that comes with my Antec 902 case. The Arduino holds a minimum power output profile for each fan to keep it from stalling, revving them up only enough to meet the cooling needs as read by open hardware monitor. The critical fans like CPU (Corsair H60), GPU and PSU are still factory controlled as a safety measure.

However, fan tach signals and 4-wire pwm fans are easy enough to do. The tricky bit is that the IBM spec for fan tach signals are two ground pulse triggers per rotation, thats easy for the arduino to handle, the hard part is if you desire reporting that signal to the 12volt tach pin on the motherboard or not. For this there is three possible solutions.
1. Is a transistor to signal the motherboard tach pin with the ground pulse.
2. Or, for about 4 bucks an NTE2018 could be used handle up to 8 of them by converting the 5v Arduino pwm outputs to ground only signals that the motherboard can see.
3. Just skip sending signals to the motherboard. (However the CPU header still needs a signal, else it may refuse to boot up.)

Using a 5volt Arduino to control a 3.3v pwm lead on a 4-pin, you can get by just fine using two resistors to make a simple voltage divider.
ie. Ground>3.3kOhm>fanPwmLead>1.7kOhm>'5volt Arduino pwmPin' And tada! Instant speed control.

That way the fan's pwm lead only sees 0~3.3volts depending on the Arduino 0~5volt output.

From there the Arduino only needs to be setup with an interrupt routine for each tach wire to monitor speed.



Info for the spectators: (Rule of thumb mini-guide.)
__________________________________
For the rest of you DIY people following along and thinking about making one, consider the following:

How many tach signals will you need to monitor? 0, 1, 4, 20? Different Arduino models have different amounts of interrupts. (read: tach signal inputs).
Most Arduino models = up to 2 (5volt)
Except the following models:
Leonardo = up to 4 (5volt)
Mega2560 = up to 6 (5volt)
Due = up to 70 (3.3volt)

If your wondering what the difference is between a 5volt vs a 3.3volt Arduino. The 3.3v Arduino can plug straight into the pwm wire of any standard 4-wire fan and control it (or them) directly.

Tach signal is just a hall effect sensor that makes/breaks connection to the fan's ground lead. The tach pin on the motherboard fan header is pulled up to 12v by a 10k'ish resistor. So if your arduino intends on reporting a tach signal to the main board you'll need a transistor to handle sending a ground to that high of voltage.

Are your fans 2,3, or 4 wire fans?
2-wire dumb fans only need to have their input power modulated. Using and external transistor to toggle the ground wire will work nicely. An optional capacitor in parallel will mute any PWM noises the fan will make as a result.

3-wire fans are tricky if you intend to use all three wires, as the tach signal relies on the ground wire always being connected. Most suitable transistors work by interrupting this ground wire the fan (and thus tachometer) uses. Here your only functional option is to manipulate the power lead, that's a little bit more difficult in electronics. You'll need to research "high-side switching" circuits. Perhaps an LTC1155 can help. It just converts the Arduino's 3.3 or 5 volt output signals into 12v signals needed to toggle a high-side mosfet on/off.

4-wire fans, now your talking! The tach wire is totally usable. The pwm wire is 3.3v = off, 0v = on. So if you have a 3.3volt Arduino you can plug in directly. A 5volt Arduino will need just a little extra help getting the voltage right.

Can you use a 5volt Arduino to control a 4-wire pwm fan directly? Yes/No, if your courageous (read: foolish) you MIGHT be able to get away with it. It depends on the fan, it might tolerate it well, it might zap the fan's control circuit, it might short out and fry the Arduino. If you have money to burn and like doing things over, give it a try. ;)

__________________________________
If anybody else is interested in building one, I posted DIY build guide + code for my setup, a 4-channel, 2-wire fan controller (with optional 10-segment temperature responsive RGB LED light strip control).

Best of luck,
dewy721
http://emc2arduino.wordpress.com/

Post Reply