The LM35 is a high precision temperature sensor. It has an analog output, which is linearly proportional to the surrounding temperature. Just hook it up to a ADC pin on your microcontroller to get temperature readings.
www.ti.com/product/LM35
www.ti.com/product/LM35