I have the circuit below to decode a signal that is defined as Logic high
>9.5 V and Logic low
To determine the treshold, schmitt triger is used, then an optocoupler is used to isolate the receiver MCU. Here is a larger view of the first picture.
Here is the comparator's datasheet.
Here is the optocoupler's datasheet.
My problem is that the circuit above does not decode the signal, I guess I am doing something wrong on comparator's output and optocoupler's input, so that optocoupler does not output the correct signal.
Here below is the oscilloscope output of the signal before and after the optocoupler. Signal A (blue) represents the signal at the input (pin 2 of optocoupler) and Signal B (red) represents the signal at the output (pin 6 of optocoupler). At the bottom of the picture, it shows the max, min, average voltage level's of the signals: Signal A's max:
1.542V and Signal B's max is
When I measure the current on the line from comparator's output (pin 1 of comparator) to optocoupler's input (pin2 of optocoupler), I read the current value varies between 4.7 to 6.4mA (should be because of the PWM). According to the optocoupler's datasheet, 5mA should be the logic high. However, the signal does not go to logic high at the output of the optocoupler.
Here below is the oscilloscope output: signal A (blue) is the Vi (
pin 2) of the comparator and Signal B (red) is the comparator output (
An interesting output oscilloscope output is below. The Signal A (blue) represents optocoupler's input (pin 2) and the Signal B (red) represents the comparator's output. Both output are connected via a 22 awg cable, I could not understand why the signal levels are different
I would highly appreciate if anyone could tell me how to fix the circuit, so that the MCU would receive the decoded signal. Thank you in advance!