The optimal composition of etchant solution and etching time for chemical treatment to obtain nanoporous Si have been determined. Influence of nanocrystal dimensions on the electrophysical and photoelectrical properties of heterojunctions has been studied. The current-voltage characteristics of nanoporous Si with various nanocrystal dimensions were measured. It was ascertained that lux-ampere characteristics have a linear range and sublinear one, which almost reaches the asymptote at the intensity of light above 10,000 lux. Nanoporous Si on the substrate of Si single-crystal has increased sensitivity to the humidity in comparison with that of metallurgical Si. The obtained results can be applied for development of highly sensitive sensors of humidity.