The results of computer simulation of optical properties of one-dimensional (1D) photonic crystal with defect, based on semiconductor-dielectric layers are presented. As semiconductor silicon and germanium were used. The influence of temperature on spectral position of defect transmission band was studied. It was shown that for photonic crystal based on silicon temperature sensitivity is 0.07 nm/K and 2.6 dB/K. For photonic crystal based on germanium --- 0.37 nm/K and 7.8 dB/K. This makes such photonic crystals promising for use in temperature sensors as sensitive element. Keywords: temperature sensor, photonic crystal, photonic bandgap, transfer matrix.