# How to find battery voltage with simple voltage divider circuit connected to ADC of microcontroller? [duplicate]

The problem with circuit is that it may give same ADC value even when the voltage of battery drops.....so please give me suggestions on that...thanks in advance.

• I suggest you add your schematic. Apr 3, 2017 at 16:33
• You need a precision voltage reference, otherwise the supply to the voltage divider will decrease and the output will scale accordingly Apr 3, 2017 at 16:39

The problem you have is that the A/D uses Vdd as it's reference, so therefore it can't measure Vdd.

You need a different reference voltage somehow. Possible options are:

1. Run the A/D from the internal reference voltage, if your micro can do this. Measure something linearly derived from Vdd. The measurement is then proportional to Vdd.

2. Run the A/D from a external reference voltage. Very little current is usually needed, so any tiny linear or shunt regulator can do this.

3. Feed the internal reference voltage into the A/D. The Vdd level is proportional to the reciprocal of this reading.

4. Same thing as #3, but using a external reference voltage. The advantage of this over #2 is that the reference can be lower, below the full reference voltage the A/D requires.

You can use the following simple circuit: simulate this circuit – Schematic created using CircuitLab

U2: 1.8v voltage regulator

When the battery is full at 5v the voltage at A0 will be 1.6v . If the voltage of the battery drops The voltage at A0 drops as well but the power supply of the MCU is fixed at 1.8v.

The disadvantage of this solution is that the resistors R1 and R2 are going to drain the battery. You had better choose bigger values.

This is a simple solution and it can be improved. there are other solutions to not drain the battery by using two transistors like someone suggested here. Combining the two solutions would be a good step toward a better design.

Take care to choose values suitable for your application.