LED bar graph displays are the simplest yet most effective way to visualise levels — audio volume, fuel quantity, battery charge, signal strength, or any analogue value. A row of 10 LEDs that light up progressively is instantly intuitive to anyone. This guide covers building volume meters, fuel gauges, and battery indicators using 10-segment LED bar graphs.
What Is an LED Bar Graph
An LED bar graph is a row of 10 LEDs in a single DIP package. Each LED is independently controlled but shares a common form factor:
- 10 segments in a single rectangular package
- Available colours: red, green, yellow, blue, white, and multi-colour
- Multi-colour variants: 2 red + 3 yellow + 4 green + 1 blue (mimics VU meters)
- 20-pin DIP package: 10 anodes + 10 cathodes
- Individually controllable: each segment is a separate LED
Types of Bar Graph Displays
- Single-colour bar graphs: All 10 segments the same colour. Cheapest option at Rs.18-30.
- Multi-colour bar graphs: Traffic light style — green at bottom, yellow in middle, red at top. Rs.30-45.
- LM3914/LM3915 driver modules: Complete bar/dot display drivers that convert analogue voltage to LED bar without a microcontroller. Rs.40-80.
Wiring 10-Segment Bar Graphs
Each LED needs its own current-limiting resistor (220 ohm for 5V):
// Direct drive from Arduino (10 pins)
int barPins[] = {2,3,4,5,6,7,8,9,10,11};
void setLevel(int level) { // 0-10
for (int i = 0; i < 10; i++) {
digitalWrite(barPins[i], i < level ? HIGH : LOW);
}
}
To save pins, use a 74HC595 shift register (3 pins for 10 outputs) or the LM3914 (0 pins — pure analogue operation).
Audio Volume Level Meter
Build a classic VU meter using a multi-colour bar graph and an electret microphone:
- Connect microphone module analogue output to Arduino A0
- Sample audio at high rate, calculate peak amplitude
- Map the amplitude to 0-10 LED levels
- Add peak hold (brightest LED stays lit briefly then fades)
void vuMeter() {
int sample, peakVal = 0;
for (int i = 0; i peakVal) peakVal = sample;
}
int level = map(peakVal, 0, 512, 0, 10);
setLevel(level);
}
Fuel or Water Level Gauge
Use an ultrasonic sensor (HC-SR04) or float switch array to measure liquid level:
- Mount HC-SR04 at the top of the tank, pointing downward
- Measure distance to liquid surface
- Calculate fill percentage and map to 10 LED segments
- Use green (full) to red (empty) multi-colour bar graph for intuitive display
This is popular for overhead water tanks in Indian homes — no more climbing to the roof to check water levels.
Battery Level Indicator
Map battery voltage to LED segments:
- 3.0V (empty) = 0 bars
- 3.3V = 2 bars
- 3.5V = 4 bars
- 3.7V (nominal) = 6 bars
- 4.0V = 8 bars
- 4.2V (full) = 10 bars
Use a voltage divider to bring the battery voltage within the Arduino ADC range (0-5V or 0-3.3V for ESP32).
Cascading Multiple Bar Graphs
For wider displays (20, 30, or 40 segments), cascade multiple bar graph modules side by side. Use shift registers to keep the pin count manageable. A 40-segment audio spectrum analyser using 4 bar graphs looks spectacular.
Recommended Bar Graph Modules
Frequently Asked Questions
How many pins does a 10-segment bar graph need?
10 pins for direct drive, or 3 pins when using a shift register, or 0 microcontroller pins with an LM3914 analogue driver.
Can I use PWM for brightness on bar graphs?
Yes. Use PWM on the shift register output enable pin to control overall brightness, or use individual PWM pins for each segment.
What is the difference between LM3914 and LM3915?
LM3914 has linear response (equal voltage steps). LM3915 has logarithmic response (3 dB per step), making it better for audio VU meters.
Shop Display Modules at Zbotic.in
India’s trusted source for OLED, LCD, TFT, LED matrices, and more. Fast shipping across India.
Add comment