I have the following basic circuit:
As I was flipping the button to turn the relay on and off, I noticed sparking from the voltage meter, and it eventually caught fire, releasing the magic smoke which makes it work. On testing, it appeared that the 7805 was also destroyed.
I'm thinking that the relay was to blame here. Would adding a diode from ground to input help the situation? What else could I do to protect this circuit? (this is a controller driving an electric vehicle).