# What kind of circuit do I need with a 6N138 optocoupler to get proportional output?

I have 0-5V input that I need to isolate and still output ~ 0-5V to an isolated circuit. I purchased some 6N138 optocouplers to do this but I'm not getting a voltage output with a 5V input. There are some transistors built into the optocoupler that are complicating things. How do I create a circuit with the transistors to get an output of approximately the same magnitude to the input?

• Welcome. Opto-couplers are very non-linear, so you need a feedback loop using another 6N138 opto-coupler with an op-amp to make the response linear over a small range. – user105652 Jun 14 '20 at 2:56
• "I'm not getting a voltage output with a 5V input." - The 6N138 is not very linear, but you should be able to get some voltage out with 5V in if it is configured properly. Please show us your circuit. – Bruce Abbott Jun 14 '20 at 3:33
• As the 6N138 has an open-collector configuration, there will be no output signal without a pull-up resistor. – henros Jun 14 '20 at 8:30
• How proportional does it need to be? E.g., is a 5% (maximum) deviation acceptable? What is the requirement? What is the bandwidth requirement (highest signal frequency / 3 dB frequency that must be transferred)? – Peter Mortensen Jun 14 '20 at 19:49
• Please add a schematic. – Dmitry Grigoryev Jun 16 '20 at 10:32

It's not easy to do with a simple optocoupler, because the CTR is not well-controlled.

The usual solution is use a "precision optocoupler" like TIL300 or HCNR200. These have one transmitting LED and two matched receiving photodiodes. You use one photodiode to deliver the signal to the isolated side, and the other one to provide feedback to an op-amp circuit on the sourcing side to enable the signal amplitude to be controlled accurately.

This may look like a lot of circuit complexity, but it's likely to be simpler in the long run than calibrating a single-receiver optocoupler, compensating for temperature variation, etc.

• But how far off (maximum relative deviation from linear (or proportional)) is a "normal" optocoupler if used in a "current fashion"? – Peter Mortensen Jun 14 '20 at 19:47

If you don't want to shell out the  to buy a commerical isolation amplifier, you can digitize the signal and send it over the isolation barrier digitally. For example, you could use a small MCU with built-in ADC + UART and use serial communications.

Rather low-speed serial communications because that opto is a bit of a slug, or pick a faster one.

Then convert it back to analog using PWM or a DAC on a second MCU (could be another of the same type).

Analog opto-isolation is possible, and we used to do it years ago, but the variation with temperature and LED aging make it difficult to guarantee good performance such as stability and linearity. Analog isolation amplifiers can also use PWM directly (which places some constraints on the opto performance), frequency, or using analog signals chopped and sent over an isolation transformer (typical of some Analog Design process control oriented hybrid products).

Or, convert your 0-5 volts in to a voltage controlled oscillator. Maybe in the 100-1000 Hz range (don't use 0 Hz as 0V, thats a bad practice), then as your voltage goes up or down there will be a train of pulses going through the optocoupler. On the other side of the opto, convert the train of pulses back in to a voltage with an RC circuit.

Use two parts, one in a feedback loop to linearize the other. https://www.electroschematics.com/linear-dc-signal-opto-isolator/

EDN, using FET optoisolators; different part, same process: https://www.edn.com/use-a-photoelectric-fet-optocoupler-as-a-linear-voltage-controlled-potentiometer/

HP/Agilent app note 951-2, "Linear Applications of Optocouplers" , same process: https://linearparts.com/documents/AN-HCPL2531-5954-8430.pdf

Vishay's app note 50 "Designing Linear Amplifiers Using the IL300 Optocoupler" for @ThePhoton's answer above: https://www.vishay.com/docs/83708/appnote50.pdf

This is the circuit to obtain the output signal with unity gain. The solution is based on AMC1211 from Texas instruments, which is an isolated unity gain amplifier.

The input signal is stepped down to a range of 0 - 2V using R1 and R2.

The output signal from this IC will be in the range of 0 - 2V.

To convert this signal to a range of 0 - 5V, a non-inverting amplifier consisting of an op-amp, R3 and R4 with a gain of 2.5 is used.

Thus, for an input signal in the range of 0 - 5V, an isolated output signal of the same magnitude is obtained.

R1 and R2 are 1.5:1

R3 and R4 are 1.5:1