# Using OpAmp to drive LEDs according to incoming signal

Following schematic was suggested for visualizing the frequency (which is variable) of an oscillator using two LEDs that light up alternatingly. It seems that the value of the resistor determines how much voltage is provided to the LEDs. I've never seen this circuit before and was wondering, is there no need for a current limiting resistor for these LEDs?

simulate this circuit – Schematic created using CircuitLab

• An LED sets its own voltage. You vary its brightness by varying its current. In this circuit the voltage feeding the resistor's input produces a current in the resistor and the opamp inverts it and causes the LED current to be the same as in the resistor. – Audioguru May 18 at 21:36
• @Audioguru Thanks! – flawr May 18 at 21:52

R1 is already the current limiting resistor. Since no current is flowing into the opamp input, and its inverting input is at ground due to the feedback loop, the current through R1 will flow directly into the diodes. Therefore the current flowing through the LEDs will be $$I_D = V_{osc}(t)/R_1 = \frac {5V} {4.7k \Omega} sin( \omega t)\, .$$ The current amplitude through the LEDs is approximately 1mA. In the equation I have assumed sinusoidal oscillation.
• Ah I think now I understand: Since the inverting input is kept at 0V, we can compute the current flowing throu the resistor using Ohms Law, which is $I = V_{osc} / R_1$. Since (in the ideal case) there is no current flowing through the inverting input, all the current must go through the LED, therefore the current through the resistor is equal to the current through the LEDs. – flawr May 18 at 21:51