THz sensing is very important tool in biological and medical applications. In this paper, we study the possibility of creating a sensor on a subwave grating in the attenuated total reflection (Otto) configuration. Using theoretical analysis and numerical simulations, the optimal parameters of the gold grating with liquid water solutions under test were found. The sensitivity of the grating sensor has been estimated. This work is partially supported by RFBR grant №16-32-00678 мол_а.