What kind of voltage divider you are using?
If you try to get full 0-5V scale with 0-15V input, then you should use 1:3 ratio (e.g. 22kOhm and 11kOhm resistors) to get best measurement accuracy.
With this divider 15V -> 5V (and 0V -> 0V) at ADC input pin, ADC should show 255 (8bit) or 4095 (12bit).
Math to show input voltage based on ADC value.
8bit ADC:
12bit ADC:Code:VOLTS_VAL = (15 * VOLTS_IN)/255
Code:VOLTS_VAL = (15 * VOLTS_IN)/4095
Bookmarks