## Saturday, November 5, 2011

### LM3914 Based Battery Voltage Monitor

This voltage monitor is made to display the voltage of 12v battery (for UPS) on LEDs. For this purpose LM3914 is used. The voltage range decided to display is 10v to 13.5v for 12v battery. LM3914 is display driver that can be used in dot  mode or in bar mode; dot mode, with only one led is lit at a time, and in bar mode where it lights leds progressively when the voltage increases.

The circuit needs to be powered from the battery being measured and to be able to adjust the lower and upper voltages that light the first and last leds on the led bar.

For the 12V battery, the first led in the bar will lit at 10V and the last one at 13.5V, giving 0.35V per led. These thresholds may be set to other values by adjusting two trimmers in the circuit.

Calculation and Adjustments:
Current flowing per led is controlled by R3 resistor, by applying ohm's law
Ir3 =1.25v/ 4.7kohm =266uA.
Where 1.25v is the minimum voltage required to operate the led.

To be able to read the supply voltage from which the circuit is also powered, a voltage divider was placed at the input pin 5. This voltage divider consists of two 10KΩ resistors and the LM3914 will read voltages that range from 5V to 6.75V, when the battery voltage swings from 10V to 13.5V. These are the values that will be used to calibrate the LM3914.

R4 - defines the upper limit voltage of the voltmeter (pin 6):
We need to make the voltage at pins 6 and 7 stay at 6.75V (which represents 13.5V / 2 after the input divider of pin 5, when the battery if full). To determine the value of R4 we know the current flowing in R3 will also flow in R4 and will be added to the error current (120uA) from the adjust pin (pin 8). Using KVL, we arrive to the formula:

6.75V = 1.25V + R4(120uA+266uA)
=>R4 = (6.75 - 1.25)/(386uA)
=>R4 = 14K2 or more (a 22K trimmer is a good choice)

With the 22K trimmer we are able to change the voltage on pin 7 from 1.25V up to 9.74V which represents 2.5V up to 19.5V. Our required voltage of 6.75 falls well within this range.

R5 - defines the lower limit voltage (pin 4):
Using the voltage divider formula VO = VI * RB/(RA + RB) replacing its parameters with:

RA = 10 * 1K internal LM3914 resistors
RB = R5
VI = the upper voltage limit 6.75V
VO = the voltage for the lower led 5V
we get:
5 = 6.75 * R5/(R5 + 10K)
=>R5 = 28.5K or above

Adjust the voltage at R5's middle pin to 5V and the voltage at R4's middle pin to 6.75V before testing it on battery.  Voltages below 10V will turn off all leds and above 13.5V will maintain all leds lit.

Schematic: Battery Voltage Monitor
Components Required:
R1, R2------------------------10k ohm
R3---------------------------- 4.7k ohm
R4-----------------------------22k pot
R5-----------------------------50k pot
C1-----------------------------2.2uF/25v Electrolyte
FU1---------------------------500mA fuse
U1-----------------------------LM3914
U2----------------------------LED Bar-graph

#### 1 comment:

1. Extremely useful guide, thank you for the details on the calculations, it made the whole thing extremely comprehensable.

I have but one question: Why did you fix LED current to 266uA? I'd reckon an LED needs at least 10mA to light up, though I may be mistaken. Share your thoughts?