0
\$\begingroup\$

I couldn't be sure how to make a proper headline, correct me if I am wrong with it.

I have a reasonably working push button solution including hardware de-bouncing. There is no question on that.

enter image description here

So, now, I was asked if i can also feed that MCU pin directly from a PLC. There is no secret with that. I choose an optocoupler (LTV-844). It has NPN open collector output.

enter image description here

My question is; should I expect any complication when I connect open collector output of the optocoupler and Schmidt Trigger output to the very same MCU pin? if so, what would be the solution?

A hint; that two outputs won't be available at the same time (mutually exclusive by design).

\$\endgroup\$
  • \$\begingroup\$ I think you need to show us a schematic of what you plan to do with that open-collector. There are ways it would work, and ways it wouldn't, and it's not entirely clear what your plan is. \$\endgroup\$ – brhans Nov 12 '18 at 16:42
  • 1
    \$\begingroup\$ Could you switch to a part that has a schmitt-trigger input and an open-collector (or more likely today, open-drain) output? Then you can connect the two and add a pullup, as long as they idle high. Otherwise you could use an AND or OR gate as appropriate to the desired logic. Single-gate surface mount logic is at the point where things like diode-resistor solutions may not be worth the trouble unless you have odd voltage needs or are reworking something where perching a part on a cut trace is important. \$\endgroup\$ – Chris Stratton Nov 12 '18 at 18:36
  • \$\begingroup\$ @Brhans, the plan is not more than what I tried to explain. I also added optocoupler circuit. They should be working OK individually (at least schmitt-trigger from my experience and the optocoupler part from common sense). All I wanted to connect that two outputs "to uC pin" to the same MCU pin. \$\endgroup\$ – Sener Nov 12 '18 at 19:01
  • 1
    \$\begingroup\$ Of course you should expect a problem, as the only one of your devices is open-collector. It's already been explained how you could solve this, but without specific of your need nothing more can be said. \$\endgroup\$ – Chris Stratton Nov 12 '18 at 19:04
2
\$\begingroup\$

Connect the output of the optocoupler to the same Schmitt trigger input as the button. That way, the button and the open-collector output of the optocoupler will be ORed together. The signal from the optocoupler would be debounced like a button (even though optocouplers don't bounce).

The 74HC14 doesn't have an open collector (or open drain output). If you connect the output of the optocoupler directly to the μC pin, it will be in parallel with the output of the 74HC14. The optocoupler would not be able to drive that node low against the output of the 74HC14.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ I agree with you, that would be much simpler/safe and effective. And this will look like an add-on my existing Schmidt trigger solution. I should also give credit to @Chris. Once I have the optocoupler I will prototype this. \$\endgroup\$ – Sener Nov 12 '18 at 19:44
  • \$\begingroup\$ I have one question about that solution. Since this will be connected to the input where the tactile switch is, once the switch is pressed, the collector and emitter will be shorted. Although I don't see any apparent issue, would it cause any damage or heat dissipation (normally a transistor would act like a diode at that situation)? \$\endgroup\$ – Sener Nov 12 '18 at 19:51

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.