I want to manipulate the physical value of temperature. Here is the characteristic of this µC:
Resolution: 12 bits
Supply: 5 V
Min Mesure: -45
Max Mesure: 75
Min ADC IN: 0.4
Max ADC IN: 4.8
Here is the formula which i used:
Value = (Digital value * Max ADC IN) / 4095.0;
I used the rule of three.
Max ADC IN (4.8) ===> 4095 (depends on the resolution (12 bits))
Value ===> Digital value from ADC
If I use this formula, it is sufficient to read the physical value?
I don't have the datasheet of the sensor, the microcontroller is 68HCs12.
Best Answer
I think your formula is ok. As mentioned by Sanjeev, do not forget to get the approximate number of samples you need to get the accuracy you need.
Here is an example of an ADC_get_value routine that I used time ago. It uses a similar formula: