Hi guys, I want to be able to control the speed of the PC fan through arduino and I have made everything just like in this site: http://www.instructables.com/id/Use-Arduino-with-TIP120-transistor-to-control-moto/
But it doesnt works... Changes that I made are that I'm using 12V power supply from PC motherboard pins and that's all. I have two fans one is Nexus SP802512L-03 12V 0.15A and another is ZALMAN ZF1225ASH 12V 0.35A. The nexus doesn't work at all just sometimes rotates 5 degrees to one side and goes back to start position, and the ZALMAN keeps spinning full speed I can't control it. I have tried to connect a DC motor instead of fans but the motor does the same thing just keeps spinning full speed...
Maybe someone knows there can the problem be? I'am new with arduino, it would be nice if someone could help me. Thanks Code is
// Define which pin to be used to communicate with Base pin of TIP120 transistor
int TIP120pin = 11; //for this project, I pick Arduino's PMW pin 11
void setup()
{
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
analogWrite(TIP120pin, 255); // By changing values from 0 to 255 you can control motor speed
}
void loop()
{
}
Solved. 5 out of 7 resistors that I have didn't worked, so when I put in the one which was working it worked perfectly, just I have a little problem with Nexus fan it still doesnt works, if I connect it to 12v pin directly it works, but it doesnt works through arduino, I think maybe some voltage is consumed by wires and breadboard and the nexus cant get enough voltage and current, can that be the problem?
I think you will find in many cases the Brushless Controller inside the fan will get confused especially at some of the slower settings when you attempt to PWM. The manufacturer list the DC voltage 10.2 ~13.8 Volts. When you go lower, all bets are off!
@Runaway Pancake thanks for your suggestion! But it didn't worked for me anyway... @rmetzner49 I do believe that the problem is with my fan, because Zalman worked, I am not able to control the speed of the fan so much, but for me its fine if it just stops rotating and starts when its needed.
If it's not working then you're not connecting it up right.
And you'd do a lot better to get rid of that tip120 and use an ordinary NPN transistor.
But if you're happier with a heap of non-fuctionality then be happy with a heap of non-functionality.
I'm so sick of these jackwad "tutorials" that people dig up that teach wrong things.
Using the circuit**1** and sketch linked to in Reply #2, I have the same results as you see demonstrated in the youtube video there also - using a TIP142 (even though I don't like the idea of using it, and it's $1.50 vs 10¢).
Maybe this guy's fan is radically different from my own (but I doubt it.)
What do I have to do here to end the "can't" chorus and the "it won't work" lamentations ?
Run every point from 1-255?
Easy there Pancake ... not trying to shoot your puppy. It's quite possible there are different schemes of control used by the manufacturer in different brands. If you have this working and it "runs every point (1-255) that's great. All I'm suggesting is there has to be a brushless controller in the fan that commutates the windings and it may be expecting a steady state DC voltage. If it has undervoltage lockout, don't be surprised if some brands work and others don't.
And I cannot help but think that the fault lies in the implementation of the plan.
It's the old "missing ground" or some other failure to execute, getting the wires right.
I see proof of nothing not working, just some garbage fritizing thing, and I provide proof of things working - so, manic9: QUIT.
@ Runaway pancake I did the circuit that you have suggested and as I said it changes nothing visual because nexus fan is still not working and the zalman works the same as before..
Your sketch, at the beginning has no place where you are varying the fan speed at all - which is why it stays on all the time.
That sketch of mine in the other link does have some analogWrites to implement variable speeds.
Have you tried that?
If not, why not?
If not, would you mind giving it a try? I have added it below.
It uses pin 5. If you try it, please use pin 5.
Please try it with both fans (first the one, then the other.)
And you also mentioned that your motor doesn't vary either.
[I think that yellow lead on your Nexus is for speed when used that way. If it turns on with 12V applied then then leaving that unconnected should not botch the rest.]
Nexus don't work and on Zalman you can slightly see that the speed changes, the only thing that I noticed that for example if the fan is not rotating and you upload the sketch for example analogWrite(fanpin, 100) it doesn't start spinning, only if you give him a little push with your hand it starts spinning and then everything works ok. So all things considered I do believe that there's nothing wrong with the sketch or circuit only the Nexus fan is not working, probably because it is very sensitive and can't run a little less than 12V???
EDIT: maybe someone knows why do the zalman fan starts making noise when you give him lower voltage for example if I do analogWrite(pin, 255) it works with no sound, and if I give it analogWrite(pin, 180) it starts making little noise like continously beeping or smth..
manic9:
it doesn't start spinning, only if you give him a little push with your hand it starts spinning and then everything works ok.
It is a consequence of brushless motor design that you need to give a fan 100% duty cycle PWM for a few hundred milliseconds upon startup from a dead stop. Once the fan is spinning with some physical momentum, then you can reduce the duty cycle to whatever you want it to be.
only the Nexus fan is not working
Nope, that is expected behavior. Adjust your software and all should be good.
manic9:
EDIT: maybe someone knows why do the zalman fan starts making noise when you give him lower voltage for example if I do analogWrite(pin, 255) it works with no sound, and if I give it analogWrite(pin, 180) it starts making little noise like continously beeping or smth..
This is likely a consequence of the PWM frequency output by the Arduino. The simplest solution is probably to grab your biggest electrolytic capacitor with a sufficient voltage rating, and put it across the fan's + and - wires observing the capacitor's correct polarity. It will help smooth out the voltage pulses and will probably eliminate the noise.
So the fan should start spinning because I give him the starting moment from as you said dead stop but nothing happens, maybe you can tell me what to do to make it work?
Let's eliminate the Arduino from the equation. Your output pin may have been damaged in a prior incident. Disconnect the transistor's current-limiting base resistor from the Arduino and connect it (the resistor, that is) to the +5VDC power rail. This should turn the transistor and the fan 100% on. Measure the voltage across the fan + and - wires while you are doing this -- it should be the same (or only slightly lower) than the reading on the 12V power rail.
What value of resistor are you using on the transistor base?
tylernt:
Your output pin may have been damaged in a prior incident.
The transistor may be bad (too).
Never got the motor to work right either (see original post.)
Then again, I can't get ANY feedback on using the sketch that I pasted in for him.
tylernt:
What value of resistor are you using on the transistor base?
@Runaway pancake, your sketch works fine, when I connect Zalman fan I can see speed variation every 2.5s, Nexus just don't work and that's it. I don't think that my output pin is damaged I tried several of them. It might be the transistor, I will get new transistor and capacitor on monday and I will post the results.
Well, if you say that the Zalman and your motor work with the TIP120, then that's that.
You have a fan that works according to plan, I have two that work, too. So, maybe this Nexus thing is, somehow, different.
If you're going to buy a transistor then do not get another TIP120. Just get a common junction transistor (2N3904, 2N2222, PN2222, etc.)
Yup, everything works fine now, I now try it on Nexus 120mm fan same model as 80mm just bigger and it works perfectly, only disadvntage is that when I use Zalman fan at lower speed it starts beeping as I said before I added a 2.2uF capacitor, but it isn't very helpful, maybe I added it in wrong place?