Arduino PWM pin and 5V fan speed control

Hi,

Despite a lot of readings in this forum, I didn't find anything (?) about the speed control of a 5V fan...so I'm posting.
I made a first try, with a 2N2222 on the pin 11, with a 2.2k resistor between base and pin 11 and a 12V fan. It works and I can control the fan speed through a very simple program.
But when I replace my 12V fan by a 5V fan, it works only when the value on the PWM pin equals 255 (i.e full out). When it goes below this value, the fan stops and nothing more happens except from a very low "bzzzzzzzzzzzzzz"... I tried both with an external power supply and with the 5V pin from the arduino.
My question is: why this happens ?
Do the load drived by the transistor have to be greater than the voltage of the "command" circuit ?

Thanks for your answers !

Are you trying to drive the 5v fan directly from pin 11 instead of using the 2N2222 sinking driver?

No. I've only replaced the fan and kept the same other components and schematic.

Really? Huh! That really should work.

What is your PWM period? Have you tried shorter or longer periods?

Here is my code:

int ventiloPin = 11;
int incomingByte = 0;      
int val = 255;

void setup()
{
  Serial.begin(9600);      
  pinMode(ventiloPin, OUTPUT);   
}

void loop(){
  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    if(incomingByte == '+' && val<245) {
      val += 10;
    }
    if(incomingByte == '-' && val>10){
      val -= 10;
    }
  }
analogWrite(ventiloPin, val); 
}

All the values below 255, passed to analogWrite, give the same result, described in my first message...

up :-/