I want to measure the input voltage to my circuit. The input voltage is supposed to be anything between 0 to 36 V. The voltage divider is simply a R1 = 100 kΩ on top and R2 = 10 kΩ on the bottom. The ADC reference voltage of the controller is 3.3 V.
According to my calculation,
- When I’m calculating the RAW value to the input voltage value by using the below formula, the calculated voltage value is not matching with the input voltage. There is tolerance. You can find the voltage values in the report below, highlighted in red.
- The formula for converting the raw value to the input voltage value is:
((Raw·ADC_Ref)/(4096))·(R1+R2)/(R2) - When I’m calculating the raw value to the voltage divider value, there is no issue. Here the calculated value is matching with the measured value, highlighted in blue.
- In the microcontroller datasheet, there is a mention of an internal series resistor which is connected internally; please refer the image below. ADC input connected to the ADC. So, the internal resistor of 6.9 kΩ is added.
- Can you please let me know how I should add this internal resistor to the formula? Or is there any other issue in this circuit or our calculation?