I have a Raspberry Pi that I want to use to detect if my desktop computer is on, by detecting if the 5V rail is powered. I have in the past used optocouplers to short pins on the motherboard together with the RPi, but when I tried to use my pc817 optocouplers for this purpose, they kept releasing magic smoke.
Am I doing something wrong? I was directly connecting one end of the optocoupler to the 5V wires in a USB cable I took apart and the other end of the optocoupler to the GPIO.
Thanks in advance! Neil