I have a bit of a puzzle on my hands trying to interface a Fairchild MID400 optoisolator (popular "logic level" optoisolator for mains detection) to a 3.3V GPIO pin. The MID400 is a 5V part [*] and has an open-collector output which is pulled up internally to a 5V logic high level. This is the aspect that's causing me problems as otherwise I could just pull it up externally to 3.3V and all would be well.
The microcontroller and optoisolator are metres apart and I would like to perform the level shift on the optoisolator end of the wire where only 5V is available. I can't see how it can be done using diodes or resistors but happy to try out anything suggested.
Switching frequency is low, rise/fall time unimportant. Thanks for any suggestions.
[*] Just in case anyone should happen across this question wondering if the MID400 might work at 3.3V albeit out of spec, I tried it and it doesn't at all.