Wrong ADC measurement/calculation


The pcb gets 4.75V .
This goes into regulator of 3.6V , which is the VCC of ATMega328p .
To measure battery voltage, there is resistors divider from 4.75V , with 2 big resistors (±270k/850k).
The smaller resistor (±270k) goes into the ADC 6 pin directly .

(Tried also with input capacitor 100nF to compensate the large resistance)

   void loop()
    int tgh=analogRead(6);  

To measure the input .

The actual input voltage seen on the pin(Fluke) is 1.2V .
The reading i get in the software is 400 .

My calculation is that 1.2V/3.6V is 0.33(from 1024) that i should get , and so from 1024 its :
0.33*1024=341 .

I get 400 . (which is like 1.4V not 1.2V).

I guess i calculate wrong ,or measure wrong.. ?

Ok , voltage on the MCU is 3.25V and then everything is as expected :slight_smile: