This is dodgy:
The semi-colons on the if statements should go - as it is, both your digitalWrites get executed every iteration of loop. Not that it matters much, because the analogWrite gets executed unconditionally immediately afterwards.
If you did indeed hook your temp sensor up to 12V, you may well need a new one - it maxes out at 5,5V
Your frizzing diagram doesn't look right - as drawn, you seem to have both legs of the 330 resistor connected together.