# Isolate a digital signal that changes its amplitude

I have to isolate a digital signal that has the following characteristics:

• frequency: between 1 and 1000 Hz
• amplitude pk-pk: 12V
• offset: 0-6V

With "offset" I mean the actual voltage may change from 0-12V to 6-18V. It seems, but I cannot know this for 100% sure that the output circuit is something like an npn bjt with a 5k pull-up resistor (and something else, otherwise I cannot explain this offset, measured with an oscilloscope).

The goal is to isolate it with an optocoupler and get a steady 0-12V signal.

Here my attempt:

simulate this circuit – Schematic created using CircuitLab

Because I have to replicate this section x16 times, I wonder if there's a smarter way to do the same using less components.

• So is the offset signal or noise? Commented Oct 6, 2018 at 14:12
• Do you want to preserve the shape of the input signal or just have an output pulse whenever the input rises? How do you distinguish between a rise in the offset voltage and a rise in the signal voltage...do you have some threshold voltage that separates a 1 from a 0? Commented Oct 6, 2018 at 14:18
• The offset voltage changes slowly, let's say about 0.1 Hz. The offset might be defined as "noise" because I'm not interested in it. It would be better to preserve the original shape (close to 50%) because after I need to feed another device with it.
– Mark
Commented Oct 6, 2018 at 14:20
• Just to be clear: the signal is pretty close to a square wave w/ 50% DC and 12V pk-pk.
– Mark
Commented Oct 6, 2018 at 14:27
• You actually have a decoupling capacitor at the input of your circuit, you could just use a decoupling capacitor followed by a follower op amp Commented Oct 6, 2018 at 14:33

I mean the actual voltage may change from 0-12V to 6-18V

Use an analogue comparator circuit that triggers at 9 volts - anything above 9 volts produces a digital 1 output and anything below 9 volts is digital 0.

simulate this circuit – Schematic created using CircuitLab

Figure 1. (a) Simplest option. (b) Constant current sink option.

      0 ----- 6 ----- 12 ----- 18 V
Min   ==================
Max           ===================
_______________
Output __________|


Figure 2. The voltage ranges of interest overlap so a mid-overlap switching point might work.

By addition of D2 with the appropriate rating you may be able to get the opto-LED to turn on at > 9 V and this would work across the range of voltages of interest. The design problem is that the current through the LED will vary greatly between your low-voltage and high-voltage. You would need to do your calculations to see if this can be made to work. If you do this then don't forget to look at the current-transfer-ratio of the opto-isolator and see if you can get the required output voltage swing at low currents by increasing the value of R4.

Figure 1b adds in current limiting at 10 mA. That solves some of the problems of 1a but at the expense of complexity which you wish to avoid. You could replace the CC sink with a constant current diode (but watch the heat dissipation calculations).

• What is the zener for? The offset is 0 to 6V but is not 6V constant Commented Oct 6, 2018 at 14:40
• See Figure 2. The Zener prevents the opto-LED turning on until the input voltage > 6 V. 9 V switching threshold would probably be ideal as that is mid-way in the overlap region of the lowest to highest input signals. Commented Oct 6, 2018 at 15:08
• These circuit wouldn't work for the porpose because offset voltage can be as low as 0.1V from the description. Commented Oct 6, 2018 at 15:15
• If the offset is 0.1 V that means the input waveform switches between 0.1 V to 12.1 V at the input frequency. If the switching threshold is 9 V the output will switch with the input. Commented Oct 6, 2018 at 15:28
• Nope. It's a digital signal. It's either off or on (but the off voltage can vary beween 0 and 6 V and the on between 12 and 18 V). My circuit treats anything below 9 V as off and above as on. Commented Oct 6, 2018 at 15:34