0
\$\begingroup\$

I am trying to build a simple circuit that contains 4 LEDs. All LEDs (except for the first) would initially be off. I would then like to use a potentiometer to turn on the LEDs one-by-one.

For example, when the potentiometer is turned between 0 and 25%, only the first LED should be on. When it is turned to 50%, LED one and two should be on, 75% first second and third LED and 100% all four.

If anyone could assist in explaining to me how this could be achieved without the use of any programmable devices such as Arduinos it would be much appreciated.

\$\endgroup\$
6
  • \$\begingroup\$ quad comparator 339 \$\endgroup\$
    – Neil_UK
    Commented Jun 16, 2021 at 20:05
  • \$\begingroup\$ A simple voltage divider with a few window comparators should do the trick :) \$\endgroup\$
    – uriyabsc
    Commented Jun 16, 2021 at 20:06
  • 2
    \$\begingroup\$ It'll work like this circuit does: hackaday.io/page/… \$\endgroup\$
    – ErikR
    Commented Jun 16, 2021 at 20:29
  • \$\begingroup\$ If you're not too fussy about what LED ON means (regarding brightness), then a quad comparator isn't needed....a LED/resistor ladder should work. \$\endgroup\$
    – glen_geek
    Commented Jun 16, 2021 at 20:51
  • \$\begingroup\$ Is there some reason why you wouldn't use a 4PST rotary switch? \$\endgroup\$
    – john
    Commented Jun 17, 2021 at 11:22

2 Answers 2

1
\$\begingroup\$

As suggested in comments a Quad comparator that can drive say > 20mA easily works here.

Do you know how a string of 5 equal >=10k resistors from 0V to V+ works with 4 thresholds going to 4 comparators using Vin+? 20,40,60,80% with the ends of the string on =+V,0V just like the pot!

Then tie all the inputs of Vin- to your pot wiper which is connected to same V+, 0V , so that when each comparator sees the changing Vin- exceed the reference voltages of 20%, 40%,60%, 80% then the output goes active low (open collector in saturation) so you can use a current limiting resistor to pull down the LED cathode (-) with + on +Vdd supply. You only need 5V to do this. for 20mA max compute the voltage drop after the Vf of the diode to choose the R’s on collector.

  • usually pots are numbered 1,2,3 and CW direction goes from 1 to 3 . So with 3 on V+ and 1 on 0V , then the wiper pin 2 goes up to pin 3 with a clockwise , CW Turn.

Let’s see if you have any questions.

Keep the pot connections short or twist the pot 3 wires for noise immunity and use a clean supply with a cap, near the IC.

\$\endgroup\$
1
\$\begingroup\$

As ErikR found, this image from Hackaday illustrates the general idea.

V1 is your variable input voltage.

Choose resistors R1,2,3,8,9 to select your trip points, this circuit doesn't have 25%, 50%, 75% trips at the moment.

It's not quite a full solution to the question as posed, as the LM339 voltage common mode input range Vcir only goes up to Vcc-1.5 V at 25C, or Vcc-2 V over the full temperature range. You would need to either increase V2 to more than 5 V, or to use an alternative comparator with a wider Vcir. As an alternative, as the Vcir goes down to 0 V, you could sneakily offset the input signal down with a large bias resistor, depending on what input bias current you could tolerate, with a corresponding offset in the trip points. Or less sneakily, simply attenuate the input signal with a resistive divider.

A further difference is that all the LEDs are on for 0 V input, and go off progressively as the input voltage increases. Swap the + and - inputs of each comparator to correct this.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.