I have used a 555 timer to provide a PWM signal to the fan allowing the speed of the fan to be controlled using a potentiometer. I have included the schematic to help you build the circuit. I chose to build mine on some perf board but you could build it on a PCB if you like.

Setting the temperature 

The circuit uses a thermistor to measure the temperature. To make the fan turn on at the temperature you want you will need to do some simple calculations. The calculations are shown on the image. The transistor turns on at 0.7v so the Vout need to be at 0.7v for the fan to turn on. I used a 10k thermistor this means that at 25 degrees the resistance is 10k I have included a graph to show the resistance at different temperatures.

As I wanted my fan to turn on when the temperature reached 40 degrees the resistance will be 6k this means that I will need to adjust the potentiometer to 400 ohms to get above the 0.7V threshold.  



Once you have set your potentiometer  to the correct resistance yo can connect the fan and power the circuit with 12 volts. Now when the thermistor reaches your set temperature the fan will turn on. 

Acknowledgement

I thank LCSC Electronics for the partnership.

LCSC Electronics Is China's leading Electronic Components Distributor. LCSC sells a wide variety of high quality electronic components at low prices. With over 150, 000 parts in stock they should have the components you need for your next project. Sign up today and get $8 off on your first order.

Website

Check out more of my other projects on my website.