The role of the diode D1 is to protect the transistor T. When the relay J pulls in, the diode D1 is turned off, which does not affect the circuit operation. When the relay is released, the transistor coil is turned off because of the inductance of the relay coil, so it will produce a higher induction at both ends of the coil Voltage, the polarity of this induced voltage is up negative and positive, and the positive terminal is connected to the collector of T. When the sum of the inductor voltage and Vc is greater than the reverse voltage of the collector of the transistor TD, the transistor may be damaged. The induced current generated by the rear relay coil flows through the diode D, so no high induced electromotive force is generated, and the transistor is protected.