How to measure VCC reference voltage

Hello all,

I am building a 5 volt battery pack which uses a
buck converter from 8.4v (two lithum-ion batteries in series)
volts to 5 volts.

I am using ATTiny85 ADC to read the battery voltage (one cell to
ground) to let me know when I need to recharge the pack.

I am using the 5 volt output from the buck converter to power the ATTiny.

Is there a way to measure VCC via the ADC ?

There is the adc channel choice to measure Vbg which is some internal
measurement but I do not know what Vbg represents. Maybe I can
use that.

I want to measure VCC so if it changes I can
make an adjustment to the battery measurement.

Thanks in advance

I've never tried it, but see [u]this page[/u].

...There is a way to measure the internal-optional 1.1V reference using Vcc as the actual reference. If Vcc is not 5V, you'll get an error (a difference) and from that error/difference you can calculate the actual Vcc.

Of course, this won't tell you anything useful until the battery falls to nearly 5V and the voltage regulator drops-out of regulation.

The buck converter delivers 5 volt as long as the voltage of the battories are higher than the buck converter minimum input level. I would measure the battory pack, 8.4 volt, using a voltage divider. Using a DVM You can calibrate the readings if You want. The important reading is the point where the buck converter will cut off.

The tiny85 also has a 2.56V internal reference.

I would think that you should be more interested in the battery voltage than Vcc to tell when charging is necessary.

Voltage divider tutorial

groundFungus:
The tiny85 also has a 2.56V internal reference.

I would think that you should be more interested in the battery voltage than Vcc to tell when charging is necessary.

I want to use VCC as a reference so I don't have to use resistors.

DVDdoug:
I've never tried it, but see [u]this page[/u].

Thanks for that link. That will work for me.

Railroader:
The buck converter delivers 5 volt as long as the voltage of the battories are higher than the buck converter minimum input level. I would measure the battory pack, 8.4 volt, using a voltage divider. Using a DVM You can calibrate the readings if You want. The important reading is the point where the buck converter will cut off.

Good advice. I will do this if VCC doesnt work as a dependable reference.

Measuring the battory gives You the possibilty to take action before Vcc starts dropping, refs start to go bad etc.

Jst run some tests to determine the point of danger. The margins are Your choice.

Railroader:
Measuring the battory gives You the possibilty to take action before Vcc starts dropping, refs start to go bad etc.

Hello Railroader,
I hear what your saying. The buck drops out at 6.5 volts. By the time the cell reaches
3.3 volts the cells should be recharged since there is very little energy left at that point (based on my discharge curve) but it is enough so that the 5 volts doesnt drop out.

Basically i have it set up to blink leds to let me know what the battery cell voltage is. ie 3.5 volts is 3 blinks pause 5 blinks.

If I have a pin left I may just use a voltage divider then I can monitor the series connection. ATTiny85
as you know do not have many pins. Then I can pull the pin low make a measurement then high z it.