# Opto-coupled PWM output

I have a circuit with two different ground levels. Using a optocoupler, I want to translate a PWM signal to the new ground level.

Does there exist a easier method than the following? (Ideally with only one optocoupler but still preserving linearity with respect to duty cycle at least approximately.)

simulate this circuit – Schematic created using CircuitLab

The solution has no particularly challenging constraints frequency-wise. It will be operated in a quasi-static regime.

• You say "quasi-static", but it is still a PWM. And given the usual optocoupler delays and inconsistencies regarding rise/fall time, we need to have an idea of the frequency you'll use for the PWM, and the accuracy you expect. Also, are the two grounds kept at the same constant potential difference ? (in which case you could maybe use a simple capacitor)
– dim
Commented May 16, 2016 at 13:53
• @dim I mean V_out will be quasi-static. Say 0.1-1Hz variation. Regarding PWM frequency, I am happy to adapt. I was thinking that with 1 kHz I should not be asking too much from cheap optocouplers.
– ARF
Commented May 16, 2016 at 13:56
• Ok, I think this frequency is reasonable. What about the ground differences ?
– dim
Commented May 16, 2016 at 14:19

Analog optocouplers are not great with regards to rise/fall time uniformity. A typical circuit you see is a simple pull-up but then you're limited by low-level versus speed versus power dissipation.

So unless you can use a digital high speed optocoupler that has an integrated amplifier, you're pretty much stuck with that push-pull configuration. Possibly even with an external output stage if you need more oomph in your load.

Note that digital optocouplers usually come as 3.3V or 5V variants and the signal may not exceed the VCC.

Incidentally, you need to add a base resistor to that PNP transistor.

• Thanks. Just to clarify: you are not saying that I can get away with a single pull-up (plus large resistor to ground)? According to my calculations that would exhibit a very non-linear response with respect to the duty cycle.
– ARF
Commented May 16, 2016 at 13:47
• @ARF It depends ;-) You're not going to get fast response from an analog opamp in open-collector configuration. If my memory serves, so-called 1MHz optocouplers can manage 50kHz with 50/50 duty cycle. Incidentally why a resistor to GND? The optocoupler will pull the output to ground. You'll want to be careful in general how much current you expect the opto to sink/source, zero-level will start creeping up quickly. Hence the tradeoff with speed, stronger the pull-up and faster it'll go up but then your zero level can easily creep too high. Commented May 16, 2016 at 14:30

If cost is not a major concern, there are much better ways, such as the FOD8342.