The paper conducts optimal design for reflective intensity-type optical sensing. It designs two holes on the back of sensor probe which reduces system damping due to diaphragm and space air. It sets reference circuit and realizes the light intensity compensation by the way of comparing ratio specific value of measuring circuit and reference circuit. According to the symmetry requirement of photoelectric detection circuit, the paper designs photoelectric detection treatment circuit. The experiment shows that intensity compensation method can compensate well the power fluctuation of light source and temperature drift caused by long-time operation of sensor.