What is the value of resistor in optocoupler?
I will use optocoupler to isolate the output, the circuit will turn OFF the computer via the PC switch of the motherboard.
See image below..
What is the value of resistor in optocoupler?
I will use optocoupler to isolate the output, the circuit will turn OFF the computer via the PC switch of the motherboard.
See image below..
Around 220 Ohms should do it. An optocoupler has an LED on the "input" side so it's like any other LED. Do you know how to calculate the resistor for an LED?
You can check the datasheet if you want to make some calculations, but it's usually not too critical... You need enough current to create enough light to turn-on the phototransistor, but not so much current that you fry the internal LED or the Arduino.
Impossible to determine, since you didn't divulge how much current it will be switching -- that would the amount of current that normally flows through "PC Switch" [whatever that is].
BUT, a way to either determine the resistor value, or abandon this device if turns out to be inadequate for the task:
[b]R[/b] = (5V - 1.1V)/7mA = [b]557Ω[/b]
[b]I[sub]F[/sub][/b] = I[sub]C[/sub]/110% = 50mA/1.1 = [b]45mA[/b]
Which, my friend, it a bit too much for the UNO. An UNO output is spec'ed to drive 40mA ABSOLUTE MAX -- with 20mA being the Recommended MAX.
And that, as they say, is how you do it!
BTW: When I say "Isolator", it mean OptoCoupler.
To be honest in this case , I would just use a small relay driven off a transistor from the Arduinoand powered off your power supply. The contacts are isolated and will switch the PC without any worry about whether it can operate the switching , polarities and so on.You can buy modules off eBay very cheaply that will do the job .
Google : arduino relay driver
A quick google actually shows you can buy 5v Reed type relays which will do the job and have coil resistance >250ohm, so you can drive direct from an Arduino pin without a transistor .
Look at Farnell for examples.
Mm, I would not.... Opto is easy for this. An I would grab a 470Ohm. Not to critical, current will be low.
The other thing I have picked up from optocoupler datasheets is they get worse with age. As you use them, the CTR drops.
Of course the datasheet never says how bad this problem is. They all try to say that theirs is better than the competition but that is really just admitting that they all have the same problem.
I have seen rule-of-thumb guidelines to take the worst figure in the datasheet and add 100% for ageing.
MorganS:
The other thing I have picked up from optocoupler datasheets is they get worse with age. As you use them, the CTR drops.Of course the datasheet never says how bad this problem is.
Interesting. I got my first notion of this when I searched for a datasheet for the PC 817, for this post, which led me to the following Sharp datasheet, that admits the very thing:
https://www.mouser.com/datasheet/2/365/PC817XxNIP1B_12Oct16_Spec_ED-16P011-1360323.pdf
On the page titled "Precautions for PhotoCouplers" Section 2