Could somebody help me decode this circuit? - Page 1
Forum section: electronics / beginners

author: Drake122
author_rank: Contributor
timestamp: March 06, 2018, 03:07:11 pm
content: Hey guys!So, I came across this neat little circuit in a Conrad electronics kit, and would like to know why, and how it works. It is light sensor circuit, according to the description, but don't know how it works.Uploaded a not so great paint drawing of itThe part I don't get is, what is the Op-amp doing? why does it activate when the transistor is closed? I believe the transistor is open, when the light sensing diode's current is great enough, but then what gets amplified, when the non-inverting side of the op-amp is on the collector.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 06, 2018, 03:32:31 pm
content: Heh...This looks like nonsense, but I think it will actually work (turn off the red LED when the green is illuminated, assuming that was the intent!).The tricks are several:1. LEDs are photovoltaic. There's nothing wrong with that, apply current get light; apply light get current. How much current? Well, as you might guess, the efficiency is crap. But one important thing: it has to be an LED, because the voltage associated with that current is proportional to the diode type. A green (GaP) LED has a forward drop of about 2V, so expect 1-1.5V before the current runs out. This is enough to forward bias the BJT.2. The BJT pulls down on the op-amp. But the op-amp input is not biased! Ah, but it is: the input bias current of the LM358 happens to flow out of the input pins, because it uses PNP transistors internally, and that base current serves as bias.The transistor need only sink a few uA to do this job.Important for this to work: the transistor itself needs low leakage current. Typically this is in the single nA, at room temperature; expect it not to work at 100C+, say. It also needs high hFE (more than 10, say) to get a good transition, which can be challenging as hFE falls off at low current, but most types are okay.Tim

author: Zero999
author_rank: Super Contributor
timestamp: March 06, 2018, 03:45:04 pm
content: Yes, the op-amp's bias current is used to power the transistor. It's an ugly hack. As mentioned above, it probably won't work at high temperatures, not only because the transistor will have a higher leakage, but because the bias current will also fall, as the Hfe of the LM358's input stage will have a positive temperature coefficient.Try building it with a different op-amp, such as the TS272, a MOSFET input with a typical bias current of 1pA and you'll find it won't work.

author: ArdWar
author_rank: Frequent Contributor
timestamp: March 06, 2018, 04:43:20 pm
content: Quote from: Hero999 on March 06, 2018, 03:45:04 pmBe careful when selecting a substitute part if you intend to use that as "feature"Some OpAmp have negative input bias current and some have positive. It might results in unexpected operation. Things get tricky when dealing with compensated precision OpAmp. Depends on how matched the compensation is, it may result in bias polarity variance between part sample within the same part number. The two inputs within one OpAmp may even have different bias polarity.

author: Drake122
author_rank: Contributor
timestamp: March 06, 2018, 04:45:33 pm
content: Okay, but what is that "feature"? I get it, that when the green led senses light, it opens the BJT and it grounds the non-inverting pin. But if the BJT is closed, there is still 0 volts on the non-inverint. So when the BJT is closed, what causes the op amp to let current through? Or is that some noise voltage is on the non-inverting, and because of the high gain, the op-amp amps that up?Also, it came in a kit, to practice smd and tht soldering, they also showed the part numbers for a reason I think

author: ArdWar
author_rank: Frequent Contributor
timestamp: March 06, 2018, 05:21:53 pm
content: As what said before by others, the designmightuse the input bias current of the OpAmp.OpAmp isn't an ideal device. Its input use two transistor, obviously to drive these transistors you need a small amount of currents (IB+and IB-). How much current, and which direction they go depend on what transistors are used on the input (NPN/PNP/N-FET/P-FET/both/combination). On most practical case these currents are undesirable, it cause additional error in the output or even mess with the input.In this case, the LM358 sources about -45nA current from its inputs (check datasheet, negative because it sources current, opposite to the arrow from schematics below). This current can be utilized to generate voltage across the input, depends on how much resistance it encounters. I guess in this case the BC547 acts as variable resistance depends on photovoltaic current from green LED.

author: Zero999
author_rank: Super Contributor
timestamp: March 06, 2018, 08:20:34 pm
content: You need to look at the internal circuitry for the LM358 to understand why the input source a tiny current. Below is a simlified schematic of the LM358. I believe you need to be logged on to see it, as I posted it as an attachment elsewhere. Q2 and Q3 from a differential pair and Q1 and Q4 are emitter followers, which buffer the input signal and add a diode voltage drop to both inputs. A small current flows out of the bases of Q1 and Q4 in order to bias them on slightly and it's this current which powers the transistor in your circuit.