The Tm3+ and Yb3+ codoped BaGd2ZnO5 phosphors are synthesized by sol-gel method. The strongest luminescence intensity of BaGd2ZnO5 is doped with 0.1% Tm3+ and 12% Yb3+. The highest temperature sensor sensitivity of trivalent ions doped BaGd2ZnO5 is 0.0055 K−1 at 323 K. Optical heating property of BaGd2ZnO5 under lower power density have been researched.