How to get 3.3 output voltage in PC817 opto coupler

3.3vopto-isolator

enter image description here

I am using PC817 opto coupler. I want a 3.3 output voltage. In its 1st pin I am giving 12volt and 2nd pin is gnd. I have connected a pull down resistor on 3rd pin. But i am confused because when I am giving 3.3volt on 4th pin, and I am checking output from 3rd pin which is 1.5volt. How can I get 3.0 – 3.3volt output on 3rd pin.

I have tested it with 5 volt, means when I was giving 5 volt on 4th pin and when I was checking voltage on 3rd pin it was 4.7-4.8v which is I think correct. But I dont know what is happening in case of 3.3volt. PLease help.

Thanks

EDIT : i have attached a screenshot of proteus simulation. I actually didnt find the PC817 opto coupler but I got the similar opto coupler. I am getting an output voltage of 3.22. Please tell me that is this connection good. I mean if I make this connection in real, will this work?

Best Answer

Please try using the setup as shown in the figure. The 1 K value on pin one is fine, but increase the value of resistor to 100k between Pin 4 and 3.3 V. When there is no 12 V on pin 1, The output (Pin Number 4) will be high, and when there is 12 V on Pin 1, the transistor will turn on shorting the Pin 4 to ground (VCE will be less than 100-200 mV). please try this and reply if not possible.enter image description here

I am using the same setup, different kind of coupler and it is working.