Sunday, February 12, 2006

Data Sheet Reading

The reason I chose the ADXL320 Accelerometer is, it has many datas available, and I have used it before but I haven't look at the datasheet closely.
ADXL320 is 2 axis accelerometer for small devices(+-5g). It can be applied to hand-held devices, mobile phone, sports and health-related devices and pc security and pc peripherals.

Features
Small and thin
4mm x 4mm x 1.45 mm plastic LFCSP(Lead Frate Chip Scale package)
2mg resolution at 60 Hz
Wide supply voltage range 2.4V to 5.25V
Low power:350uA at Vs =2.4V(typ)
Good zero g bias stability
10.000g shock survival
good sensitivity accuracy
X-axis and Y-axis aligned to within 0.1'(degree) (typ)
BW adjustment with a single capasitor
Single-supply operation
Compatible with Sn/Pb and Pb-free solder process

It measures vibration and gravity, typical noise floor is 250 ug/vHz, allowing signal below 2 mg to be resolved intilt sensing application using narrow bandwidths(<60Hz)
We select the bandwidth of the sensor using capasitor Cx, Cy, at the Xout ,Yout pins. Bandwidths of 0.5Hz to 2.5kHz may be sekected.

5pins-one for Power 3V, one for ground, one for X out(X channel outout), one for Y out (Y cahnnel output), and one for the self-test. By measuring this output, the user can verify that the accelerometer is working. If you connect the self-test pin to power, the output values decrease, which means the accelerometer is okay.
There are temperature range for operation and storage, which may cause damage of device in the out of the range. .


Self Test

When this pin is set to Vs, an electrostatic force is exerted on the acceleormeter beam. The resulting movement of the beam allows the user to test if the accelerometer is functional. The typical change is output is 315mg to 55 mV. This can be open circuit or connected to common in normal use.

Note-The accelerometer measures static acceleration forces, such as gravity, wich allows it to be used as a tilt sensor.
One 0.1 uf capasitor is used for noise decoupling the accelerometer on the power supply.
What's the theory?- It is a polysilicon surface structure built on top of a silicon wafer. Polysilicon spring susppend the structure over the surface of the wafer and provide resistance against acceleration forces.

Use as a Dual-Axis Tilt Sensor

The Accelerometer is most sensitive to tilt when its sensitive axis is perpndicular to the force of gravity.(when it is parallel to the earth surface)
When the accelerometer is oriented so both its X-axis and Y-axis are parallel to the earth's surface, it can be used as a 2 axis tilt sensor with both a roll axis and pitch axis. Once the output signal from the sensor has been converted to an acceleration that varies between -1 g and +1 g, the output tilt in degree is calculated as
Pitch=ASIN(Ax/1g)
Roll=ASIN(Ar/1g)

Setting the bandwidth using Cx and Cy

Bandwidth(Hz) Capasitor(uF)
1 ///4.7
10 ///0.47
50 ///0.10
100 ///0.05
200 ///0.027
500 ///0.01


Question
Design Trade-Off for Selecting Filter Characteristics: The Noise/BW Trade-Off

Peak to peak Value / % of time tha noise exceeds norminal peak to peak value
2 x rms ///32
4 x rms ///4.6
6 x rms ///0.27
8 x rms ///0.006

Pic Code

DEFINE OSC 4
INCLUDE "modedefs.bas"
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 10
TRISA = %11111111
adcon1 = %10000010
output portb.5
low portb.5

adcVar0 VAR Word ' ir Create variable to store result
adcVar1 VAR Word ' ir Create variable to store result
Bytevar1 VAR Byte
Bytevar2 Var Byte
switchVar var byte
inputVar Var BYTE

pause 500
main:
ADCIN 0, adcVar0
pause 30
ADCIN 1, adcVar1
pause 30
Bytevar1=adcVar0/4
Bytevar2=adcVar1/4
high portb.5
pause 500
low portb.5
pause 500
serout2 portb.3, 16468, [DEC Bytevar1, 44,DEC Bytevar2,44,13]

GoTo main