Fan controller - First ever project

I'm looking to make a fan controller with no experience or understanding for either electronics or c programming. :grin:
I have noticed a few projects that use Mosfets to control a 3 pin fan, that's pretty much what I want to do but with 12 fans broken up in to 3 zones ( 6, 4, 2).

Each zone would consist of
6 - 3 pin fans headers
2 - temp sensors

I would like the arduino to read the tach of each fan. Initially i would just like to get things running so and audible alarm on fan failure (no start) would be good. Possibly a LCD display with temps and rpms later.

Zone 1 - 6 fans - would be installed on a 360 rad in a push pull config, a temp sensor at either end of the rad to measure temp drop over the rad. Ideally the arduino would take the sensor input and adjust the fan speed.

Zone 2 - 4 fans - installed on 240 rad with temp sensors at either end

Zone 3 - 2 fans - these are case fans. The 2 sensors are for ambiant temp out side of the case and temp inside case. Would also like to add 2 extra sensors to this zone.

I thought maybe if I broke it down in to 3 smaller boards and then the arduino mega it might be easier from me to manage cables and such in side the case.

Questions - Will a N-channel mosfet handle 6 fans ?
( 6 (.3+10%) = 19.8A) reading the spec sheet, if I read it right its 22.6A at 100c continous

  • how can I test to see if my fans are open collector or need a voltage divider on the tach wire without a scope? I don't think my multimeter would be able to get an accurate reading because of the speed of the pulse. I admit I haven't tried, still waiting for my fans to arrive.

  • Will the pcb circuit(attachment) work? The attachment is a board that I thought might work (no sensors yet) I hope someone can give me advice on it. Most importantly will is work ? will I destroy anything ? The connectors and layout will likely change but its my first attempt at designing anything like this. Sorry for the pcb layout but schematic views baffle me.

So I'm kind of a moron with this stuff so any help would be greatly appreciated. Please type slow and use small words :slight_smile:

I am a bit confused as to what this means.

6 fans - would be installed on a 360 rad in a push pull config

Can you give a few sentences to get me on track?

Sorry I'm not always able to clearly explain myself.
it's a computer fan controller for a liquid cooled system, so the sensors would be inside the 360mm radiator with 3 120mm fans pushes air through the rad and 3 120mm fans to pull air through the rad. The sensors check the water temps then the fans are adjusted to maintain a specific temp.

Something like this (not my system but great work on this build)

Thanks

Oh, then a 360 rad is a radiator? Not a 360 radius.
Yes a mosfet can handle lots of current, more than your fans will require.

Thanks Jack, any suggestions on the circuit layout ? I have to add the sensors and change the connector types but otherwise will it do what I'm hoping for?

Thanks again

Well, sounds like you just need the fans to run faster when it is hotter, and slower when it is cooler.
No need to know how fast the fan (tach) is running.
So, just sample the temp., if it is high, then increase the PWM (speed) of the fans. Feed that signal to a mosfet, that then drives the fans.

The idea of the tachs being at the least monitored for start-up is so that i don't fry my system if they don't start. Is there another way to see if the fan is spinning? (other then looking at it) I just assumed that listening for a pulse from the tach was the only way to know its spinning

You could have a valid point there. We normally just assume if we apply voltage to a motor, it turns, but your sampling the sensor would verify it to the arduino. So do you know what kind of output the tach will produce?

I havent received them, and I'm not sure how to test, would a multimeter be able to read the pulse if I stalled the fan by hand? I did read that if its 12v I'd need a voltage divider to bring it down to 5v. Is there a way i can test for it without a scope?

thanks

If the specs does not define what will be produced there, then be careful hooking it to an arduino. Assume it is 12v, so a voltage divider first. check the analog input, and you can tell if it is high voltage or not. You need help with a voltage divider for a 12(14) volt signal?

Computer fans typically report their speed via a Hall Effect sensor mounted near the rotor. Magnets on the rotor generate pulses of electricity on the wire, and the frequency of the pulses equates to the fan's RPM. If there are two magnets, then the frequency of the pulses is 2x the RPM, and so forth. Unfortunately, this type of signal will be a little harder for you to read than if they simply output an analog voltage. I know very, very little about analog circuit design, but it seems to me that a clever person could design a circuit, probably involving capacitors, that mapped the pulse frequency to a voltage level between 0 and 5 volts. If you had such a circuit, you could simply do an AnalogRead() and convert the resulting value to fan RPM.

The other way to go would be to sample the fan's sensor wire with the Arduino and manually count the pulses. This can be done manually, just by doing a DigitalRead() every loop() and incrementing a counter every time the pin goes from low to high, or something like that. But really, this situation seems tailor-made for interrupts. The only problem is that you have six fans to control, and most of the Arduinos only have two interrupt-capable pins. To get six interrupts, you are looking at a Mega or a Due.

Another issue that will have to be addressed is sampling rate. A typical computer fan might run at up to 4000 rpms. That's 66.67 rps. That's about 15 ms per rotation. If you've got two magnets per fan, your pulse frequency could be as high as one per 7.5 ms. The actual process of reading a digital pin is quite fast on the Arduino, even if you use digitalWrite() vs. accessing the pin directly, but if you go stuffing your loop() full of code, you could push your loop time high enough that you miss pulses. Missed pulses wouldn't be an issue if you were using interrupts.

