3
\$\begingroup\$

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.

\$\endgroup\$
6
\$\begingroup\$

That open collector output V o is not pulled up internally according to the datasheet. Zero mention of it, and every diagram shows a simple npn open collector.

Power the VCC at 5V, and pull up V o to 3.3V vía a external resistor or your microcontroller internal pull-up resistor.

Worst case, use a voltage divider to bring the signal at V o down to 3.3V.

\$\endgroup\$
  • 1
    \$\begingroup\$ Thank you. I must admit to not understanding the internal schematic on the datasheet and had assumed it was "pulled up" to the >4V logic high level I was seeing on a meter. I just tried what you said using a 10k external resistor and it appears to work. Does this mean it's effectively floating at high level? (i.e. when not pulled up externally?) \$\endgroup\$ – Gavin W Apr 28 '16 at 0:46
  • \$\begingroup\$ I'm not sure what answer acceptance etiquette dictates in this situation but it seems fairest to accept the first correct answer. My optoisolator is connected to my MCU with no magic smoke. Thanks again. \$\endgroup\$ – Gavin W Apr 28 '16 at 1:46
3
\$\begingroup\$

Nowhere in the datasheet is it stated that the output is internally pulled up, so you can design your pull-up network however you'd like.

That being said, how about this?

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Thanks Matthew, that was a misunderstanding on my part. Just to explain my thinking - my multimeter, a high impedance device, sees 4.2V or so on the output pin at high level. My microcontroller's input is presumably also of high impedance but can be damaged by >3.3v. I assumed therefore that this 4.2V was a problem but my current understanding is that it's actually floating and that's why no Logic High Output Voltage is quoted in the datasheet. \$\endgroup\$ – Gavin W Apr 28 '16 at 1:24
  • \$\begingroup\$ ok, glad you figured it out :) \$\endgroup\$ – Matthew Di Nardo Apr 28 '16 at 1:30
0
\$\begingroup\$

If you are concerned about damage to your controller you can limit the input high with a 1N4728A and a 10K current limiting resistor. If something in the signal source fries this will offer you some cheap protection. If the input can source more thatn 1A install a fuse to protect the diode.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.