Electronic – LED strange behavior

analogcurrentcurrent-limitingoperational-amplifiertransistors

I am analyzing ways to make a current limiting circuit, and here I'm having an unexpected problem. The schematic is as follows:

enter image description here

The problem I am encountering is twofold:

  1. Even when node Vin is connected to ground, diode D1 still glows, albeit faintly.
  2. Increasing the V5 generator up to 8V works, and the diode glows brighter linearly. BUT, the moment I go over 8V of input, the diode suddenly drops luminescence by about 80% (almost off) and stays there. The moment I go back below 8V, it turns back on bright, and falls off linearly as I decrease further below 8V.

Another remark: Putting the diode right below the transistor (anode at emitter, cathode negative opamp input) gets rid of problem 2). Problem 1) still remains.

As I understand, increasing voltage too much should make Q2 quickly turn on and off at high speed, regulating and keeping voltage constant, not drop it and make the diode go almost off.
The circuit is made to limit current to a value a bit over 20mA. When I go over 8V of input, the current suddenly drops to about 7mA.

VC = 12V

VE= Ground

Opamps are LM358.

Best Answer

There are a couple of things wrong with the circuit.

  1. If you need the input of the circuit to go up to (or beyond 8V) it would be better to divide the input voltage down to say a range of 0-5V.

Currently, when you get to 8 or 9V the emitter of Q1 is forced to the same voltage and there is no voltage to drive the LED. This is probably why the LED is getting dimmer.

Put a resistor divider between op-amp 1 and the input of opamp 2. Say two 4.7k resistors. You will need to reduce the value of R2 by the same amount to say 100 ohms.

  1. As shown you will be overloading the output of the first op-amp by shorting it's output to ground with the transistor Q2. The resistive divider from part 1 will fix that as well as Q2 will only have to pass the current through the resistive divider, 1-2mA.

What is the design range of the input voltage?

To ensure the LED goes off when the input is at zero the op-amps need to be ones that ground is a legitimate value.

Q2 will just limit the current linearly when it starts conducting, it will not oscillate on and off.