Maker Pro
Maker Pro

Led bar graph

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?
 
Circuit to do what you want with discretes would get complex really quickly.
You can cascade the LM3914 together and use possibly a couple of decade counters etc.
Reset no drama.
Others may be of more assistance with reference to a circuit.
http://www.learningaboutelectronics.com/Articles/Decade-counter-circuit-with-4017.php
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.
 

Harald Kapp

Moderator
Moderator
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.

Circuit to do what you want with discretes would get complex really quickly
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.

I know this is easily achievable with a microcontroller however I really want to avoid that on this occasion.
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.
 

hevans1944

Hop - AC8NS
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:
Top