Connect with us

Led bar graph

Discussion in 'LEDs and Optoelectronics' started by Mr Musabe, Apr 26, 2020.

Scroll to continue with content
  1. Mr Musabe

    Mr Musabe

    9
    2
    Oct 10, 2015
    Good evening

    I am trying to create an LED single line bar graph t. Similar to a vu meter that can count between 1 and 50. The idea is for a button to be pressed each time a count is to be added and one extra LED will illuminate. So for example 3 leds will be lit for 3 counts press button fourth comes on. I also require the display to stay on unless cleared or reset.

    I know this is easily achievable with a microcontroller however I really want to avoid that on this occasion.

    Is there an IC that could be used which will allow this function. I have been looking at a 3914 IC and I could achieve this with a potentiometer which could work however I really wanted a push button

    Does anybody know of such an IC?
     
  2. Bluejets

    Bluejets

    4,293
    912
    Oct 5, 2014
    davenn likes this.
  3. Mr Musabe

    Mr Musabe

    9
    2
    Oct 10, 2015
    Thanks for the reply. I would have used a 4017 but I did want multiple LEDs on at once.

    I am definatley going to cascade the 3914's and experiment.
     
  4. Nanren888

    Nanren888

    348
    91
    Nov 8, 2015
    Bar or dot format: Check out the "mode" pin.
    50 LEDS all on will draw a little current.
     
  5. Bluejets

    Bluejets

    4,293
    912
    Oct 5, 2014
    A tip might be to run the LED's at a lower current perhaps 5mA.
    Would still be visible indoors.
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,614
    2,372
    Nov 17, 2011
    The LM3914 is imho not very suitable for this purpose. It is meant to be driven by an analog input voltage. So Mr. Musabe will have to create an analog front end that creates a voltage proportional to the number of button presses. Makes the task more difficult.
    Cascading 4017 is also not a very productive way. If you get it to work, you create a dot display, not a bar graph, unless you add heaps of additional decoding.

    Not necessarily. I suggest a shift register made from e.g. 74HC164 ics:
    Connect 7 of these chips in series to create a 56 bit shift register.
    Connect the data inputs of the first chip to logic high level.
    Connect an LED with series resistor from each of the parallel outputs to ground.
    Connect all clock inputs in parallel to the button. Note that it is an absolute must to add a debouncing circuit, otherwise the register will act erratically.
    Connect all reset inputs in parallel. Add a pull-up resistor to reset and a pull-down reset button to ground. No need for debouncing here.
    With each press of the (debounced) button a '1' is shifted into the shift register and the existing '1's are shifted one position further. Each '1' will light up the corresponding LED.
    When the reset button is pressed, all regsiters are cleared to '0', all LEDs are off.

    The shift register is possibly even more simple than using a microcontroller, because you would need port expanders for the µC to drive that high number of LEDs.
     
    davenn and hevans1944 like this.
  7. Bluejets

    Bluejets

    4,293
    912
    Oct 5, 2014
    Maybe just 1 if multiplexed.
     
  8. hevans1944

    hevans1944 Hop - AC8NS

    4,543
    2,116
    Jun 21, 2012
    And the winner is... @Harald Kapp! Again. Sometimes discrete solutions are better than microprocessors, and this is just the situation where a discrete solution using seven 8-bit shift registers works better.

    You still might want to add an open-collector buffer at each of the shift register outputs, perhaps as a discrete small-signal transistor such as 2N3904, to ensure enough LED current. Use a 2.7kΩ to 10kΩ base resistor connected to the shift register output; connect the emitter to logic common; and connect the LED, with a series current-limiting resistor, between Vcc and the transistor collector. In this configuration, the transistor operates as a saturated switch with about 0.1V between its collector and emitter when the shift register output is logic "1". The collector-emitter circuit appears to be open when the shift register output is logic "0".

    You can also use open-collector buffer ICs, but the discrete transistor approach works well if you lay the circuit out on a PCB with the LEDs next to the transistors. Advantage of having a buffer transistor is you can set the LED brightness by your selection of current-limiting resistor, up to the maximum current rating of the LED and/or transistor collector current. For 20mA LEDs (recommended), all 50 on at the same time would mean 1.00A of total current from a 5V power supply, or only 5 watts of power consumption. Power for the shift registers and switch de-bouncing ICs is negligible compared to the power required to light up the LEDs, so a 5V @ 1500mA supply is more than adequate.

    It looks like either the 74HC164 or 74HCT164 is capable of about 5 mA per output, but if all eight outputs are on at the same time that could be 40 mA, which exceeds the 25 mA absolute maximum output current. Hence my suggestion to use a buffer transistor at each of the outputs. However, if @Mr Musabe limits the current to about 2.5mA per LED, no buffers will be necessary, but the LEDs may be rather dim. It would be a good idea to experiment (on a solderless breadboard) to see what works for you. Although the transistors are cheap, zero transistors are less expensive than fifty.

    Can you draw a schematic based on our response so far? Or do you need us to do that for you?
     
    Last edited: Apr 27, 2020
  9. Harald Kapp

    Harald Kapp Moderator Moderator

    10,614
    2,372
    Nov 17, 2011
    Good point!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-