In this work, grain boundary (GB) potential barrier (
Δφ
GB), dopant density (Pnet), and filled trap state density (PGB,trap) were manipulated at the nanoscale by exposing the fabricated perovskite films to various relative humidity (RH) environments. Spatial mapping of surface potential in the perovskite film revealed higher positive potential at GBs than inside the grains. The average
Δφ
GB, Pnet, and PGB,trap in the perovskite films decreased from 0% RH to 25% RH exposure, but increased when the RH increased to 35% RH and 45% RH. This clearly indicated that perovskite solar cells fabricated at 25% RH led to the lowest average GB potential, smallest dopant density, and least filled trap states density. This is consistent with the highest photovoltaic efficiency of 18.16% at 25% RH among the different relative humidities from 0% to 45% RH.