I am trying to build a relay circuit. It is DPDT.
One relay contact on NC is connected to a battery, through a NO momentary switch which goes through the relay coil. This is just for initial mains free triggering.
The second relay contact on NO is connected to mains which runs a switch mode power supply to power the relay and run a motor.
I have an issue where I don't know if I need a flyback diode as well as a short delay capacitor across the relay coil. The capacitor is there to keep the relay open just long enough to allow the switch mode power supply to energise and provide current to keep the relay open. A momentary NC switch between the power supply and the relay is used to disconnect the relay and shut down the circuit. The motor bleeds off any excess power remaining in the power supply otherwise the relay gets reactivated.
I have also had issues where the circuit seems to get stuck open despite all power to the relay coil being completely disconnected.
Relay is a 5v coil with mains rating (240V) on the switches at 250mA.
Power supply uses 240V 5mA.
There is a 1N4007 diode reversed across relay.
Capacitor is 470uF electrolytic diode.