Optical thermometers have been widely investigated. Here, the temperature behavior of second harmonic generation (SHG) in periodically poled lthium niobate (PPLN) substrates is analyzed; indeed, the QPM tuning in PPLN devices and the obtained SHG efficiency depend on the crystal thermal expansion and dispersion, particularly in the case of guided propagation. Therefore, such devices are suitable to realize optical thermometers for demanding applications. This investigation originated with the request of a thermometer to be installed on the pantographs of high-speed trains. Therefore, it must be sturdy and reliable, but it has even to work in an EMD environment. The temperature behavior of the SHG was theoretically modeled and experimentally validated at 1550 nm, in both bulk propagation and APE channel waveguides. In the first case, by using a 10-mW source, which was obtained from a laser diode and a fiber amplifier, an accuracy of 0.3 C was found. The pump power was about three orders of magnitude smaller in guided propagation. In view of testing on the trains, our investigation resulted in the design of a device without mechanical contacts with the input and output fibers. Since it works in free propagation, there are no serious alignment and packaging problems. The performances, which are expected to be the same of our tests, widely satisfy all the requirements for working effectively in a strongly hostile and EMD environment and for giving accurate measurements on a wide range of temperatures.Index Terms-Optical termometer, periodically poled lthium niobate (PPLN), secondary harmonic generation (SHG), train pantographs.