Homogeneous and transparent BaTiO3 thin films were prepared by sol–gel dip coating method. The prepared BaTiO3 thin films were annealed in air and O2 atmosphere at different temperatures. The annealed BaTiO3 thin films were amorphous in nature. Scanning electron microscopy (SEM) revealed the nucleation and particle growth on the films. Energy-dispersive X-ray (EDX) analysis data revealed the adsorption of oxygen atoms in the BaTiO3 film. The direct energy band gap was found to vary (3.84–3.58 eV) as functions of annealing atmosphere and temperature. Photoluminescence (PL) revealed intense emission peaks at 393 and 675 nm. Quenching of PL intensity was observed in films annealed at high temperature and in O2 atmosphere. This is due to reduction in the oxygen vacancy by the adsorption of oxygen in the film. Luminescence spectra also have been related to the results obtained by SEM and EDX analysis. The change in luminescence intensity of BaTiO3 thin films makes it suitable for optoelectronic temperature sensor applications.