hi,need help...i use arduino nano and won it use with opto coupler pc817... from output of nano pwm digital pin 11 i won it to provide depends of position/state (HIGH) 5v / (LOW) 0v to input pc817 and output of pc817 i need 3.3v / 0v...questions is wich resistors i need to use to input and output on opto pc817..thanks
Current limiting resistor of 1k on the input and a pull-up (or pull-down, depending on your circuit) of 10k on the output will do for most applications.
Why not calculate what you want. The Vf (Voltage forward) is about 1.4V, you will need about about 2.5 mA to get your Current Transfer Ratio vs. Forward Current in the optimum range. Now assume your micro will give you about 4.8 Volts at 2.5 mA. so subtract 4,8 - 1.4 gives you 3.4 volts to work with. Using Ohm's law (found here: Ohms Law Calculator ) we find 1360 ohms is the resistance you need so use the next lower standard value and see how that works. This is the data sheet I used: https://www.farnell.com/datasheets/73758.pdf
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil