Often, simple robotics projects are powered from a small power bank consists of common dry cells (1.5Vx4=6V) or Lithium-Polymer cells (2S LiPo=7.2V). Ofcourse, the 5V required for the microcontroller and related circuits is derived from this input supply using a low-drop linear fixed voltage regulator like LM1117-5. Here is a simple yet useful circuit of a Robot Battery Meter, capable of displaying the battery voltage level in a clearly-visible 10-LED Bargraph display. After successful construction, you can attach this module to your existing robotic project without any difficulty.
The circuit is based on the renowned LM3914 IC from National Semiconductors (NSC). The LM3914 is a monolithic integrated circuit that senses analog voltage levels and drives 10 LEDs, providing a linear analog display.
Current drive to the LEDs is regulated and programmable, eliminating the need for bundled resistors. A single pin can change the display from a moving dot to a bar graph, thus various novel display solutions are possible with this wonder chip!
Schematic, PCB artwork and prototype of the Battery Level Indicator
In principle, circuit presented here is a 10-LED bargraph voltmeter module with full-scale deflection (FSD) of 10 Volts. Resistor R1 sets the on current of all LEDs at about 10mA. The low ends of the internal reference and divider are grounded and their top ends are joined together, so the voltmeter has a basic full-scale sensitivity of 1.2Volts.
But variable ranging is provided by the R2-R3-P1 potential divider network at the input of the circuit (FSD = 1.2V(1+ (P1+39) /10). Here, the value of R3 is 39K, and the maximum value of the 100K preset pot P1 is 50K.
Thus when P1 is zero, FSD is about 5.1Volt, but when P1 is at its mechanical midpoint (50K) the FSD is near 10.1Volt. Remember to use precision resistors as R2,R3 (1%) and P1 (multi-turn) for better display accuracy.