I am trying to switch a 17VDC 30mA load with a Raspberry Pi. To provide electrical isolation, I am using a two channel optocoupler, a TLP621-2 (datasheet). The second channel is currently unconnected.
My understanding is that I can't drive the optocoupler directly from the 3.3 VDC GPIO pin on the Pi because the pin can only source/sink 16mA. So I'm using a 2N3904 transistor to control the LED in the optocoupler. Putting 17VDC 30mA on the coupler's outputs isn't wise either so I have a second transistor there as well.
The problem is that I don't know how to complete this circuit? I've tried different permutations on the output and can't get it to switch the load. I have no idea whether I have things hooked up incorrectly or I keep smoking ICs (or both?). The input transistor seems to switch as expected when I apply 3.3V to it's base, so I assume that the coupler's LED is activated. But nothing happens on the output. I'm wondering if I'm misunderstanding the TLP621's datasheet?