Imagine that you have an x-y graph with a line, x axis will be the resolution of the ADC and the y axis would be the values that you are getting 0-65535.When the ADC have the number 0FFF=4095 the line would pass the point (x=4095,y=65535) you can get the equation from those values:
y=(65535/4095)x
or
x=(4095/65535)y
So if you put the values that you are reading 0-65535 in the place of "y" you would get the values that the ADC is giving to you.
The resolution of the ADC for 3V reference is:
resolution= 3Volts / (2^12 - 1)= 3V / (4096-1) = 0.732mV
If you multiply the value of x from the first conversion with 0.732mV it woul give you the volts that the ADC is getting, asumming that the reference voltaje is 3V and that the acelerometer have a signal conditioning circuit that gives the microcontroller a signal that spans from 0V to 3V .
But if you want the voltaje given by the accelerometer search for its resolution ih his datasheet, say that is 4mV-20mV you have to do another x-y graph, this time the slope is :
Slope=(3V -0V)/( 20mV - 4mV)= 187.5 --------------->Equation S
and the equation is:
y=(187.5)x - 0.75V --------------->Equation F
or
x= (y + 0.75V)/187.5
Subtitute "y" with the value from the second conversion and "x" would be the voltaje given by the acelerometer.
But remember to look carefully in the dataseheet for that sensor , so you can substitute the apropiate values in equation for the slope(Equation S) you can get that data from the characteristic table under Offset and full scale span, the offset would replace the 4mV value and (full scale span + offset) the 20mV value. And the 0.75V from equation F also change,to obtain his new values resolve the next equation for "B":
0=(new Slope)(new Offset) + B
Its important that you check the documentation for your demo board in order to know if it have a signal conditioning and what accelerometer it uses, if in the user guide dosnt mention anything about that check the electronic diagrams for those circuits.
Message Edited by Morph19 on
2008-04-24 05:53 PM