Controlling switch with relay driver

The circuit above is  a circuit of drivers to control high voltage using the relay. Relay is controlled by an NPN transistor , its that works on 5V voltage and has diode in it, if the relay does not have s diode should be given with diode 1N4007 . Pin relay to  move the switch connected to V+ 5V and other is connected from driver NPN transistor , the base od the transistor may have input such us from circuit of infrared to control the distance, or with some other input.

After the transistor was input  and the collector had output a voltage of the switch relay will work, and voltage that in switch relay ready to use. To cut off switch eliminates enough voltage input at the base transistor , the collector will not remove the voltage , and switch are automatically disconnected.