Safety polarity circuit connection diagram

A simple electronic circuit that prevents incorrect connection of polarized sources in circuit can be made using electronic diagram below. Safety of polarity from the diagram below was dimensioned for a voltage of 12 volts. When connecting correctly voltage to terminals 1 and 2 through RE1 resting contact, diode D1 and the coil current flows once the switch closes the circuit (relay closing, established by contact or connection with device connected).
When you connect the wrong polarity of power supply, diode D1 is blocked, the relay no longer closing and power is interrupted device.
Diode D2 attenuates voltage peaks that may occur to disconnect the relay coil.
R1 resistance reduces current flowing through relay coil connected in the state, so that losses to be minimal (the resistance should be chosen according to characteristics of the relay).

Circuit Diagram: 
Safety polarity circuit conection diagram