Alternative ways to catch an inductor's flyback current
The capacitor as shown has a couple of problems.  First of all, the peak current when the relay is switched on will be much greater than without the capacitor.  Secondly, the combination of the capacitor and inductor may cause "ringing".  Adding a resistor in series with the capacitor will mitigate those problems.

Another approach would be to use a capacitor with a resistor in parallel with it and a diode so that current can flow from the coil to the cap but not vice versa.  This approach will avoid having the cap waste power when turning the relay on; if the relay is switched on and off repeatedly before the cap significantly discharges, the cap voltage will increase but this in turn will help it dissipate energy faster.  A caveat with this approach is that the relay will be release more quickly when the cap has a higher voltage than when it does not.

A final suggestion would be to use both high and low side switches along with a couple of diodes; using that approach would cause the energy stored in the relay to feed back into the supply.  This would cause the relay to release more quickly than it would with many other flyback approaches, and if the relays are switched on and off frequently this approach would improve energy efficiency.  One caveat is that one must ensure the supply has adequate filter caps to accept the energy supplied by the relays.







simulate this circuit &ndash; Schematic created using CircuitLab

As shown, the circuit will switch the "relay" (1 1mH coil) "on" and "off" cleanly.  If one closes the switch (right-click, select "properties", and then set the state to "closed") and reruns the simulation, the relay's current will dissipate much less quickly (which will in turn mean that the relay will respond more sluggishly).