I have a pc fan with 2000rpm with 300mA at 12V (3 Pins) and I want to control the speed via pwm.
I have a BC639 transistor at hand that is rated for 1A. I tried to connect the Arduino to the BC639 (220 Ohm resistor at the base) and the transistor collector/emitter to 12V+.
So it should neeeeeaarly deliver the 300mA right?
The fan runs when the base pin is high (no PWM yet, its just high... so it should run at 2000rpm) but my bench power supply only delivers 60-80mA to it (fan is slow). When I directly connect the fan to my bench power supply it delivers the 300mA and the fan runs at 2000rpm.
What am Im doing wrong?
I also have a IRLZ34n MOSFET but it should also work with the BC639 right?
The BC639 with a 220ohm resistor should work ok for a 300mA computer fan.
I suspect threre is something wrong with your wiring.
Words don't work. A picture of your setup is needed.
PC fans usually have the stall current of the fan on the sticker.
Running current with freeflowing air is usually much less.
Expect 100-150mA.
Leo..
asuryan:
I have a BC639 transistor at hand that is rated for 1A. I tried to connect the Arduino to the BC639 (220 Ohm resistor at the base) and the transistor collector/emitter to 12V+.
That doesn't make any sense. You can't connect the collector and the emitter to 12V. And where is the fan in all this?
A diagram showing how things are actually connected might help.
Before, I connected the transistor between VCC and the fan.
Now with the transitor beween GND and fan is much faster ( just goes up to 200mA) and also switches off completly with analogWrite(3,0);
Can I go even lower with the base resistor to get closer to the 300mA or do I risk to blow up the Arduino pin?
There will always be a voltage drop across a transistor. Should be <= 0.5volt with a BC639.
You can compensate for that by using a slightly higher supply voltage (12.5volt).
Not that it will make much difference to actual air flow.
Did you measure that 300mA with the fan not spinning (blocked), because that is what the 300mA probably means.
200mA is already higher than I expected.
Leo..
It sounds like it is now being driven properly. To validate this connect the fan directly to the power supply and measure the current, Check to see if it spins about the same speed with either configuration. If not try a logic level avalanche rated MOSFET with the source connected to ground the gate connected to the Arduino port pin and the drain connected to the fan -, connect the fan + to the 12V. No diode is needed as it is part and parcel of the MOSFET. That should work just fine.
have a BC639 transistor at hand that is rated for 1A. I tried to connect the Arduino to the BC639 (220 Ohm resistor at the base) and the transistor collector/emitter to 12V+.