Porous silicon (Psi) has recently attracted considerable attention because of its unique optical and structural properties and capacity to be used in various applications. Due to the importance of this material, we have investigated the infiltration of trivalent erbium ions (Er3+) into silicon-generated pores using the electrochemical approach. The infiltration of Er3+ ions will be done simultaneously with the forming of porous silicon films on p-type (100) silicon substrates. Generating the porous layer can improve the evenness and integration of Er inside the material. During infiltration, Er3⁺ ions can also undergo reduction or co-deposition with other elements at the cathode. The infiltration studies were conducted while subject to the influence of the current density (15–30 mA/cm2). The results showed that the emission of photoluminescence in porous silicon filled with erbium was caused by the presence of Er silicate and Er oxide that developed within the silicon pores during the electrochemical reaction. The reason for introducing rare earth ions is their exceptional optical characteristics, encompassing distinct emission lines and extended lifespan. We comprehensively investigate infiltration and outline the electrochemical etching parameters necessary to create porous silicon. Rare earth ions exhibit exceptional optical luminescence characteristics, displaying a diverse spectrum of optical spectra over the infrared, visible, and ultraviolet regions.