All-solid-stated pH sensors based on metal/ metal oxide were widely used in mixed heterogeneous environment, such as soil or soilless cultivation. In this study, an all-solid-stated pH sensor prepared by magnetron sputtering was presented, of which the working electrode was antimony, and reference electrode was Ag/AgCl electrode, and heat treated process was conducted to improving the performance of all-solid-stated planar pH sensor. The electrodes heat treated at the temperature of 100°C, 200°C, 300°C, and 400°C were tested through surface morphology analysis, energy spectrum analysis and electrochemical experiments. The results showed that the heat-treated temperature had a remarkable effect on the performance of the pH sensor. Specifically, the pH sensor heat-treated at 200°C had excellent performance, with the sensitivity 74.0 mV/pH, the response time less than 3 s, the standard deviation less than 2 mV in 700 s period. The developed sensor can be applied in pH detection in soilless culture and is promising to popularize in industrial production.