In this paper, we experimentally studied the effect of AlN spacer layer on optical and electrical properties of AlGaN/GaN high electric mobility transistors (HEMTs) grown by metal organic chemical vapor deposition method. For AlGaN layer in HEMT structure, the Al composition of the sample was determined using x-ray diffraction and photoluminescence. Electrolyte electro-reflectance (EER) measurement not only confirmed the aluminum composition of AlGaN layer, but also determined the electric field strength on the AlGaN layer through the Franz-Keldysh oscillation phenomenon. This result indicated that the electric field on the AlGaN layer could be improved from 430 to 621kV/cm when AlN spacer layer was inserted in HEMT structure, which increased the concentration of two dimensional electron gas (2DEG) and improve the mobility. The temperature dependent Hall results show that both the mobility and the carrier concentration of 2DEG would decrease abruptly causing HEMT loss of function due to phonon scattering and carrier thermal escape when temperature increases above a specific value. Meanwhile, our study also demonstrates using AlN spacer layer could be beneficial to allow the mobility and carrier density of 2DEG sustaining at high temperature region.