Identifying PWM wires

I have a 4-pin PWM fan but it has no green wire! So, I checked the board beneath the fan to see what are the names of the wires. I found this:

red (P)
blue (F)
yellow (+)
black (probably -)

The code I use is

void setup()
{
}
void loop()
{
   analogWrite(8,110);   // I connect pin 8 to the red wire
}

The value below 100 doesn't turn on the motor and the value above that (say 140) to 255 actually doesn't change the speed. I think it is running at constant speed. The fan is small (12V, 110mA) and quiet so I have to put my ear near it but I think the fan speed doesn't change.

Do you have any idea on that? Did I made a mistake regarding the wires?

Connecting a PWM to the red wire (fan power) could fry the Arduino.

A 4-pin computer fan is designed for a ~25Khz PWM signal.

AFAIK wired like this.
Red wire to a 12volt supply.
Black wire to ground/negative of that supply, and to Arduino ground.
Yellow wire is RPM info/feedback. Needs pullup resisor.
Blue (or green) is the PWM input.

Try entering "4-pin fan" in the search box on top of this page.
Leo..

Well, I tried with an LED to see what is going on. It seems that

red (PWM)
yellow (12v)
black (0)

with that configuration, I can write different analog values to the PWM port and the LED blinks.

So, the blue wire is the tach (sens) input.
Then I connected the fan to the board and was able to control the speed and read the sens information.

Thanks.

Wawa:
Red wire to a 12volt supply.
Yellow wire is RPM info/feedback. Needs pullup resisor.

If the yellow wire has the mark + on the fan i'm pretty sure it's the 12V! And that is the correct 12V color for atx.

Does the fan still has the 4p connector attached? The connector pin order is GND - 12V - Tacho - PWM

Well actually the order of GND and 12V are correct but not the last two one.

This fan looks like

GND - 12V - PWM - Tach(sens)
Black - Yellow - Red - Blue

I posted a picture of this fan so I don't know if it really follows the standard!

Anyway thanks...

But are you sure the red is indeed the PWM... If it follows the pinout then it should be the blue one...

AFAIK a 4-pin fan does not run if you just connect power and ground.
It needs 5volt PWM (or DC) on the PWM pin to work.
I could be wrong, because 4-pin fans have intelligent startup.
Google "intel 4-pin fan pdf"
Leo..

Wawa:
AFAIK a 4-pin fan does not run if you just connect power and ground.
It needs 5volt PWM (or DC) on the PWM pin to work.
I could be wrong, because 4-pin fans have intelligent startup.
Google "intel 4-pin fan pdf"
Leo..

as per fan specs, if pwm pin is left open, fan will run at full speed.