Control 3-pin BLDC PC fan directly

Hello,

my question is how do I control speed of a fan I got from an old PC. It has 3 pins and label says it is 12V.

When I connect ground and voltage to my Freaduino UNO (fully Arduino compatible), the fan starts spinning even with no code, because as I measured, the board outputs 5V all the time.

When I upload code

void setup() {
  pinMode(10, OUTPUT);
  analogWrite(10, 255);
}

void loop() {}

and put the voltage wire in a signal pin, it works, but with extremly low voltage, so it is unusable.

The third wire from the fan doesn't seem to do anything right now.

The above can be ignored, How do I Set a fan RPM if it has 3 wires, using only Arduino, power supply and wires?

I do Not want to Read the RPM.

Thank you.

Stepan214:
The above can be ignored, How do I Set a fan RPM if it has 3 wires, using only Arduino, power supply and wires?

You dont.

The third wire just reads back the RPM. The RPM is determined by the voltage you supply to the fan, at least that's the only way I interacted with PC fans. The arduino itself can only output 5V, not 12V.

You would need some kind of controller in between (BLDCs are inductive loads afaik and you shouldn't drive them directly with the arduino anyway), but that seems to be out of the scope of your question.

Alright, that third-wire-thing helped me a lot, now I know I really need some another parts. Thank you.

Alright, quick solution I found: I used a relay and created another circuit. Now the fan is powered using a 9V battery and connected to the relay. However, I cannot control anywhere between stop and full speed (9V, not technically full speed, but works for now), but that is also not a problem right now.

Because you need to control the voltage to control the speed. Typically PC Fans are run between 7V and 12V. Build a circuit that allows the Arduino to change the output voltage of some driver/etc. then you will be able to deduce the rpm from the voltage you supply. Or use the third wire that should give you the rpm.

A 4-wire fan has a speed control input, but 3 wires don't, I believe.