The invention essentially consists in the use of melanins, melanin precursors or melanin derivatives, melanin variants, melanin analogues, natural or synthetic, pure or mixed with organic or inorganic compounds, metals, ions, drugs; as water electrolyzing material, using as sole or main source of energy, natural or synthetic light, coherent or not; in the systems of hydrogen production from water, known as photoelectrochemical systems. These systems integrate as semiconductor material and a water electrolyzer inside a monolithic design, to produce hydrogen directly from water, using light (between 200 to 900 nm) as the main or sole source of energy. At least to basic criteria had to be met: one was that the system or light absorbing compound should generate enough energy to start, lead and complete the photoelectrolysis reaction, being economical, stable and lasting in a water system, requirements met by melanins, representing thus an important and critical advance to solve the central problem of photoelectrochemical designs. The procedure can be applied to generate hydrogen, oxygen and high energy electrons, or the opposite sense, i.e., synthesizing water from the union of hydrogen and oxygen, generating electricity; it can be coupled to other processes, generating a multiplication effect; it can also be used for reduction of carbon dioxide, nitrates and sulphates or others.