Generation of magnetic fields during inflation is a promising mechanism for the origin of the observed large scale magnetic fields in the universe . Among several attempts , a popular model is one where the inflaton and the electromagnetic field are coupled through a coupling function f leading to a term in the Lagrangian density of the form , f ^ { 2 } F ^ { \mu \nu } F _ { \mu \nu } . A number of potential difficulties with such models have been raised in the literature . In our earlier work , we have suggested viable models of inflationary magnetogenesis which avoid these problems and at the same time can lead to either nonhelical or helical magnetic fields of astrophysical interest . Our models require a low energy scale for inflation and reheating ( reheating temperature , T _ { R } < 10 ^ { 4 } GeV ) and generate a blue spectrum of electromagnetic ( EM ) field which peaks around the horizon scale of reheating . We show here that the anisotropic stress associated with these EM fields naturally source the production of a stochastic background of Gravitational waves ( GW ) with frequencies in the range of tens of nano Hertz to milli Hertz . These two extremes of the range can be probed respectively by pulsar timing arrays ( PTA ) experiments and the upcoming Laser Interferometric Space Array ( LISA ) . The peak value of the GW spectrum energy represented by d \Omega _ { GW } / d \ln k is 10 ^ { -6 } for the models which lead to nonhelical primordial fields and 2 \times 10 ^ { -6 } for the helical case for T _ { R } = 100 GeV . In this case the spectrum peaks at a frequency 30 \mu Hz for non helical case and at 40 \mu Hz for helical case . These values are obtained when the ratio of EM energy density to the cosmological density at reheating \epsilon \sim 1 and decrease approximately as \epsilon ^ { 2 } for smaller values . The amplitude is similar for a lower value of T _ { R } , but the frequency at which the GW spectrum peaks decreases as T _ { R } . The gravitational waves generated are unpolarized if the EM fields are nonhelical but are circularly polarised for helical primordial fields . If detected in future these gravitational waves will provide a unique probe of such models of inflationary magnetogenesis .