In this work, we present the effect of the treatment of PbI 2 thin films with dimethyl sulfoxide (DMSO) vapor on the final characteristics and properties of CH 3 NH 3 PbI 3– x Cl x perovskite synthesized from a three-step approach. This is an additional step, thus, it changes the previous approach to a four-step sequence, which, for the present research, consists in the following: (1) chemical solution deposition of PbS thin films over glass substrates; (2) chemical transformation of the deposited PbS thin films into PbI 2 by means of a gas–solid reaction with iodine vapor; (3) surface treatment of the synthesized PbI 2 thin films with DMSO vapor, being this step the driving force of the present research; and (4) chemical transformation of the DMSO-treated PbI 2 thin films into CH 3 NH 3 PbI 3– x Cl x perovskite films by means of a liquid–solid reaction with a spin-coated solution mix of methylammonium iodide/chloride. We particularly present here the effect of four exposure times to DMSO vapor (5, 10, 15, and 20 min), which were compared against an untreated reference. The thin films of all the synthesized materials were uniform and strongly adhered to the glass substrate. The PbI 2 and perovskite samples were characterized by scanning electron microscopy (SEM), X-ray diffraction (XRD), and ultraviolet–visible (UV–Vis) and fluorescence spectroscopies. It was observed that all the DMSO-treated PbI 2 films present pores and, thus, show a decrease of transmittance. They also lead to subsequent perovskite samples that present blurred grain boundaries, which are less pronounced in comparison to the reference perovskite, which was synthesized from PbI 2 with no DMSO treatment. This resultant morphology, translated in a better continuity of the perovskite material, was attributed as the cause of the increased photocurrent and responsivity of the photodetector fabricated from perovskite synthesized from DMSO-treated PbI 2 film, as compared with the photodetector fabricated with the reference perovskite. Therefore, the treatment of PbI 2 thin films with DMSO vapor is beneficial for improving the photodetector characteristics of CH 3 NH 3 PbI 3– x Cl x perovskites. Image 1 • Solution/vapor/solution approach to prepare CH 3 NH 3 PbI 3– x Cl x perovskite films. • PbI 2 surface engineering with DMSO vapor to increase porosity. • Porous PbI 2 leads perovskite with blurred grain boundaries. [ABSTRACT FROM AUTHOR]