LED Bar-graph Display


LED bar-graph displays are much popular in battery level indication, water level indicator applications. Most of the inverter units have LED bar-graph display on its front panel. As we have seen in previous application we used only one LED to indicate battery level. With reference to above application we are showing voltage level on LED bar-graph display. Bar-graph display has multiple LEDs 8 or 10 LEDs in a column. One terminal is common and other terminals are used for giving supply. It is available in common cathode and common anode, with different color and size options.

LED Bargraph Displays
LED Bargraph Displays

Problem Statement

In this example we use 10 LED bar-graph to show voltage level from 0 to 5V. Zero volt corresponds to all led off and 5V to all LEDs on. As we know that to operate 10 LED’s we need 10 IO Lines but in all our examples we focus on minimum IO lines utilization. For this example we use low cost 74HC595 8-bit shift register with latch. Refer its datasheet for more information. We need only three IO lines to control this shift register output. Shift register take input in serially Data, Clock. Third line we need is “Latch” when we are putting data in shift register it will not affect previous status of its output until we give latch pulse.

Circuit Connections of Bargraph Display with Arduino

Before we move to bargraph display connection with arduino, Lets understand Bargraph display pin connections. Pin no 1 can be identified by the bevel, normally 330 Ohm to 1 K Ohm resistor is used for current limiting at 5V supply. For 12V supply use 4.7K Ohm current limiting resistor. From the figure 3.2 you can clearly understand that bargraph displays are simply LED’s connected in a row.

75LS595 Pin Diagram
75LS595 Pin Diagram

Let’s understand pins of 74HC595 8-bit shift register. It has eight outputs QA to QH, Operating supply voltage is from 2 to 6V, we connect Vcc (Pin 16) to 5V. Pin 8 is ground.

SER Pin 14: At this pin we give data to be shifted in the shift register. It is Data Pin.

OE Pin 13: It is active low pin, when we connect it to ground (logic 0) the outputs are enabled, when this pin is at logic 1, outputs are in tri-state.

RCLK Pin 12: At rising edge of input pulse Contents of Shift Register transferred to output latches. It is Latch Pin.

SRCLK Pin 11: Clock input pin, data is shifted in when clock pulse is given.

SRCLR Pin 10: Active low pin when this pin becomes low shift register is cleared. Connect it to Vcc (Logic 1).

QH Pin 9: Serial Data out used to connect multiple shift registers in series. Useful when we want to connect more than 8 LED’s.

Bargraph Voltmeter
Bargraph Voltmeter

Arduino Code for Voltage Bargraph Display


            Turn the variable resistor to vary voltage on ADC Channel A0 and observe that Bargraph shows the voltage level according to voltage value. In this example we used five IO lines to control display, three IO lines to control 8-bit shift register and 2 for remaining LEDs. The advantage of this you can make blinking of bottom LED’s easily.

Leave a Reply