I have an optocoupler circuit that is used to accept 24V input (100 ms pulses) and interfaced to a microcontroller.

The schematic is as follows:


Opto: BL817C or TLP621.

TLP621 datasheet

As per my calculations, the LED forward current and emitter current are well within range (i.e. do not violate the CTR limits).


The circuit behaves as expected initially, but after some time the emitter voltage is stuck at ~2.65 V.

What could be the reason for this? I know I am making some fundamental mistake, but haven't been able to debug yet.


Adding output waveforms.

Green: Input signal. (24V pulses 10x attenuated)

Yellow: Pin 3 of optocoupler (marked as "uC" in the schematic).

oscilloscope traces

Update 2:

So I have tried the following to debug.

Made a small protoboard with the optocoupler and 2 resistors. Fed the circuit with 24V input signal and everything works as expected. (Tested for 2-3 hours.)

I have then wired the protoboard to the controller PCB. The circuit works for some time (40-50 min) and then the output is stuck at 2.7V.

The output voltage is 3.3-0.7V i.e. ~2.6V, so my hypothesis is that the phototransistor gets damaged and remains always on. This happens only after interfacing with the controller and working for some time.

The controller pin is defined as input pulldown. Any ideas as to what might be going wrong?

Update 3:

So I pulled another optocoupler out and wired the phototransistor end only: 3.3 V to the collector and the emitter pulled down to ground with a 5.2k resistor. The LED end had nothing connected.

Emitter voltage as probed:

oscilloscope trace

This could only happen if the transistor is leaking current. Dark current cannot be this high, unless it's damaged?

  • \$\begingroup\$ is your 24v input really going to 0v when off? It's difficu;lt to tell from the scope trace. The output appears to be going down to 0v at times, so what's holding it up when it should be down? \$\endgroup\$ – Neil_UK Jan 27 at 12:01
  • \$\begingroup\$ @Neil_UK yes it is going to 0v. I have also disconnected the 24v side and checked, the output is hovering around 2.68v. \$\endgroup\$ – WhiteSmoke Jan 27 at 12:32
  • \$\begingroup\$ Does exchanging the opto fix it? In other words, is it definitely the opto that is damaged? \$\endgroup\$ – CL. Jan 27 at 14:35
  • \$\begingroup\$ @CL.after exchanging the opto it follows the behavior of the previous cases..Works for some-time and then stops. Perhaps I have a batch of faulty optos ? Does the oscilloscope probe capacitance have an impact on these optos? \$\endgroup\$ – WhiteSmoke Jan 27 at 14:57
  • \$\begingroup\$ Are you running code during the test? Is it possible that at some point a bug in your code temporarily turns your input into an output and sets it low, possibly damaging the opto when the phototransistor turns on? \$\endgroup\$ – John D Jan 27 at 18:28

Your Answer

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

Browse other questions tagged or ask your own question.