With the source taken care of [Glitch] uses an optoisolator for both protection and level conversion. After working the bugs out of the design he was able to control the relay using 3.3V, 5V, or 12V.