Another one protection with uPC1237.
R2+ and R4+ muste be selected from uPC1237 datasheet diagram for required power supply.
R5+ must be calculated coressponding to power supply and internal resistance of relay.
For Example We Have:
VCC = 48VDC
RE1 = 1440R
URE1 = 24VDC
-----------------
IRE1 = URE1 / RE1
IRE1 = 24VDC / 1440R
IRE1 = 16,666mA
R5+ = (VCC - URE1) / IRE1
R5+ = (48VDC - 24VDC) / 16,666mA
R5+ = 1440R we take closer resistor value of 1k5
R5+ Power Calculation:
--------------------------
PR5+ = URE1 * IRE1
PR5+ = 24VDC * 16,666mA
PR5+ = 0,4W (We take 5x times bigger wattage resistor to be on safe area) = 2W