Capacitive displacement sensors provide non-contact, extreme resolution, and absolute accuracy thickness measurements. However, if the resistivity of a target substrate is within 105-107 ohm-cm, an uncertainty will appear in the thickness measurement. The common solution is to adjust the resistivity to be outside the range by implanting dopants and followed by an activation anneal, but this will unavoidably lead to changes in the material properties and morphology. Here, we exploit the photoconductive effect to generate sufficient high number of electron-hole pairs, thereby temporarily decreasing the resistivity and thus enabling the capacitive displacement sensor to accurately measure the thickness at nanoscale resolution. After the measurement is complete, the resistivity of the substrate will return to its original status. The photoconductive effect can be simply induced via light irradiation at the sensing point, which narrows or eliminates the gap in the measurement range of capacitive sensors to include high-resistivity substrate.