Electronic – How to generate a reference voltage in a circuit

voltage-reference

Hi Im very new to electronics and had a pretty basic question about voltage reference.

So Ive finally understood that in order to check a voltage in most circuits, a voltage reference is used. The way i visualize this is a chip having 5 wires; the first 2 go to the battery which the voltage needs to be measured, another 2 go to a steady power source(the voltage from the first battery gets compared to this steady source and a voltage reading is obtained) and the last wire is an analog wire(ex. to use on arduino for displaying the voltage read).

I know that if i use only 1 battery for both the voltage readings and to power the voltage reference chip, i will always get a value of 1023, because the voltage measured is always compared to that same value giving a max voltage all the time.

With this in mind my question is: How do i use only 1 power source(in this case the battery, without the steady power source) to power the whole circuit and read the voltage of that same battery? Im basically asking how for example phones are able to measure their battery voltage even without a mini battery powering the voltage reference circuit. Thanks in advance.

Best Answer

You want to know how to measure the battery voltage that's powering the analogue to digital converter. well unless you can use a different voltage as the anaglogue reference voltage you can't

You want to know why you get 1023 (the highest ADC reading possible on your device) - that's because the battery voltage is equal to (or higher than) the reference voltage.

So what can you do?

One option is to get a reference voltage source to provide a fixed "V_AREF" supply to the ADC. this is often using a shunt reference (more on that later) this will produce a lower voltage than the battery gives, so you also need to reduce the battery voltage (eg. using a resistive divider to reduce the battery voltage by some ratio) so that it falls inside the new measurement range of the ADC

another option is to get use the battery voltage as reference and mesure a known lower voltage "VREF" that is less than the battery voltage and measure that with the ADC

Eg. The VREF is 1.25V you measure it and to comes out at 315 on the ADC. you then do some arithmetic: if 1.25V is 315 what voltage would be 1023 ? 1023 / 315 * 1.25 =

This is a good method because you can power the voltage reference source from one of the GPIO pins, so when you don't need it you can turn it off so that it doesn't consume energy.

The voltage reference could be something cheap like a LED, or a precision reference like TL431CLPG depending on how much precision you need.

Related Topic