Note: These relays are not recommended for controlling X-Carve accessories/spindles.
This is a simple way to add a relay to your micro controller. It runs off 5V and most controllers can easily drive it. The circuit is optically isolated from the relay, so your controller is protected from voltage spikes and surges. It does this by shining light across a gap to a sensor. No electrically conductive items cross this gap.
There are two ways to use these relays. See the images for connecting the circuits.
In isolated mode the relay is completely electrically isolated from the control side. Large voltage spikes, shorts, etc. will not affect your controller. Therefore you need two separate voltage sources. One is for the relay side. This is put in the terminals closest to the edge. Use the two center terminal labeled Positive Relay Coil Power and Negative Relay Coil Power. The next column of terminals is for the controller side of the isolation. You need to supply your 5V, GND and signal from your controller on these.
Sometimes you don’t have a second power supply handy and want to use the 5V and GND from the controller for both sides of the isolation barrier. You can do this by using jumpers to connect Positive Opto Input Power to Positive Relay Input Power and connect Negative Opto Input Power to Negative Relay Input Power on the column of terminals closest to the edge.
See the “Typical Application” in the images section above. You need to provide power and ground the the opto and a control signal. The opto inverts the logic so a low signal (GND) energizes the relay.