LED Battery Level Indicator can be built using Arduino UNO board and 10 LEDs. Similar design that uses 2×16 LCD display can be found at this link. RGB LED variant is here. For Raspberry Pi version click here. I/O lines are directly driving 10 colored LEDs (4 – Green, 2 – Yellow, 2 – Orange and 2 Red light emitting diode).The output LED current is limited with 220 Ohm resistors. Resistor values can be modified according to LED forward current and desired intensity levels.
The code is also very simple. It just samples A0 analog input and then divides the entire range from 0-5V to 10 equal segments. If the input is within one of these voltage segments the relevant LEDs will be turned ON. More details can be found in the attached Arduino sketch. Design schematic is shown in the next figure.
10k was added as a simple voltage divider only for testing. It can be removed if a “real” variable signal is connected to A0 analog input. Here a short video showing this circuit operation.