If it is connected the other way around it behaves like a regular diode and will short out the relay supply to ground.
simulate this circuit – Schematic created using CircuitLab
Figure 1. The two options.
- Figure 1a shows your suggested configuration. It should be clear that D1 shorts out the supply. The relay won't pick and either the diode will burn out or the supply voltage will collapse to about 0.7 V.
- Figure 1b shows the correct orientation. When SW2 opens a circulating current flows as shown by the green arrows.
The easiest way to think of this is that inductors try to maintain current flow.
- If the current is zero and you connect a supply the inductor resists the change somewhat and it takes some time for the current to rise to the steady-state value which is determined by the inductor resistance.
- If the current is non-zero and you interrupt it - open SW2, for example - the inductor voltage increases dramatically to a large negative value if the diode is not there. This creates a spark on the contacts or plays havoc with switching transistors. By adding D2 we can allow the current to decay safely and eliminate sparking at SW2 or presenting a high voltage to the switching capacitor.
Should it not be the other way around?
Nope!
There is a downside to adding the diode. Since the current is maintained the relay releases more slowly causing a short time delay. Adding a Zener in reverse series with the diode causes the inductor to dissipate its energy much more quickly. The reason is that the power dissipated in the diode is given by P = VI and the forward voltage, Vf for a silicon diode is 0.7 V whereas it can be whatever you want with a Zener and the higher it is the more quickly the relay will lose its energy.
The diode + Zener gives the protection of the diode but with less of a release delay.
See "A zener with series diode"? for an expanded answer on this topic.