# How to get 3.3 output voltage in PC817 opto coupler?

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?

• post the schematics. Do you have resistor between 12 V and Pin #1? What is the pull down value? Ideally you should have a pull up resistor. The Opto will drive the transistor output low when the Diode is driven. Pls post all resistor values along with the schematics to give a possibly useful answer. – Umar Jul 17 '15 at 8:16
• I cannot post the schematics but i can tell you the resistor value. I am using 1k res on pin1 and a pull down resistor of 1k on 3rd pin. also from 3rd pin I am using 1k resistor and I am checking the output from this resistor which is 1.5v when I am applying 3.3v on 4th pin. If this is wrong can you suggest me another circuit? – anna carolina Jul 17 '15 at 8:45
• You certainly can post schematics. If you can't take a screenshot of the relevant bit, use the built in schematic editor to redraw it. – Nick Johnson Jul 17 '15 at 9:44
• @annacarolina For your next question, you can also use the Schematic Editor on the forum to supply more information. It's an icon above where you type the text. 7th from left. (Or hotkey Ctrl+M). If you supply a schematic with values as you use it, we will be able to offer much better answers much quicker. – Asmyldof Jul 17 '15 at 10:37

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.

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

• you are saying that when input is low, output will be high and vice versa. But I dont want it like this. I want that when I give 12v supply on pin 1 my output should be 3.0-3.3volt – anna carolina Jul 17 '15 at 9:20
• I would not opt for that option. i will use a transistor at the input of pin 1 as inverter if in case, the 12 V drive is impossible to invert. I feel that,when the collector (opto coupler)current flows, the drop developed across emitter will be comparable with collector voltage thus limiting the base current (negative feedback). I might be wrong too. ) – Umar Jul 17 '15 at 9:45
• 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 2.93. Please tell me that is this connection good. I mean if I make this connection in real, will this work? – anna carolina Jul 18 '15 at 13:29
• @anna If 3 V is acceptable (normally yes), then i see no issues. where r you connecting the 3 V output? – Umar Jul 19 '15 at 11:50
• I am using PIC32MX795F512L microcontroller, and this controller can work only in case of 3.3v. So i am giving this voltage to controller.Is this thing correct.? – anna carolina Jul 19 '15 at 14:14

If you have 12V feeding the input diode via 1K you will be producing a forward current of about 10mA. If you have a 1k resistor on the output that you hope to have 3V3 across it means an output current (Ic) of 3.3mA.

It looks to me like you will probably achieve about 3.2 volts on the output but this is a typical example only. In my experience, a lot of opto devices are worse than this so try driving the input a little harder (maybe 20mA) and try increasing the output resistor from 1k to 10k.

If you connect your PC817 as shown below you should be able to achieve a "non inverting" output.

Here is an LTSpice simulation waveform that shows the output voltage level that should be achievable.

Note that the timing delay response through the optocoupler in the PC817A model may not represent an accurate picture of the real delays to be expected in a physical circuit implementation. On the otherhand the voltage and current transfer characteristics are modeled in a reasonable manner.

• 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 2.93. Please tell me that is this connection good. I mean if I make this connection in real, will this work? – anna carolina Jul 18 '15 at 13:30
• @annacarolina - It should work for you. Remember to keep your load on the output to very small current. Two things can be adjusted - increase current through input diode by reducing the value of the R1 in my diagram - or increase the value of the R2 in my diagram. – Michael Karas Jul 18 '15 at 15:47
Use LM7805 to convert 12V into  5V


Then use this voltage divider to create 3.3V supply


simulate this circuit – Schematic created using CircuitLab

Use the circuit below , and as datasheet suggests that the forward voltage is about 1.2V (led voltage) and maximum current should be 20mA so the resistor R1 can be calculated as

Voltage_R1 = 5.0-1.2  = 3.8V
I_R1 = 20mA
R1 = 3.8 / 20mA = 190 ohm


Use minimum resistor of value this , higher resistor will reduce current

• electronics.stackexchange.com/questions/49141/… – Taimoor Ali Jul 17 '15 at 9:09
• you are giving 3.3v input. but in my circuit i'll have to give 12volt supply and output should be 3.3v. How to do that? – anna carolina Jul 17 '15 at 9:21
• Bring 12 V to 3.3 or 4 using voltage divider – Taimoor Ali Jul 17 '15 at 9:25
• This isn't a "3.3v source", it's a voltage divider, and along with wasting 20mA constantly, it will also have extremely poor output regulation. – Nick Johnson Jul 17 '15 at 9:45
• I've already said - because you're trying to use a voltage divider as a regulated power supply. – Nick Johnson Jul 17 '15 at 10:14