Continue to Site

# Adxl330 accelerometer calibration procedure

Status
Not open for further replies.

#### keinstein

##### Junior Member level 1

I'm trying to build a vibration & shock analysis sensor device. I've interfaced adxl330 with pic16f877a adc converter. At the moment I'm trying to calibrate adxl330. I got reading from various orientation already as shown below. How do you convert them to Gs. Can someone post a procedure of doing this; Here are the readings.
Code:
VREF+= 3.3V
VREF- = GND
VDD  =3.3V
[Xmin Xg  Xmac] = [608  512   396]-----X-AXIS
[Ymin Yg  Ymac] = [612   512   396]....-Y-AXIS
[Zmin Zg  Zmac] = [606  512   396] ---Z-AXIS

I will appreciate your contribution.

counts/g

I never use adxl, but I've use freescale's accelerometer and I think the calibration procedure is quite the same.
1. First you must find +1G. Its easy, find the maximum output voltage (point the axis toward the earth). Don't move for a while to make sure it is the static G that you sense and make a note.
2. Do the same for -1G except you must find the lowest output voltage.
3. Add the output voltage of +1G and -1G and divided by 2. You'll get the 0G output.
4. Done!

Thanks for your response. I've done that already and it's the reason why I posted the results here:
[Xmin Xg Xmac] = [608 512 396]-----X-AXIS
[Ymin Yg Ymac] = [612 512 396]....-Y-AXIS
[Zmin Zg Zmac] = [606 512 396] ---Z-AXIS
All I need is how to do the math. Thanks

Okay, the next thing you must do is to find the mv/G.
1. 1G(mv)-0G(mv)=mv/G
from your data X-axis:
--> 0G=(608+396)/2=502mv
--> 608-502=106mv/G

the rest, you do the counting...

did you mean mv/G or counts/G in the followings statements?
-> 0G=(608+396)/2=502mv
--> 608-502=106mv/G

Hey wait a minute, can you please clarify. I'm a bit confused...
counts/G = (Xmax-Xmin)/2

[Xmin Xg Xmax] = [608 512 396]-----X-AXIS
[Ymin Yg Ymax] = [612 512 396]....-Y-AXIS
[Zmin Zg Zmax] = [606 512 396] ---Z-AXIS

and the code for this would be something like the following, right?
Code:
void Return_x_in_Gs(){
unsigned int16 , adcCounts, g=0;

g = (adcCounts - 502)/counts/G;
}
Is this correct?

Sorry, I don't understand the value 608 512 396 etc. is it adc division or in mV? if its adc division, than the unit would be count/G. the value 512 is not accuratly in the middle, that means the value is not 0G. That's why you must find the 0G, by adding the max and the min from each axis and divided by 2. After you get the the 0G value, you should calculate the count/1G which is 0G-minimum axis value or max axis value-0G. The value of G is:

G=((ADC counts)-(0G Value))/(counts/G value)
e.g:

count/G = 106
0G = 502mV
so

G=(290-502)/106
G=-2G
Which means that the acceleration is 2G to the negative side

Sorry, I don't understand the value 608 512 396 etc. is it adc division or in mV? if its adc division, than the unit would be count/G. the value 512 is not accuratly in the middle, that means the value is not 0G. That's why you must find the 0G, by adding the max and the min from each axis and divided by 2. After you get the the 0G value, you should calculate the count/1G which is 0G-minimum axis value or max axis value-0G. The value of G is:

G=((ADC counts)-(0G Value))/(counts/G value)
e.g:

count/G = 106
0G = 502mV
so

G=(290-502)/106
G=-2G
Which means that the acceleration is 2G to the negative side

Sorry, I don't understand the value 608 512 396 etc. is it adc division or in mV? if its adc division, than the unit would be count/G. the value 512 is not accuratly in the middle, that means the value is not 0G. That's why you must find the 0G, by adding the max and the min from each axis and divided by 2. After you get the the 0G value, you should calculate the count/1G which is 0G-minimum axis value or max axis value-0G. The value of G is:

G=((ADC counts)-(0G Value))/(counts/G value)
e.g:

count/G = 106
0G = 502mV
so

G=(290-502)/106
G=-2G
Which means that the acceleration is 2G to the negative side

hi
i use with ADXL330 and the microcontroller is PIC16f877
my project is to build system with pic1f877\a and adxl330 and max232

please if u can send me the code how to read from adxl330

thank you
I will appreciate your contribution.

Hi..

I'm beginner in using the ADXL330...
i use PIC16F877a.
my question is how the micro controller (PIC16F877a) send the desired signal to the sensor (ADXL330)? what the pin is to be actived?

Status
Not open for further replies.