Electronic – Does this circuit have proper isolation

isolation

I have a development board from Microchip. It works on 12 V DC. The input pins can only work on 3.3 V so what I have done is I have designed a circuit using a PC817 optocoupler. So on the LED side I am supplying 12 V and on the transistor side I am using the 3.3 V from the development board and connecting to the input pins of controller. Circuit below:

enter image description here

Now, looking at the circuit it is isolated. But I am powering the development board and supply the 12 V as input to optocoupler from the same power supply. So I think ground is still common. So this kind of circuit still isolated? If not, how to properly achieve isolation? Do we really need different power supply for isolation? What is the effective way of providing isolation?

Best Answer

Your circuit is fine and would isolate if the ground weren't tied together. It would be appropriate if you had a separate floating 12 V source that you wanted to test the presence of.

However, since both sides have a common ground, the 12 V and 3.3 V supplies are not isolated from each other. Since they are not isolated, you can use a more direct connection. Your opto-isolator would still work, but adds unnecessary cost and complication.

One simple approach is:

This inverts from the logic you have. The microcontroller input will be low when 12 V is present and high otherwise. Since it's a microcontroller input, you generally do what's convenient for the hardware and handle the polarity in the firmware accordingly.