This work presents a didactic proposal to study atmospheric pressure. The introduction of technological resources in physics teaching is ever-increasing today. In this context, access to smartphones proves an accessible tool due to their massification and the possible uses of their built-in sensors. Therefore, we choose to use a smartphone as a barometer to measure the atmospheric pressure. We suggest experiments to measure atmospheric pressure as a function of height and time that can be easily reproduced by students in environments outside laboratories. The experimental results are compared with those provided by a meteorological station of the Company of Environmental Sanitation Technology of the State of São Paulo. Determining the atmospheric pressure variation as a function of height also allowed us to estimate the Boltzmann constant, thus establishing an experiment that can be introductory in statistical physics. Other than stimulating the practice and understanding of graphical analyses of experimental results, the proposed experiments serve as a deeper understanding of the atmospheric pressure phenomenon than that usually found in textbooks, proving to be a robust and suitable tool for physics teaching at an undergraduate level.