As temperature detection is widely required in industrial production and the optical fiber sensor has such characters as simple structure, small size, all-fiber-based, remote measurement and easy to use, we propose a method for the temperature measurement based on the semiconductor temperature-absorption principle. An optical spectro-grating is used to analyze the sensor signals, and a position-sensitive-device is used to record the measurement results. The measurement principle of the sensor system can be described as follows. When a broad-band light source is input, the absorption edge of the semiconductor material will shift with the varied temperature, resulting in the loss of some light with certain light wavelengths if the broad-band light passes through the semiconductor material. An optical spectro-grating is used to split the remained light into different blazed angles due to the wavelengths. A position-sensitive-device is used to record the edge of the light spot, which is varied versus the measured temperature. Sensor structure and measurement principle are introduced. The feasibility is explained theoretically and results shows that temperature measurement resolution of 0.05 degrees C can be obtained.