Environment friendly separation of optimistic and unfavorable prices is crucial for creating high-performance nanogenerators. On this article, we describe a technique that was not beforehand demonstrated to separate prices which permits us to manufacture a magnetic vitality harvesting gadget. The magnetic area induces the migration of the cellular magnetic counterions (Dy(NO3)4−) which establishes anion gradients inside a layer of polyionic liquid micropores (PLM). The PLM is covalently cross-linked on which the optimistic prices are mounted on the matrix, that’s, motionless. In a tool with a construction of Au/dielectric//mag-PLM//dielectric/Au, the cost gradient is subsequently remodeled into the output voltage via electrostatic induction. Eradicating the magnetic area results in the backflow of magnetic anions which produces a voltage with an identical magnitude however reversed polarity. The parameters in fabricating the magnetic PLM resembling photoinitiator focus, UV irradiation time, water therapy time, and temperature are discovered to dramatically affect the scale of micropores and the efficient focus of magnetic anions. Beneath optimized situations, an output voltage with an amplitude of roughly 4 V is lastly achieved. We count on this new methodology may discover sensible functions in additional enhancing the output efficiency.