# Optocoupler as UART communication

I am using the LTV-816S optocoupler for isolated data communication. When I give 4V supply to U1.1 then I get 3.3 at RX. but when I give a signal (4V) at U1.2 pin then at Rx I should get 0 but I am getting 1.2V approx. what could be the reason for that? I am missing something in the circuit.[R1=2.7K, R2=1k].

• your schematic diagram is upside down... please follow schematic drawing convention ... Vcc at top, gnd at bottom Commented Nov 16, 2022 at 7:23
• The device chosen is not a logic input/output device and your expectations as such are not going to be met it seems. Have you ever thought about reviewing your previous questions for answers that can be formally accepted as a means of showing that you respect the help from people answering? I'm not guaranteeing better help but is it worth the risk? Commented Nov 16, 2022 at 7:30
• yes. I do respect the people who answer my question. @Andyaka Commented Nov 16, 2022 at 8:10
• I hope to see that demonstrated in the answers you have formally accepted. Commented Nov 16, 2022 at 8:34
• Another "hint" regarding the netiquette electronics.stackexchange.com/questions/630379/…
– Rev
Commented Nov 16, 2022 at 9:46

The problem is $$\V_{CE}\$$ isn't saturated with $$\R_1 = 2.7kΩ\$$ and $$\R_2 = 1kΩ\$$.

$$\I_F = (4V - V_F) / R_1 = 2.8V/R_1 = 2.8V/2.7kΩ = 1.04mA\$$

$$\I_C = 3.3V/R_2 = 3.3mA\$$

You have to operate the photocoupler in the range where the transistor is saturated (where the curve is flat).

Source: Datasheet

In the comments you wrote you changed $$\R_1\$$ to $$\330Ω\$$

$$\I_F = 2.8V/330Ω = 8.48mA\$$

And you measured $$\V_{CE} = 0.12V\$$, which is as good a value as you can expect.

This isn't an ideal transistor, so you'll never get $$\V_{CE(sat)} = 0V\$$.