To control relays safely with double insulation, we suggest the circuit in the figure. The optical isolator isolates the microprocessor or PC circuit from the relay drive circuit, which can operate with a voltage other than 5 V. In fact, with the use of 12 V relays it is possible to obtain better performance. 12 V relays are easier to obtain, more sensitive and can thus facilitate the assembly of the interface. The resistor R1 must have its value chosen according to the type of optical coupler used to obtain the ideal trigger point with the signal from the door at high level. One possibility to find the best value is to use a trimpot in the development of the project and then replace it with a fixed resistor. Considering that the common 12 V relays are specified for a current of 50 mA, the source must be dimensioned considering the moments when all of them are activated. Thus, for an interface where the 8 parallel port outputs are used, the source must be able to deliver the required 400 mA.