Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
SecretSquirrel
Minister of Gerbil Affairs
Topic Author
Posts: 2726
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Custom built 8 channel fan controller

Mon May 25, 2015 2:55 pm

I'm starting this thread to break out the development discussion from my thread over in SBA: A behemoth..... The short story is that I got an engineering sample server motherboard and built a system with it. System works great, but the system controller won't properly read the CPU temps and so the fans stay at full throttle. The case has four PWM fans and there are also two PWM fans on the CPUs. After much searching, I wasn't able to find a simple USB or i2c capable PWM fan controller so I decided to build my own.

Image

Image

Image
 
SecretSquirrel
Minister of Gerbil Affairs
Topic Author
Posts: 2726
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Re: Custom built 8 channel fan controller

Mon May 25, 2015 3:43 pm

localhostrulez wrote:
Is that just a simple transistor-as-relay circuit on the Teensy? I've been pondering getting something like that so I can add turn signals and the like to my bike, run off a USB battery. (Holding out my arm into a bunch of traffic to signal doesn't seem like a terribly safe idea for some reason. :wink:) Any limitations that are an issue compared to a higher end Teensy or Arduino?


Those are N channel FETs for the open collector/drain PWM output. The initial testing I did said the Teensy could drive the PWM outputs directly, but it's outputs are not 5V tolerant and it is perfectly legal for the fan to pull the PWM line up to 5V. I put up the PWM outputs to 3V on the controller, but this way, if the fan has it's own pull ups, it won't damage the Teensy. The Teensy drives the FET gate directly as I used logic level FETs, BS108ZL1G to be specific. They have a high Rds at 8 ohms, but the a full on Vgs of 3V, they are perfect for this use.

The tach signal coming from the fans is pulled up to 3V and fed directly to the Teensy. If I were building these for sale or actually laying out a PCB, I would probably buffer the tach inputs with similar FETs too, just to protect the Teensy a bit more. It would suck to let the smoke out of the chip just because someone shorted the tach input to 12V.

Power comes from a 4 pin "floppy" power connector. +12V/GND runs directly to the fan connectors. Again, were I building this a a PCB or for sale, I'd probably consider putting in the ability to power down each fan individually. That would require some sort of IO expansion though as I used most of the available pins in the current design.

As to you question about the Teensy versus others. This is the Teensy LC. The only limitation I ran into with it that annoyed me is that the ARM core used in it doesn't have a system clock tick counter. So I had to use "elapsedMicros" variables for calculating the fan RPM instead of the lighter weight system tick. This is actually my first project to use the Arduino environment. I do a lot of stuff with Atmel AVRs, but I cut my teeth on them well before Arduino was even a concept so I'm rather familiar with the hardware and programming it directly. The overhead of the Arduino libraries is also pretty high for a lot of what I do. Using the Arduino environment would likely double the code size on several projects and who knows what it would do to RAM needs.

For this project, I needed something that had a large number (at least six) independent PWM outputs. The Teensy LC was a perfect fit and rather than spend a bunch of time learning low level ARM programming, I stood on the shoulders of others and used the Arduino environment. It took me an evening to acquaint myself with the Arduino way and a burned part of an evening before I figured out the Teensy LC doesn't have a systick counter; the Teensy 3.1 does. All in all, I'm pretty happy with it, especially with the quick ramp time. My biggest complaint so far is that it encourages horrible programming practices. Because of the way the Arduino environment works, you have to make a large number of your variables global or static local within the loop() function.

Once I get the code cleaned up a bit, I'll post it somewhere.

--SS

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On