[sdiy] Question about LEDs
David G. Dixon
dixon at interchange.ubc.ca
Tue Apr 7 19:34:56 CEST 2009
Wow! Thanks for the impassioned replies to my simple query! I will let my
LEDs blink their little hearts out! (In any case, I couldn't figure out any
way to deactivate them which wouldn't have involved adding a switches to the
front panel, and I still can find no good way to turn off a self-oscillating
LFO short of unplugging it...)
Luis: answer to your question below...
> On a related note, I have bicolor LEDs for modules that produce both
> positive and negative outputs - my LFOs, for example.
> In order to activate those accordingly (RED when the output is positive,
> GREEN when it goes negative), I had to use a number of components in the
> LED
> drive circuitry. Positive is fine: resistor + NPN transistor + LED +
> current
> limiting resistor. Now, for the negative side I had to first invert the
> input via one op. amp at unitary gain, then it goes diode (so only the
> negative semicicle is taken in account) + resistor + transistor + LED +
> resistor. The LED is a common-cathode (3 wire) LED.
>
> Is there a simpler way I could have done it?
Luis: this is exactly what I'm doing with two LEDs -- yellow for positive,
and red for negative -- and yes, there is a much simpler way (although,
please bear in mind, it took me one iteration of a board design/build to
discover it). First, a little background:
My circuit is a triple LFO (i.e., three identical LFOs) which produces
saw-triangle-ramp and PW-adjustable pulse, with the duty cycle depending on
a shape knob. (I'm using diodes rather than JFETs.) Hence, I have four
opamps (= 1 TL074) per LFO: an integrator to generate the triangle output, a
comparator to generate a square wave from the triangle, an inverter to
invert and attenuate the square wave to +/-5V (this opamp is also wired,
with four diodes and a DPDT On-On-On switch, as a switchable active
rectifier to give either +, +/-, or - square waves), and a buffer which
takes the comparator output, through a rate pot, and feeds it through two
opposite-facing diodes and a shape pot to the integrator.
I wanted two LEDs for each LFO, one for when the square is negative, and one
for when the square is positive. That means that the ratio of durations of
each LED will indicate the duty cycle of the PW and/or the relative
rampiness of the triangle.
Here's how I hooked them up: the output of the comparator is taken through a
270k resistor, and hooked to the bases of two transistors, one NPN (2N3904)
and one PNP (2N3906). Hence, the two bases are common. Also, both emitters
are grounded. The LEDs are fed off of the collectors through 2.2k
resistors. The negative-indicating LED, connected to the PNP transistor, is
pointing towards -15V, and the positive-indicating LED, connected to the
NPN, is facing away from +15V. Hence, both LED circuits are dropping 15V
across 2.2k plus the LED, in opposite directions. The positive one will
light when the NPN transistor saturates on the positive square, and the
negative one will light when the PNP transistor saturates on the negative
square.
This should work beautifully. You may wish to fiddle with the value of the
2.2k resistor until the brightness is to your liking.
I could also have fed the bases from the triangle, which would have given a
nice indication of the amplitude, but would not have given an indication of
the rampiness, as the triangle spends equal amounts of time above and below
ground, regardless. However, to do this is also very easy. Simply take the
base inputs from the integrator rather than the comparator, and replace the
270k resistor with a 100k resistor (to handle the 5V input rather than the
13.6V input).
I hope this answers your question.
More information about the Synth-diy
mailing list