Then again, if all you need to do is confirm that a fan is running, vs. actually measuring the RPM, missed pulses are probably no big deal. Even a few samples per second would tell you if you had a dead fan and let you be warned.

Pin Change Interrupts. You got way more than two of those.

Why not use 4-pin fans instead of 3-pin fans? Then you won't need mosfets to drive them, because an Arduino can drive the PWM input pins directly. Another reason to use 4-pin fans is that when you PWM a 3-pin fan, you can't get reliable readings from the speed sensor.

The tacho output of a standard computer fan is an open collector or open drain output. You can connect it directly to a digital input pin. Enable the pin pullup resistor. To measure the speed, have the pin generate an interrupt, and measure the time between interrupts.

I may need help with that, I emailed the manufacture to find out if the tachometer is open drain or collector, just waiting to hear back from them.

joshuabardwell:
Computer fans typically report their speed via a Hall Effect sensor mounted near the rotor. Magnets on the rotor generate pulses of electricity on the wire, and the frequency of the pulses equates to the fan's RPM. If there are two magnets, then the frequency of the pulses is 2x the RPM, and so forth. Unfortunately, this type of signal will be a little harder for you to read than if they simply output an analog voltage. I know very, very little about analog circuit design, but it seems to me that a clever person could design a circuit, probably involving capacitors, that mapped the pulse frequency to a voltage level between 0 and 5 volts. If you had such a circuit, you could simply do an AnalogRead() and convert the resulting value to fan RPM.

The other way to go would be to sample the fan's sensor wire with the Arduino and manually count the pulses. This can be done manually, just by doing a DigitalRead() every loop() and incrementing a counter every time the pin goes from low to high, or something like that. But really, this situation seems tailor-made for interrupts. The only problem is that you have six fans to control, and most of the Arduinos only have two interrupt-capable pins. To get six interrupts, you are looking at a Mega or a Due.

Another issue that will have to be addressed is sampling rate. A typical computer fan might run at up to 4000 rpms. That's 66.67 rps. That's about 15 ms per rotation. If you've got two magnets per fan, your pulse frequency could be as high as one per 7.5 ms. The actual process of reading a digital pin is quite fast on the Arduino, even if you use digitalWrite() vs. accessing the pin directly, but if you go stuffing your loop() full of code, you could push your loop time high enough that you miss pulses. Missed pulses wouldn't be an issue if you were using interrupts.

Then again, if all you need to do is confirm that a fan is running, vs. actually measuring the RPM, missed pulses are probably no big deal. Even a few samples per second would tell you if you had a dead fan and let you be warned.

My initial idea for that was to set the gate high, count 1 full revolution, and calculate rpm based on the on time of 1 revolution and then return to normal pmw state of the fans. Really I only need to poll the rpm once every minute maybe. Its just to ensure that the fans are operating and roughly at the same speed. It doesn't need to be continously monitored.

Yes I would like to use a mega from my understanding I'd need 12 interupts for tach and 3 for mosfets to run the 12 fans plus sensors ( an additional 8) I believe the mega can do that fairly easily, right?

thanks

dc42:
Why not use 4-pin fans instead of 3-pin fans? Then you won't need mosfets to drive them, because an Arduino can drive the PWM input pins directly. Another reason to use 4-pin fans is that when you PWM a 3-pin fan, you can't get reliable readings from the speed sensor.

The tacho output of a standard computer fan is an open collector or open drain output. You can connect it directly to a digital input pin. Enable the pin pullup resistor. To measure the speed, have the pin generate an interrupt, and measure the time between interrupts.

Honestly its a matter of price, performance and looks, the fans I've ordered are Cougar CFD green http://www.cougar-world.com/products/fans/cfd_green_led_fan.html
its the best of the fans with the proper color scheme for my system build ( normally it wouldn't matter what a fan looks like but in this case I will sacrifice minor performance for looks)

The speed sensor doesn't have to be that accurate, I just want to make sure that they are running. However that said the rpm reading my be used later to calculate adjustment to the fan speed but a few rpm either way shouldn't make that huge of a difference, maybe a tenth of a degree c.

thanks

SirNickity:
Pin Change Interrupts. You got way more than two of those.

On an Uno?

On a Uno, all pins can generate a pin change interrupt. So, I would say you have 20 of them.

Wouldn't a thermistor be simpler? Isn't the objective to see if the air is too hot, not find exactly what speed the fans are turning at?

I'm really confused, then. Can you help me reconcile that with this table, from Arduino.cc?

You're confusing Int0 and Int1 with PCInt. They're different things. Int0/1 give you a little more flexibility, but often the pin change interrupts will or can do what you want if you plan ahead a little.

Int0/1 will trigger on LOW, on logic level change, on rising edge, or falling edge. They fire their own dedicated ISRs. (But you only get a couple.)

PCInt will trigger on any logic level change, and fire a shared ISR. You then have to query a register to find out what changed. (But you get a ton of 'em.)

Good heavens, no. The objective is to have the Starship Enterprise command console in a drive bay, with detailed temperature and RPM readings, lighting control, and a killer water cooling setup. Duh! :wink: The fact that it keeps the CPU temperature adequately cool is merely an ancillary benefit.