The effects of Electrolysis in water and how to minimize this effect?

MAS3:
A piece of carbon was used, but i forgot why.

Because when you use a metal anode you will slowly dissolve the anode. Think of electroplating. But graphite won't oxidize to anything soluble and your graphite rod is not going to corrode away as you apply current.