-1
\$\begingroup\$

For a better explanation let's think something like an equalizer bar Think one of these bars Think one of these bars. The coloumn has 16levels from bottom to top. If the level 10's led need to light up then, the all levels leds must be light up as well and etc for other conditions.

My aim is lighting up LEDs cumulatively with transistors or IC. To explain it, for example: I have an decoder and 3 leds.

  • Output1(of the decoder) pin will light up LED1
  • Output2(of the decoder) pin will light up LED1 and LED2
  • Output3(of the decoder) pin will light up all 3 of the LEDs

How can i achieve that system in minimal way. By the way leds are standard 5mm. They drain 20mA.

Edit: Sorry i forgot. Arduino connected to input of the decoder so i want to control 3leds with 2pins of the arduino. Leds are operated on 5V and the decoder is 74HC139.

\$\endgroup\$
13
  • \$\begingroup\$ You have the arduino tag, but you don't mention any arduino. If there is no arduino here, remove the tag. If there is an arduino, explain where it is! \$\endgroup\$ Commented May 27, 2016 at 16:29
  • \$\begingroup\$ Sorry i forgot. Arduino connected to input of the decoder so i want to control 3leds with 2pins of the arduino and it must be in cumulative way. \$\endgroup\$
    – Reactionic
    Commented May 27, 2016 at 16:33
  • \$\begingroup\$ What decoder IC is being used? What is the LED supply voltage? The LED's will draw 20mA only if the resistor in series with them is a low value. \$\endgroup\$
    – user105652
    Commented May 27, 2016 at 16:34
  • \$\begingroup\$ Leds are operated on 5V and the decoder is 74HC139. \$\endgroup\$
    – Reactionic
    Commented May 27, 2016 at 16:41
  • 1
    \$\begingroup\$ Please edit the question to include the details which clarified in the comments. You should aim to make it easy for people to give a good answer to your question. \$\endgroup\$ Commented May 27, 2016 at 16:47

2 Answers 2

1
\$\begingroup\$

Alternatively if you wanted to keep it digital and wanted to run a serial interface to reduce the number of pins, you could use a max7219.

\$\endgroup\$
0
\$\begingroup\$

If I understand your question:

How can I use a few gpio pins to drive a led bar graph?

You need an LM3914 or LM3916.

\$\endgroup\$
5
  • \$\begingroup\$ You build an R2R ladder from the 2 pins to get a drive signal for the IC's. Or an R+R ladder. \$\endgroup\$
    – user105652
    Commented May 27, 2016 at 17:26
  • \$\begingroup\$ But how can i connect Arduino to LM IC. Analog write function uses PWM. Do i need something between arduino and LM IC? \$\endgroup\$
    – Reactionic
    Commented May 27, 2016 at 17:33
  • 1
    \$\begingroup\$ It is silly to convert digital to analog just to feed it into a LM391x chip. And it is NOT AT ALL CLEAR why we have a perfectly good microcontroller here (Arduino) but @Reactionic can use only 2 pins??? If you really want to use 2 pins (I2C) then use a MAX7219 chip which will control 64 LEDs from 2 wires. Or the new Charlie-plex boards from Adafruit, etc. \$\endgroup\$ Commented May 27, 2016 at 19:12
  • \$\begingroup\$ Yes it is, but that's what he is asking for, no? Lol. I think we both suggested the max 7219 at the same time 😃 \$\endgroup\$ Commented May 27, 2016 at 19:13
  • \$\begingroup\$ @Reactionic There are tons of examples, but as RichardCrowley points out, there are much better ways of doing than what your asking. \$\endgroup\$ Commented May 27, 2016 at 19:22

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.