2 added 289 characters in body
source | link

Almost. You can indeed use a optocoupler but the photo-transistor is being reverse biased here, instead of forward-biased. The polarity of the photo-transistor side needs to be turned upside down.

So if you swap over the two connections (collector and emitter) from your photo-transistor, it'll work. This is shown below.

schematic

simulate this circuit – Schematic created using CircuitLab

That's assuming that your generic opto-coupler has a photo-transistor that can handle the load current and that the diode current is correct, but that's not your question here.

Almost. You can indeed use a optocoupler but the photo-transistor is being reverse biased here, instead of forward-biased. The polarity of the photo-transistor side needs to be turned upside down.

So if you swap over the two connections (collector and emitter) from your photo-transistor, it'll work.

That's assuming that your generic opto-coupler has a photo-transistor that can handle the load current and that the diode current is correct, but that's not your question here.

Almost. You can indeed use a optocoupler but the photo-transistor is being reverse biased here, instead of forward-biased. The polarity of the photo-transistor side needs to be turned upside down.

So if you swap over the two connections (collector and emitter) from your photo-transistor, it'll work. This is shown below.

schematic

simulate this circuit – Schematic created using CircuitLab

That's assuming that your generic opto-coupler has a photo-transistor that can handle the load current and that the diode current is correct, but that's not your question here.

1
source | link

Almost. You can indeed use a optocoupler but the photo-transistor is being reverse biased here, instead of forward-biased. The polarity of the photo-transistor side needs to be turned upside down.

So if you swap over the two connections (collector and emitter) from your photo-transistor, it'll work.

That's assuming that your generic opto-coupler has a photo-transistor that can handle the load current and that the diode current is correct, but that's not your question here.