Opto-isolators
Opto-isolators are used for the transmission of signals between components while maintaining electrical isolation.
An opto-isolator is a small LED in close proximity to a phototransistor. The LED is driven by the transmitting circuit and an appropriate resistor is necessary, see the opto-isolator data sheet for assistance is sizing this. The phototransistor drives the receiving circuit. Opto-isolators are most effective for binary switching operations. Analog signals need a more complex transmission method such as pulse width modulation.
The opto-isolators in the mechatronics lab (4N27) have a connection to base that can be used to change the properties of the connection. The bandwidth of signal transmission is dependent on the configuration used. For higher output to input current ratios, use an opto-isolator with a Darlington transistor pair in the output.
Opto-isolators do not output square waves. For this reason, a comparator is needed on the output to ensure clean output signals. A possible configuration is shown below that uses the 4N27 and has a bandwidth of 20 KHz.
Here is a great resource for further information and additional higher bandwidth circuit diagrams.