In our work, a P-type porous silicon (PSi) with orientation (100) have been prepared using the chemical etching method; the goal is to study the electrical properties of PSi samples prepared with completely different etching current (7, 9, 11 and 13) mA and glued for (15 min) anodization time. Depending on the atomic force microscopy (AFM) investigation, we notice the roughness of Si surface increases with increasing etching current because of increases within the dimension (diameter) of surface pits. The electrical and optoelectronic properties of prepared PSi, specifically capacitance-voltage (C-V), current-voltage (I-V), responsivity and detectivity, are analyzed. It had been found that electrical characteristics of porous Si samples measured in dark (Id) and below illumination (IPh) will be fitted well by the equations of thermal emission. From this point of view, Schottky barrier height (ɸB) and ideality factor (n) of made-up photodetectors were calculated. We tended to determine from I-V characteristics of a dark, and illuminations that the pass current through the PSi layer reduced by increasing the etching current, as a result of increasing the electrical resistance of PSi layer and therefore the optimum value of ideality factor is (2.7), whereas from C-V characteristic we determined that in-built potential accumulated with increasing etching current. The results show that there are clear results for better performance of photodetectors.