4-Pin Case Fan Speed Control

I have used the IRLML2502 with good success. It is a 4.2A, 20V N Channel FET. N Channel is like an NPN. It has a fairly low gate(base)/source(emitter) on voltage, around 2.3V.

But remember, if you do the Emitter Follower circuit then you will get the same result with a fet as with the transistor, as the thing that derermines the drain/source resistance is the gate/source voltage. So if the source goes up then the gate must also go up also to keep a gate/source voltage the same.

Gate=Base
Drain=Collector
Source=Emitter

Some history:
In the old days they tought that electricity flowed from the + to the -. This is why the top of the transistor is a Collector, where the current flows in, and that is why a diode’s arrow points from + to -.

Later they realised that electrons carry the current, and an electron is negative. Thus current actually flows from - to +. This is why a FET’s terminals is the “wrong way” around… :slight_smile:

Thank you, Prof Errol. I stopped by The Shack during lunch and picked up their only FET which from the specs sounds like it will do the job (don’t remember the number). Lots of experiments to do tonight…

Also, I think Kerry’s article pretty well describes why I’m having the tach issues. I have to learn to test differently in Gadgeteer than I do in regular NETMF…

http://www.tinyclr.com/forum/21/5192/

I tried wiring up the transistor according to your schematic and it made no difference :frowning: Weird thing though is that if I measure the voltage from the fan PWM when at 100% duty cycle it only shows 3.5V. Does that sound normal?

Regardless, that’s not the problem… Out of total frustration, I pulled out my netduino just to see if the guy’s sample code over on their forum actually works. I simply plugged the fan PWM straight to the netduino PWM (GPIO 5) and ran his code and it works like a charm. So, now to decipher his code and see what I’m doing differently.

EDIT: I converted his code directly to Panda and I’m showing a little progress. The speed control now works when the duty cycle is at 100% and for everything else it seems to be at it’s minimum speed. Other than reference and pin ID changes, I’m using his code as-is. Any ideas why anything less than 100% duty cycle seems to be putting the fan into a default speed?

That does not sound correct at all.

The transistor acts as an inverter, thus 100% duty-cycle should give you 0V at the output.

The Panda PWM output should be at 3.3V.
The Base of the transistor should be at 0.6V, with 2.7V over the Base Resistor.
The Emitter should be connected to ground, so there should be 0V
The Collector should be at 0V, or very close to.

Is the transistor still in working order?

SUCCESS!!!

There’s apparently something wrong with PWM1 on my Panda board. :frowning: I changed it to PWM5 and it worked like a charm! Well, almost… The speed is inverted. I suppose that’s because of the inversion of the PWM by the transistor. At 0% duty I get max RPMs and at 100% duty I get min RPMs… I can deal with that through software though.

Errol, thanks for all your help on this. It doesn’t work at all without the transistor amp. I hate that I wasted most of the night because of what appears to be a broken Panda. Are there any known issues with Panda PWM1 ports?

Well, now on to solving the RPMs problem. Tomorrow…

BTW, do you know what this connector is called and where I might get the thru hole or SMD mates to it?

Glad it’s running now… :slight_smile:

Seems to be a molex connector.

See http://www.molex.com/molex/products/listview.jsp?query=47053&path=cHome%23%23-1%23%23-1~~ncPCBHEADERS%23%230%23%232&offset=0&autoNav=1&sType=s&filter=&fs=&channel=Products

Thanks! Samples on the way. :slight_smile:

I’m controlling a similar pwm-enabled fan without the transistor/FET amp, just straight from Panda II’s pwm pin. I didn’t experience any problems getting it going. I had it running with a Netduino first then ported it to the Panda. I’m not attempting to read the rpm from the fan’s sensor, but use a temp sensor and software logic to control the speed of the fan. My wire is about 2’ long.

I’ve been meaning to get back and update this thread. After moving some things around I decided on a whim to try it again w/o the transistor and it worked! I think my problem the whole time must have been related to the bad PWM port on my Panda :frowning: I’m still getting unreliable feedback from the tach though. Unfortunately, I’ve had to put that project aside to focus on my piezo contest entry. I’ll get back to this in a couple weeks.

Matt5, are you able to turn your fan off using PWM? My fan seems to only have high/med/low speeds. Not as granular as I would like although I could live with it if it would turn off when duty was at 0%. Instead it just stays at the low speed. What fan are you using?

Should be easy enough to turn completely off with a MOSFET…

That’s certainly plan B. I’d hoped I could do it all with just a single PWM :frowning:

IanLee,

sorry, off line for a few days…

Yes, i can adjust fairly smoothly from full stop to max rpm, 0-100%, although anything below 10% can cause the fan to stop (this usually happens at around 7%.) The fan is a Delta model BCB0812UHN-TP09 purchased at Digikey part no. 603-1213-ND.

Matt

Also, the fan is designed to run at full speed when there is no pwm signal. So it races at program start-up. I believe it works this way as a failsafe to keep the fan operating when the signal is corrupted.