Lead Author: Mauricio Ayllon Unzueta
Triple Axis
Accelerometer Breakout - ADXL335
Introduction
Accelerometers
measure acceleration caused by motion, mainly. However, when they are at rest
with respect to earth’s surface, the acceleration sensed by the accelerator is
due to gravity pulling down on it.
A particular
aspect of accelerometers of this sort is that they sense rotations.
Nevertheless, they can only sense differences in 180 ̊of movement as the other 180
̊ is just a mirror image of the first. In order to detect a 360 ̊ rotation, the
two axes sensors work differently. For instance, when the sensor is being
rotated around the X Axis, the sensed values do not change, so it is possible
to combine the y and z values to find x using a trigonometric function called
Atan2 (ADXL335), which returns values as -180 ̊ to 180 ̊ in radians. [1].
Yaw is the name for rotation around an
axis that is similar to spinning a top, or shaking motion sideways.
Accelerometers cannot measure this type of motion. However, it is possible to
incorporate a gyro or digital compass in order to accomplish this task. This
will be done for the present project. [1]
The accelerometer reports proper data
when it stands still. When it is in free fall or any other kind of motion, the
accelerometer’s reading is no longer purely gravity based. For the purpose of
this project, a clean reading during movement is required, and hence, a gyro
and an accelerometer working in combination are needed. Together they form what
is called an IMU (Inertial Measurement Unit). The gyro is able to kick in where
an accelerometer leaves off, and vise versa. In summary, a gyro serves for
measuring rotation, and an accelerometer for determining orientation. [1]
The particular type of accelerometer
used in this project is the ADXL335, and connecting it to the Arduino is fairly
simple. It powers off of the 3.3v, and the x, y, z connectors connect to the 0,
1, 2 analog input pins. This accelerometer outputs an analog voltage depending
on the sensed value. [1]
Purpose
The purpose of installing this
accelerometer in our payload is to sense sharp changes in wind speed and
direction. In particular, we expect to know when the balloon crosses the
troposphere into the stratosphere since the jet stream is located within that
boundary, and we expect the balloon to experience abrupt movements.
The ADXL335
The ADXL335 is a thin, small, low
power, complete 3-axis accelerometer with signal conditioned voltage outputs.
It measures acceleration with a minimum full-scale range
3g. This device measures the static
acceleration of gravity in tilt-sensing applications and dynamic acceleration
resulting from motion, shock, or vibration.
[2]
The user selects the
bandwidth of the accelerometer using the CX, CY, and CZ capacitors at the XOUT,
YOUT, and ZOUT pins. There are few bandwidths that can be selected to suit the
task needed. They range from 0.5 Hz to 1600 Hz for the X and Y axes and from
0.5 Hz to 550 Hz for the Z axis.
[2]
The ADXL335 contains a
polysilicon surface-micromachined structure built on top of a silicon wafer. Polysilicon springs suspend the
structure over the surface of the wafer and provide a resistance against
acceleration forces. A differential capacitor, consisting of independent fixed
plates and plates attached to the moving mass, measures the deflection of the
structure. Acceleration unbalances the capacitor, which in turn, results in a
sensor output with amplitude proportional to the acceleration experienced. [2]
·
Mechanical Sensor
The ADXL335 uses a single structure for sensing the three axes.
Therefore, the axes’ sense direction is orthogonal and has little cross-axis
sensitivity. Mechanical misalignment is the principal source of cross-axis
sensitivity. However, this misalignment can be calibrated out at the system
level. [2]
·
Performance
Innovative design techniques make sure that high performance is achieved
by the ADXL335. For this reason, there is no quantization error or nonmonotonic
behavior, and temperature hysteresis is very low (usually less than 3mg over
the -25 ̊C to +70 ̊C temperature range) [2]
Testing Procedure
The team
tested the accelerometer in cool dry ice at -20
̊C for over 24 hours. The accelerometer gave constant readings throughout the
test. It was tested after complete integration including data logging. The code
implemented for the Arduino to correctly read these values was:
/*
ADXL3xx
Reads an Analog Devices ADXL3xx accelerometer
and communicates the
acceleration to the computer. The pins used are designed to be easily
compatible with the breakout boards from
Sparkfun, available from:
http://www.sparkfun.com/commerce/categories.php?c=80
http://www.arduino.cc/en/Tutorial/ADXL3xx
The circuit:
analog 0: accelerometer self test
analog 1: z-axis
analog 2: y-axis
analog
3: x-axis
analog 4: ground
analog 5: vcc
created 2 Jul 2008
by David A. Mellis
modified 16 Mar 2012
by Capstone420
This example code is in the public domain.
*/
//
these constants describe the pins. They won't change:
//
const int groundpin = 18; //
analog input pin 4 -- ground
//
const int powerpin = 19; //
analog input pin 5 -- voltage
const
int xpin = A2; // x-axis
of the accelerometer
const
int ypin = A3; // y-axis
const
int zpin = A4; // z-axis
(only on 3-axis models)
void
setup()
{
// initialize the serial communications:
Serial.begin(9600);
// Provide ground and power by using the
analog inputs as normal
// digital pins. This makes it possible to directly connect
the
// breakout board to the Arduino.
// pinMode(groundpin, OUTPUT);
//
// pinMode(powerpin, OUTPUT);
// digitalWrite(groundpin, LOW);
// digitalWrite(powerpin, HIGH);
}
void
loop()
{
// print the sensor values:
float xRead = analogRead(xpin);
float yRead = analogRead(ypin);
float zRead = analogRead(zpin);
float xg = -(xRead - 352)/73.;
float yg = -(yRead - 361)/75.;
float zg = -(zRead - 361)/71.
;
Serial.print(xg);
// print a tab between values:
Serial.print("\t");
Serial.print(yg);
// print a tab between values:
Serial.print("\t");
Serial.print(zg);
Serial.println();
Serial.print(xRead);
// print a tab between values:
Serial.print("\t");
Serial.print(yRead);
// print a tab between values:
Serial.print("\t");
Serial.print(zRead
);
Serial.println();
// delay before next reading:
delay(1000);
}
Results
The results
obtained were as follows:
Accel X
|
Accel Y
|
Accel Z
|
-0.74
|
-0.27
|
-1.76
|
-0.75
|
-0.27
|
-1.79
|
-0.78
|
-0.32
|
-2.27
|
-0.73
|
-0.25
|
-1.72
|
-0.75
|
-0.27
|
-1.75
|
-0.75
|
-0.27
|
-1.76
|
-0.74
|
-0.27
|
-1.75
|
-0.74
|
-0.25
|
-1.72
|
-0.73
|
-0.23
|
-1.73
|
-0.74
|
-0.27
|
-1.75
|
-0.75
|
-0.25
|
-1.45
|
-0.73
|
-0.29
|
-1.76
|
-0.74
|
-0.31
|
-1.76
|
-0.74
|
-0.27
|
-1.75
|
-0.73
|
-0.27
|
-1.75
|
-0.74
|
-0.25
|
-1.75
|
-0.75
|
-0.27
|
-1.75
|
-0.75
|
-0.27
|
-1.76
|
-0.74
|
-0.25
|
-1.73
|
-0.41
|
-0.13
|
-1.77
|
-0.74
|
-0.25
|
-1.75
|
-0.75
|
-0.25
|
-1.72
|
-0.74
|
-0.24
|
-1.72
|
The values
were a little bit off since calibration is still needed. The team will calibrate
it right before launch to ensure precision.
Conclusion
In summary,
the ADXL335 accelerometer is a small, low profile package, 3-axis sensing
device that requires low power (350
, typically) and a single supply operation: 1.8V to 3,6V. It
also possesses 10,000 g shock survival, excellent temperature stability, BW
adjustment with a single capacitor per axis, and RoHS/WEEE lead-free compliant. [2]
We expect to know when the balloon
will pass the jet stream once the payload is recovered.
Recommendations on Test Results
As mentioned before, Calibration is still
needed to ensure proper data gathering. However, this will be done right before
launch.
References
[1] (http://bildr.org/2011/04/sensing-orientation-with-the-adxl335-arduino/,
“Sensing Orientation With The ADXL335 +
Arduino” Friday, April 22 nd , 2011 )
[2] (http://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf,
AnalogDevices, 2009)