# Circuit to indicate 1 to 10 based on pressed switch

I am looking for a circuit which can turn ON/OFF 10 LEDs based on the switch pressed (push to ON, release to OFF). It is like an LED graph.

My requirement is:  - Initially no LED is ON. - If switch 1 is pressed then LED 1 turns ON LEDs 2 to 10 turns OFF - If switch 2 is pressed then LEDs 1 to 2 turns ON and LEDs 3 to 10 turns OFF - If switch 5 is pressed then LEDs 1 to 5 turns ON and LEDs 6 to 10 turns OFF - If switch 4 is pressed then LEDs 1 to 4 turns ON and LEDs 5 to 10 turns OFF - If switch 3 is pressed then LEDs 1 to 3 turns ON and LEDs 4 to 10 turns OFF and so on...

The components can be ICs or transistors, doesn't matter as long as this can be achieved. But no Arduino please. Should be simple.

Thanks

Update 1: Forgot to mention that the state of the LEDs should be maintained even after switch is released unless other switch is pressed. I hope this makes sense.

• When you say "LED 1-3 turns ON and rest are OFF", do you mean that LEDs 1 through 3 turn on, and LEDs 4 through 10 are off? Oct 22, 2015 at 0:15
• Yes that is correct Oct 22, 2015 at 0:21
• You might want to clarify this in the question body, rather than in these comments. Oct 22, 2015 at 0:30
• I thought 1-3 generally means 1 to 3. Anyways I have edited my question. Thanks for pointing out. Oct 22, 2015 at 0:33
• get a 10-gang radio-button set :) Oct 22, 2015 at 1:40

Here is a sketch for my solution. This is just an abstraction, and but you can use your imagination to see how more channels are chained toward the bottom. Be sure to put some base resistance in there!

Not 100% sure this will work, but it's a place to start.

Edit: Fixed the schematic

simulate this circuit – Schematic created using CircuitLab

• If you edit your post, then underneath the image of the schematic in the preview is a small font text saying "edit the above circuit". If you click this you can modify your schematic. Oct 22, 2015 at 1:03
• 12V is not ehough for 10 leds in series. Oct 22, 2015 at 1:41
• Example circuit is example. Oct 22, 2015 at 4:48

There are a lot of ways you could accomplish this. Using an ATMEGA328 microcontroller chip you can provide up to 40ma per pin, however you cannot source more than a total of 200ma.

This means that if you want to directly drive 10 leds then they need to draw less than 20ma each. Green LEDs appear the brightest for a given amount of power. Try running a single green led at 15ma and see if it is bright enough. If so you can run it directly off an ATMEGA328 doing all the hard work in software. With 23 IO pins the ATMEGA328 has enough pins to run all 10 LEDs and the 10 buttons.

If you need more power for you LEDs then you can use an external LED driver chip. The only one I am familiar with is the MAX7219. It is designed for up to 64 LEDs so it may be more than you need, there are probably drivers better suited to your task.

A microcontroller may be overkill but it will get the job done. I am sure someone here knows how to do this with logic gates.

• Thanks. Yep that looks complex. I am looking for simple solution. Oct 22, 2015 at 0:38
• I think you will find that using a microcontroller for a task like this is not so complex after you see the alternatives. Oct 22, 2015 at 1:05
• So, on power-up you want all of the LEDS to be OFF and, thereafter ,anytime you press a pushbutton you want all the LEDs from zero to the one corresponding to that pushbutton to turn on and the rest to turn OFF? Oct 22, 2015 at 3:30