ADXL335 Converting to gs

Hi,
I'm working with the ADXL335 and I would like to convert the xyz values to g-force.
It is my understanding that this is done thusly:

(1) SomeAxis = Vout * Vs / 1023.0; //The analog inputs are 10 bits right?
(2) Vdelta = SomeAxis - ZeroG
(3) SomeAxis = Vdelta / Sensitivity;

Here is how I'm doing it:

double sensitivity[3] = {0.270, 0.300, 0.330}; //The ADXL335 datasheet gives 270, 300, and 330 mV/g @ 3v
    //Get raw value
    accelRead[X] = analogRead(xAxis);
    accelRead[Y] = analogRead(yAxis);
    accelRead[Z] = analogRead(zAxis);
    
    //Convert to V
    accelRead[X] = accelRead[X] * 3.3 / 1023;
    accelRead[Y] = accelRead[Y] * 3.3 / 1023;
    accelRead[Z] = accelRead[Z] * 3.3 / 1023;
    
    //Determine change in V
    deltaV[X] = accelRead[X] - (3.3 / 2.0);
    deltaV[Y] = accelRead[Y] - (3.3 / 2.0);
    deltaV[Z] = accelRead[Z] - (3.3 / 2.0);
    
    //Convert to G-Force
    accelRead[X] = deltaV[X] / sensitivity[X];
    accelRead[Y] = deltaV[Y] / sensitivity[Y];
    accelRead[Z] = deltaV[Z] / sensitivity[Z];

Unfortunately the readings are inaccurate. They correlate properly with movement, but it is certainly not gs. I know this because I'm geting readings like -0.66 when it should be 1.0 and -0.83 when it should be 0.5. I am using a voltage divider to ensure 3.3v power supply (I'm actually getting 3.31v rather than 3.29 in the 3.3v pin).

What I need to know is (1)Do I understand the conversion process correctly? (2)Does anyone know a better zero g than Vs / 2.0 for 3.3v power supply? (3)Does anyone know the sensitivity of each axis with a 3.3v power supply? (4)Does anyone have experience with the situation I'm in?

I would like to get this working properly. Any help would be greatly appreciated! (Even if you can't answer my questions.)
Here is the datasheet of the breakout I'm using if that helps: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/BreakoutBoards/ADXL335_v13.pdf

I have resolved the issue by using 1.1 as the zero g voltage, and using 0.22 as the sensitivity.

Maybe you should rewrite your code.

The sensitivity is 300 mV/g for every channel.
The number of 300mV/g could actually be 270-330.
You should start with 300 for every channel.

The way you calculate the Delta is not right. Please just delete that part.
It is already an accelarator sensor, so you might not need the delta.
But if you do need to calculate the delta value, you have to remember the previous g-force value and substract that from the new g-force value.

Delta is change in voltage of power supply, not change from the last reading. As for the sensitivity, 220 was the number I was looking for. With the updated numbers the readings are excellent, and I am getting exactly what I need. Thank you for the help.

hello,

Usefull page.

I have the similar problem with "Voltage to g" conversion.

Like reference device I use BMA180 Digital Accelerometer fixed in the same object and same axis orientation like ADXL 335.

I receive a courbes and I see that initial g value of digital sensor not correspond to recalculated from tension g value of analog sensor

Any ideas ?

Sincerely yours

ISR_lab_Donetsk