This Letter presents a method of an optical sensor for measuring wavelength shifts. The system consists of a diffraction grating and a total internal reflection heterodyne interferometer. As a heterodyne light beam strikes a grating, the first-order diffraction beam is generated. The light penetrates into a total internal reflection prism at an angle larger than the critical angle. A wavelength variation will affect the diffractive angle of the first-order beam, thus inducing a phase difference variation of the light beam emerging from the total internal reflections inside the trapezoid prism. Both the experimental and theoretical results reveal that, for the first-order diffractive beam, the sensitivity and resolution levels are superior to 5°/nm and 0.006 nm, respectively, in the range of wavelength from 632 to 634 nm, and are superior to 3.1°/nm and 0.0095 nm in the range from 632 to 637 nm. For the theoretical simulation of the fourth-order diffractive beam, they are superior to 6.4 deg ∕nm and 0.0047 nm in the range from 632 to 637 nm.OCIS codes: 120.3180, 050.0050. doi: 10.3788/COL201614.081202.The accurate measurement of a wavelength shift plays a crucial role in many research fields, such as pressure sensing [1] , temperature sensing [2] , optical fiber communication [3] , and monochromatic interferometer applications. Especially in monochromatic interferometers, the basic Michelson interferometer consists of a monochromatic light source, a beam splitter (BS), and two mirrors. It relies on the principle of constructive and destructive interference as one mirror is fixed and the other is moved. It is indispensable to measure the wavelength variations [4] of a light source to ensure the measurement resolution. Therefore, the technique of optical sensors for measuring a small wavelength shift is becoming important [5] . In addition, the measurement methods of wavelength shifts are extensive. Several methods, including passive detection, diffraction type, and interferometric phase detection schemes, have been proposed to monitor the wavelength differences [6][7][8][9][10][11][12][13][14][15][16] . The passive detection system divides the scattered light from a Bragg grating into two parts, one of which is filtered in proportion to its wavelength, while the other is employed as a reference to compensate for intensity variations. The diffraction-type schemes evaluate the wavelength difference by an intensity variation of the first-order diffraction light beam from a diffraction grating. However, the measurement accuracy of these methods may be decreased because of the surrounding light and the scattered light interfering with the associated light [16] . Conversely, our interferometric phase detection scheme can detect the wavelength based on the measurement of phase variation and does not have these two aforementioned shortcoming [16] . This study demonstrates a total internal reflection (TIR) heterodyne interferometric sensor for measuring wavelength shifts and derives theoretical equations. The experimental ...