Generator and vertical reciprocating piston with adjustable blades and conversion of mechanical energy into electricity through a solenoid device vertically, consisting of a machine that harnesses the kinetic energy of a fluid (air or water) for power, characterized to consist of a shaft (2), straps (3), a rotable head (4), a piston (5), a group of blades (6) which can rotate about a horizontal axis, a set of bearings (10), two bars (12), with lower rack (12.1) and upper rack (12.2), a toothed wheel of ascent (11.1), a descent gear (11.2), on a common axis, with cams (7) two connecting rods (8), and crank (9), a series of compound neodymium magnet or similar magnets (13) and a solenoid (14).