Modified version of makeitbreakitfixit, link below, PWM fan control via temperture. Modifications includes adding few more states for more control of temp+PWM signal.
Original TEXT:
Arduino powered temperature sensor and PWM fan controller This project has a detailed step-by-step blog post found here: https://makeitbreakitfixit.com/2016/07/02/thermistor-and-pwm-speed-controller/