### Welcome to EDAboard.com

#### Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Status
Not open for further replies.

#### hbaocr

##### Full Member level 4
hello friends
Plz help me to use ADXL sensor
when I read value from that IC 20 times and receive many different value in one condition of acceleration.So i don't know which value is reliable.Plz help me to find the best suitable value and give me some algorithm to find that value nearby reliable value which error δ value (δ=reliable value- value I choose) is ecceptable.
thank alot

#### cesare

##### Full Member level 3
I think you can take a running average calculated over a number of past measurement. For example you can take the average of the last 8 measurement

#### rikie_rizza

##### Full Member level 6
To use the data coming from an accelerometer, you must rely on the sensor's manufacturer. Calibrate your sensor by detecting the -1G and the +1G. than find the 0G (0G)=(-1G)+(+1G) all in mV. after that, find the 1G/mV... 1G/mV=(+1G)-(0G).
It is difficult for us to find an exact and steady acceleration except the earth's gravitation.

#### hbaocr

##### Full Member level 4
thank for all helping ,
I have already determined (-1G) ang (+1G) but my prolem is when I read value from that IC on one exact condition , I have received different value on each times I read value from Ic .So I don't know what value among it is reliable. So my problem is ,try to find reliable value or the value nearby it which error of that value can be aceptable.
so,Plz send me some idea or algorithm to find that value
thank alot

#### rikie_rizza

##### Full Member level 6
How can you guarantee that the acceleration is an exact condition? It is so difficult to create a constant dynamic acceleration. Alright, assume you are correct, it could be another hardware problem... use a lowpass filter. Connect the output with 1K resistor at the other end of the resistor, tie a capacitor that connected to ground.
For software correction, try averaging. Collect as many data as possible in some consecutive time (like 1000 data per 100ms), sum all the data and divide the sum by the number of data taken.

mehdiraghvash

### mehdiraghvash

Points: 2

#### hbaocr

##### Full Member level 4
hi,thank u alot
but can you tel me more about filter which I design for using X_filt , Y_filt before connect it ADC 10bit which value of C and value R I need choose for making Low pass filter

mehdiraghvash

### mehdiraghvash

Points: 2

#### rikie_rizza

##### Full Member level 6

10-bit is a small resolution, to process the data try averaging.
here's a sample program

unsigned int n, data;
n=0;
for (i=1;i<=100;i++)
{
n=n+adc_data(0); //adc_data(0) is a function to call the adc conversion and return the data, it might be different from your's.
}
data=n/100;//data is the averaging result.

#### Kral

hbaocr,
In addition to the filtering options given in other replies, make sure that your data acquisition (DAQ) setup is not susceptible to electrical noise. Some suggestions:
. 1) Use a shielded cable from the accelerometer to the DAQ. The
. shield should be grounded at one end only. Leave
. the other end of the shield open.
. 2) Make sure that your analog and digital grounds
. are connected together at one point only. The best place
. is at the power supply, or supplies.
. 3) Make sure that all power supply grounds in your system
. are connected together at one point only
. 4) Make sure that all integrated circuit components
. in the analog signal chain (path) have adequate power supply
. bypassing (filtering) to the analog ground with short connections.
Regards,
Kral

#### pabloec

##### Member level 2
also make sure you dont sample at the sampling frecuency of the IC, just stay away of the 10khz range.

#### letitwork

##### Banned
Sounds like you have problem with the basics, ground, supply, bypassing etc.

#### Slayerza

##### Full Member level 5
Also remember that in order for digital sampling to be accurate you need to sample at at least the nyqiust frequency (double the device freq). Thus is adxl is running at 10kHz sample at min 20kHz

Cheers
Slayer

#### FvM

##### Super Moderator
Staff member
Thus is adxl is running at 10kHz sample at min 20kHz.
No, the ADXL is using 10 kHz PWM output. There is no sense in sampling before low-pass filtering. If the 10 kHz are filtered sufficiantly from the signal, there is no reason to care about nyquist in this case.

Alternatively, pulse width and frequency could be measured by a timer. But as the 10 kHz frequency isn't fixed, a division would be needed to determine the measurement value.

Status
Not open for further replies.