I'm trying to control an opto-isolator (actually a photorelay such as a TLP354x but it doesn't really matter here).

The problem lie in an external device (black magic box) which is also controlled by my "input signal" (coming from SW1 which is a physical pushbutton that connects to the ground).

When the black magic box is disconnected, everything works fine and dandy but when I do connect it, the PNP transistor (Q1 : BC557) is always switched on no matter what I do. On the other hand, if I disconnect the right part of the schematic (pnp + opto), the black magic box works perfectly but the both of them do not play well together.

The black box input seem to be floating and is supposed to be an open-collector input. When left without the pnp connected, the voltage floats between 0 and 0,5V until I press SW1 when it goes firmly to 0V.

As soon as I connect the PNP, the voltage at the input is between 9 and 12V depending whether I leave the pull-up resistor (R3) or not and what value I give to R2. When I press SW1 it also goes firmly to 0V but the floating voltage seem to upset the magic black box and also makes the PNP conducts somehow.


simulate this circuit – Schematic created using CircuitLab

I cannot seem to understand the behaviour of the two together.

What other options could I have to "monitor" the state of this input without disturbing it?

Thank you for your help,

  • 3
    \$\begingroup\$ "supposed to be an open-collector input" - open collector pins are usually outputs, the idea being you can connect lots together with a single pullup resistor. Open collector inputs don't make a lot of sense. \$\endgroup\$
    – Finbarr
    Apr 11 at 18:16
  • 1
    \$\begingroup\$ How did you determine that the black box input "seems to be floating"? What measurements did you do? What do you see on the black box input terminal when you connect it through a resistor to +12 V? Does the black box share a common ground with your circuit? \$\endgroup\$
    – The Photon
    Apr 11 at 18:20
  • \$\begingroup\$ @Finbarr thanks for the precision. I might be confusing a couple of notions. Let me rephrase : the input is "ON" when switched to Ground \$\endgroup\$ Apr 11 at 18:28
  • \$\begingroup\$ What behavior does the box have, with respect to input voltage? You might use a potentiometer to adjust the input voltage while observing its behavior. What input current does it draw? You can connect an ammeter in series to measure both voltage and current in the same test. You could plot the results and edit your post to illustrate this characteristic. \$\endgroup\$ Apr 11 at 18:32
  • \$\begingroup\$ @ThePhoton When I connect the input terminal through a 150K resistor to +12V for example, I see 1,73V. The black box and the circuit share the same ground indeed. \$\endgroup\$ Apr 11 at 18:44

1 Answer 1


Your "black magic box" must be drawing some current through R2 and the transistor base-emitter junction, turning the transistor on.

You could try adding a diode between the black box and switch like this:


simulate this circuit – Schematic created using CircuitLab

That would allow the switch to pull the black box input to within about 0.6 V of ground while blocking the box from pulling the transistor base low.

  • \$\begingroup\$ Hmm. Assuming that the black box input is really more of a wire-OR situation (both observed and also driven), not unlike I've done countless times or as was done on the shared APIC bus that I remember from Pentium Pro and Pentium II days, then this might work. I wish VoltsAndNuts would disclose the black box specifications for that so-called "input." Good an answer as any, given how little there is to go on. So +1. \$\endgroup\$ Apr 12 at 1:36
  • \$\begingroup\$ @GodJihyo , that did the trick, thanks!! Two caveats however : 1 / I cannot integrate D1 in my board since SW1 is external so it has to be directly on the wiring harness... suboptimal... 2/ I have a 0,9mA current consumption coming from the PNP fet part, I cannot link that to the BC557 or the TLP leakage current since they are supposed to be 2 to 3 orders of magnitude lower... Where could that come from? \$\endgroup\$ Apr 12 at 6:48
  • \$\begingroup\$ To add another element : the only thing that seems to make this quiescent current vary (proportionaly) is the value of R1 in the first schematic. \$\endgroup\$ Apr 12 at 9:12
  • \$\begingroup\$ OK, I'm starting to get a better understanding : The quiescent current is actually due to the transistor partially conducting which gets me 3V at it's emitter and this "high" quiescent current. That being due to the transistor not being completely pulled up for some reason. But I will be starting another subject for that \$\endgroup\$ Apr 12 at 9:53
  • \$\begingroup\$ Would you think of any way to get D1 or any other component "on-board"? With this schematic we would have to put it outside the board and on the wire harness... \$\endgroup\$ Apr 12 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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