Fan speed controller according to temperature using arduino
First, problems with the circuit:

You say you want to control fan speed but there seems to be no provision for either analog control or PWM.

PWM would make sense, but then you wouldn't add deliberate filtering to the signal.  C1 (Argh! No component designators.  I'll make them up and you'll have to guess.) and R1 will somewhat filter individual pulses.  You don't want that.  You want the transistor to spend as much of its time as possible fully on or fully off.

1 k&Omega; seems quite high for R1.  The digital output apparently goes to 5 V.  That means the base current is 4.3 mA when the digital output is high.  I didn't look up BD139 since you didn't supply a link to the datasheet, so let's say the transistor can be counted on to have a gain of 50.  That only allows for 215 mA of current thru the fan.  Sounds low.  Maybe that's enough, but you need to check this.

1N4007 is totally inappropriate for a flyback catch diode, especially if you plan to switch the fan on/off frequently, as would be the case with PWM.  You want something with very low reverse recovery time, like a Schottky.

You forgot to connect power to the microcontroller.  These things can't do magic.  They require power, within spec, to operate.

Once you do connect power, you also have to add a bypass cap from each power pin to ground.



As for debugging your problem: OK, the speed of the fan doesn't change.

So stop and actually think about that and devise ways to determine what might be the cause.  Is the temperature sensor not producing a different output as the temperature changes?  What is coming out of pin 11?  Is it changing and the fan not responding, or is it not changing?

What is the firmware doing?  Can you have it output the measured temperature value somehow?

You say the fan speed doesn't change, but is it stuck on low, high, somewhere in between?  Debugging is about looking at the symptoms and devising tests to divide the system into parts that seem to work and those that might not be working.  Just giving up and saying it "doesn't work" has no place in engineering.