# atTiny85 internal Vcc analog voltage reference

**URL:** <https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423>\
**Category:** 3rd Party Boards\
**Created:** [January 21, 2026, 5:22am UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423 "2026-01-21T05:22:45Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [January 21, 2026, 10:49pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/21 "2026-01-21T22:49:01Z")

</div>

Maybe that serial library does something weird.  
Did you already try different pins (for serial and analogue).  
Leo..

---

<div class="post-metadata">

**Author:** ![stitech](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stitech/32/1016377_2.png) [@stitech](https://forum.arduino.cc/u/stitech)\
**Post date:** [January 21, 2026, 11:45pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/22 "2026-01-21T23:45:44Z")

</div>

The function `analogRead()` will also set the reference bits to what was defined in `analogReference()`, in your case still default (VCC).

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [January 22, 2026, 2:48am UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/23 "2026-01-22T02:48:58Z")

</div>

> [@danbecker75](#):
>
> I guess the voltage graph wasnt clear.

Now that I have read it it is clear. Sorry.  
Maybe a 100nF decoupling capacitor close to the chip and across its power rails should be added. Other than that, it sounds almost like the pullup resistor on PB4 could somehow be active.

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [January 22, 2026, 5:24am UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/24 "2026-01-22T05:24:18Z")

</div>

> [@stitech](#):
>
> The function `analogRead()` will also set the reference bits

Perhaps, no!

I think that the following tasks are embedded in the` int y = analogRead(A2);` instruction.

//--default Vref = AVCC = VCC = 5 V  
//--default 125 kHz ADC clock  
//--default right adjustment of converted data  
**1.** ADC Channel-2 (A2) is selected,  
**2.** Slight waiting for mux stabilization,  
**3.** Issuance of Start Conversion,  
**4.** Wait for conversion completion or keep polling EOC/ADIF status, and  
**5.** After conversion, 16-bit ADC data (upper 6-bit are always 0s) enters into` y` variable via \<ADCH, ADCL\> registers of the ADC.

---

<div class="post-metadata">

**Author:** ![stitech](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stitech/32/1016377_2.png) [@stitech](https://forum.arduino.cc/u/stitech)\
**Post date:** [January 22, 2026, 5:54am UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/25 "2026-01-22T05:54:36Z")

</div>

> [@GolamMostafa](#):
>
> I think that the following tasks are embedded in the` int y = analogRead(A2);` instruction.

The function `analogReference()` fills variable `analog_reference`. If not called, `analog_reference` remains 0 (default).

The function `analogRead()` uses lookup tables to find the input to be used.  
It also reads the variable `analog_reference`.  
These two are combined and written in one go to register `ADMUX`.  
In register `ADCSRA` one bit is set: `ADSC` (start conversion).  
This bit is read repeatedly until it clears (conversion complete).  
The function returns the result of the conversion.

Notice that the clock speed is not touched.

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [January 22, 2026, 5:56am UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/26 "2026-01-22T05:56:58Z")

</div>

> [@stitech](#):
>
> The function `analogReference()` fills variable `analog_reference`. If not called, `analog_reference` remains 0 (default).

I didn't know that. Thank you.

If I do not execute `analogRefernece(INTERNAL/EXTERNAL);` prior to executing `analogRead(),` the VREF of the ADC will remain connected at default 5V -- am I correct?

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/e/2/9e2caeea593e5ef94fba323ff01bbf39be0cd3b4.png)

---

<div class="post-metadata">

**Author:** ![danbecker75](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/danbecker75/32/1126465_2.png) [@danbecker75](https://forum.arduino.cc/u/danbecker75)\
**Post date:** [January 22, 2026, 12:18pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/27 "2026-01-22T12:18:04Z")

</div>

I appreciate that info. I’m going to dig into the library code. it would sure explain how I’m not getting a 5 Volt reference. and I need to see what happens if I apply 5V to PB0 which is currently floating in my setup.

---

<div class="post-metadata">

**Author:** ![stitech](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stitech/32/1016377_2.png) [@stitech](https://forum.arduino.cc/u/stitech)\
**Post date:** [January 22, 2026, 2:13pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/28 "2026-01-22T14:13:58Z")

</div>

> [@danbecker75](#):
>
> apply 5V to PB0

Warning! Do not exceed VCC!

---

<div class="post-metadata">

**Author:** ![danbecker75](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/danbecker75/32/1126465_2.png) [@danbecker75](https://forum.arduino.cc/u/danbecker75)\
**Post date:** [January 24, 2026, 9:24pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/29 "2026-01-24T21:24:51Z")

</div>

Whelp, turns out the issue was a bad chip. Things I tried in the meantime;

1. tried applying vcc to the AREF pin. got different results, readings maxed out (saturated) at about 4.4 V instead of the 3.25 or Vcc. but that still was not as expected.
2. turned off all the pullups by setting PUD in the MCUCR register. no difference.
3. replaced chip. all worked as expected. getting a full range of sensor readings from 0 to Vcc (5 volts.)

I appreciate all the responses and suggestions. Thanks. I didnt expect a bad chip since everything else seemed to work correctly.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 23, 2026, 9:25pm UTC](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423/30 "2026-07-23T21:25:01Z")

</div>

Closed on July 23, 2026, 9:25pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.arduino.cc/t/attiny85-internal-vcc-analog-voltage-reference/1426423.md?page=1)
