analogRead

I added

analogReference(INTERNAL);

now the value is always 1023...