In this paper, methyl-orange-doped polystyrene (PS) microspheres covered with gold and silver nanoparticles (NPs) have been synthesized. The optical and structural properties of the porous polystyrene films before and after incorporation of Au and Ag nanoparticles were investigated using X-ray diffraction (XRD), scanning electron microscope (SEM), atomic force microscope (AFM), Fourier transformation infrared spectrophotometer (FT-IR), and UV-Vis spectrophotometer. The optical data showed that the optical energy gap of PS film was increased from 2 to 3.4 eV and to 3.5 eV after being filled with Ag and Au nanoparticles, respectively. The electrical and photoresponse properties of Ag-PS/p-Si and Au-PS/pSi heterojunctions were studied. The rectification characteristics of the junction were improved after nanoparticle incorporation. The photoresponse results confirm the presence of two peaks of response located at 450 and 900 nm. The Au-PS/Si heterojunction gave the best photosensitivity.