Conversion of potential energy to electric energy