Internal Pullup of ADC A1

Hi

Im using Atmega2560 board with a LCD Keypad Shield. A0 is for the keys and works fine. A1 should read a analoge voltage 2-4,5 Volt, LiPo battery. In the case that no battery is connectet to A1, it should read the 5V of the internal pullup resistor.

Unfortunately the internal pullup doesn’t work. Because it reads 4,33Volts but no 5V.

Could you please tell me my mistake which is some where.

Any input is welcome.

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup() {
lcd.begin(16, 2);
pinMode(A1,INPUT_PULLUP);
//pinMode(A1, INPUT); //
//digitalWrite(A1, HIGH);//Pullup adc
}

void loop() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(analogRead(A1)*0.004887);
delay(100);
}

Why do you think the pin is pulled up to 5V? That is something that happens to digital pins, not analog pins.

Perhaps it was this, from https://www.arduino.cc/en/Tutorial/DigitalPins

While the title of this document refers to digital pins, it is important to note that vast majority of Arduino (Atmega) analog pins, may be configured, and used, in exactly the same manner as digital pins.

PaulS: Why do you think the pin is pulled up to 5V? That is something that happens to digital pins, not analog pins.

We had that before.

Internal pullups work on analog pins like they do on digital pins.

To complete this thread.

I've found the mistake which i made. The internal Pullup is in my case to high or in other words the ADC draws to much current. A easy solution is an external pullup resistor 2k7-10k, than i can detect an open circuit on ADC input.

Thank you for your inputs.

danielschmid85: The internal Pullup is in my case to high or in other words the ADC draws to much current.

There has to be a different reason.

The ADC only draws only a neglectible amount of current, the internal pullup should result in a solid HIGH, very near VCC.