The work reports on the preparation of polyaniline/lead iodide optoelectronic photodetector on antimony tin oxide (ATO) glass (PANI/PbI 2 /ATO) for providing a low-cost light sensor in the UV, Vis, and near IR regions (wide optical range photodetector).The deposition of PbI 2 nanoparticles was carried out on the surface of PANI using the ionic adsorption deposition method. Four ATO/PANI/PbI 2 composites (I, II, III, and IV) were produced by varying the Pb 2+ concentrations (0.01, 0.03, 0.05, and 0.07 M, respectively). The chemical structure, morphology, optical, and electrical properties were assessed using different analytical tools. Scanning electron microscopy (SEM) imaging revealed the formation of a nanoporous PANI network. After PbI 2 incorporation within the PANI network, white nanoparticles formed on the surface. The average size of the PbI 2 nanoparticles was 220, 270, 280, and 320 nm for Pb 2+ concentration of 0.01, 0.03, 0.05, and 0.07 M, respectively. Moreover, x-ray diffraction analysis confirmed PANI/PbI 2 composite formation, as witnessed by the appearance of new peaks at 12.77 , 34.31 , and 38.8 characteristic of PbI 2 .Through the optical analyses, the band gap values of the PANI/PbI 2 composites I, II, III, and IV were 2.63, 2.51, 2.46, and 2.48 eV, respectively. ATO/composite III was applied as an optoelectronic device for detection the light under different intensities or wavelengths, in which the current density (J ph ) increase from 2.5 to 3.42 mA cm À2 upon increasing of the light intensity from 25 to 100 mW.cm À2 , respectively. Moreover, the J ph recorded an optimum value of 3.33 mA cm À2 at 390 nm, which decreased to 2.09 mA cm À2 at 490 nm and increased again to 3.13 mA cm À2 at 636 nm. The optoelectronic photodetector exhibited an optimum incident photon to electron conversion efficiency (IPCE) of 10.7% at 390 nm. The photoresponsivity (R) and detectivity (D) were determined to be 107 mA cm À2 and 3.38 Â 10 10 Jones,