I am using a cheap function generator to pulse a coil. I am using a square wave, 12Vpp supply at 10 Hz. I have read you need to protect the circuit using a diode because of flyback voltage. I tested an LED for this purpose. It lit up applying current to both the cathode and anode. Is this because of the square wave, and what would be the best component to use ?