I'm using 4 optocoupler for switch some relay with an attiny85. Each optocoupler is connected with a 150 ohm resistor to the attiny gpio. I've noticed that I had left the ground unconnected on the optocouplers anode but surprisingly they works the same , turning on the relay. How is it possible? Maybe due to some capacitance beetwen the anode and the emitter?
Shouldn't the LED's cathode be connected (or switched) to ground? Could you please post a circuit diagram?
I assume no return path for any LED. In the past I'd say that couldn't happen. The reverse voltage is passing through the other opto LED when one or more pin is opposite. Older LED were speced with a reverse voltage of 5V even though I'd never seen one with less than 75V PIV. Some new LED are really less than 5V. What is your opto?
Shouldn't the LED's cathode be connected (or switched) to ground? Could you please post a circuit diagram?
Agreed, having the LED anode grounded makes no sense unless the OP is driving the cathode with a negative voltage.