internal 1.1v reference not working?

Hi!

i am trying to read a battery voltage, made voltage divider and the output voltage of that is around 1.00V at the moment.

using analogread with the default reference gives me a value of around 218 (fits) but using the internal 1.1v reference gets me a value of 212. Whats wrong there?

void loop(void)
{
analogReference(INTERNAL);
int adc = analogRead(A0);
delay(10);

...

its in the loop and the values stay around the same.

any ideas?

Thanks!

What model of Arduino are you using? Complete code might help too.

And .... I would put the and “analogreference” bit in setup

  • when you change the reference the first few values can be in error - it looks like you are setting the reference every time you loop, not sure but that might be the problem ?

Google “ Arduino internal reference”

You’ve not listed all your code , so there may be other mistakes .