CdS, CdTe, Hg0.1Cd0.9Te, CdTe, and Ag films were progressively electrodeposited on ITO-coated soda–lime glass to manufacture a short- and mid-wavelength infrared photodetector. A distinctive feature of the applied electrodeposition method is the use of a non-aqueous solution containing ethylene glycol (EG) as the electrolyte in a traditional three-electrode configuration for every film deposition. Using EG as a supplementary electrolyte and using the same deposition conditions with a potential below 0.75 V for all film coatings reduces their environmental incompatibility and offers a low-cost and low-energy route for fabricating the reported photodetector. The produced photodetector has a sensitivity of up to ≈957 nm with a detectivity (D*) of 2.86 × 1012 cm Hz1/2 W−1 and a dark current density (Jdark) of 10−6 mA cm−2. Furthermore, the manufactured photodiode exhibits self-powered performance because Voc and Jsc are self-generated, unlike previously reported photodiodes. The presented all-layer electrodeposition assembly approach can easily be adapted to fabricate sensing devices for different applications.