Severe Voltage Drop When Applying a Load to Opto-Isolator Circuit

The circuit below uses the Vishay ILD213T optocoupler (datasheet). The load in question is a 5V solenoid valve with a resistance of 46Ω.

The circuit is configured with "IN1" connected to a GPIO pin set to 3.3V, and "OUT1" connected to a USB port on a desktop PC. Input is grounded to the microcontroller, output is grounded to the USB port.

Without a load connected, "OUT1" is ~0V (input LOW) and ~5V (input HIGH). However, with the load connected, the voltage at "OUT1" drops to 0.022V.

Is this simply an issue with the opto's max collector current, or something else?

• Where is the load? – CL. Oct 21 '15 at 14:28
• And "HV" is????????? – Andy aka Oct 21 '15 at 14:29
• Never mind... Exactly how much do you expect to see on OUT1? When Q2 is off, you have 10K pulling up to +5V (HV), and 46 ohms sinking it. With Q2 On you are just sinking OUT1 to HV-GND. – R Drast Oct 21 '15 at 14:45
• As dave points out in his answer, this circuit is for active "Low", strong pull down/sinking of current. If you want it to source current, then you will need high side drivers not low side sinks. – KyranF Oct 21 '15 at 15:55
• What do you mean by "connected to a USB port"? You can't connect such a signal direct to USB. – Kevin White Oct 21 '15 at 17:01

With this circuit, the "load" is meant to be connected between "HV" pin and the "OUT1" pin. When the input is low, the output pin should be capable of sinking a significant amount of current (tens of mA, at least — note that the drive to the output transistors is limited by R3 and R4).

When the input and output is high, the only source of current is the 10kΩ resistor R6, which can only source at most 0.5 mA if "HV" is 5V.

... And if the load is inductive, like your solenoid, be sure to connect an antiparallel diode across it, in order to avoid frying the transistor with the inductive kick.

Notice that $Q1$ and $Q2$ are both set up as a common emitter amplifier. The common emitter amplifier has output impedance given by $R_C$. In your circuit $R_C$ for $Q1$ is $R5$ and $R_C$ for $Q2$ is $R6$. This means the output impedance for both OUT1 and OUT2 is $10k\Omega$, which is pretty high. By choosing a smaller value for $R5$ and $R6$, you could decrease the output impedance and minimize the amount of voltage droop when a load is attached. You want $R5$ and $R6$ to be small enough that when carrying the expected current of the load, the drop across them is small. So, for your load of a $5V$ $46\Omega$ solenoid, the expected load would be: $$I=\frac{V}{R}=\frac{5V}{46\Omega}\approx 108mA$$ Let's say the maximum acceptable drop in voltage when the load is attached is $0.1V$. Then $R5$ and $R6$ should be: $$R=\frac{V}{I}=\frac{0.1V}{108mA}\approx 93\Omega$$

There are a few issues with this approach. First is that the collector resistors would now be dissipating well over $1W$ of power when the solenoid is switched on. The second is that the collector current would increase when the solenoid is switched off, since the transistor likely has $V_{CE}$ around $0.2V$ or so.

What I would recommend is using an open collector configuration. This means that the collector of the transistor is connected directly to the load and works like a switched current sink.

simulate this circuit – Schematic created using CircuitLab

This way, when the transistor is switched on, the solenoid will see $5V - V_{CE} \approx 4.8V$. Additionally, the current is only limited by the amount of power that the transistor can handle. Assuming $108mA$ as before, and $V_{CE}=0.2V$, the power dissipated by the transistor when on would be: $$P=IV=108mA * 0.2V \approx 20mW$$

Also, when switched off, no current flows and so zero power is lost. It is also crucially important that you include a snubber diode on the solenoid that can handle more than $108mA$. This will suppress voltage spikes when the solenoid is switched off.

• very thorough, +1 – KyranF Oct 21 '15 at 16:52