So basically, assuming the PWM part has 255 steps, when temp = 90 the PW would = 0, and when its 120 the PW = 255 ?
So that's a 30 degree range represented by a 255 step. 255 / 30 = 8.5
That would mean that for every degree the PW is 8.5
You would then need to write your code so that if temp < 90 PW=0 and if temp >120 then PW =255 to give you your range. I would then use a variable to give you the 30 degree steps you need, something like range value = temp - 90, and then use this for the steps, sorta PW= range value X 8.5
This may not be the ideal way, and I'm sure it could be simplified, but it's the way I would approach the problem. You need to choose a PIC and set the resolution of the PWM you wish to use, the more steps the smoother the fan control will be
EDIT:
just re-read your post, you want the fan to run at 50% at 90 degrees, if so then wouldn't that be a simple case of a statement like
If temp >90 and <120 then PW=127
If temp > 120 then PW=255
Hope this helps
Bookmarks