loading
This Christmas, my dad got me a adxl206 sample (free) from analog devices.  Surprisingly, this chip is in a dip package while most other accelerometers aren't.  Just today, I decided to wire it up with the Arduino.  I was amazed that an easy, simple to use, 2 axis accelerometer was free.  That is why I decided to make this instructable.      P.S.  I'm 11 years old!

Note:  This instructable and code can be used for any dual-axis analog accelerometer.  

Step 1: Parts

All you need are the following:

Mini Adhesive Breadboard
~ 10 Jumper Wires
Analog Devices ADXL206HDZ  (DIP package, 8 pin)   
Arduino Uno (or newer)

Note:
Analog Devices Samples change frequently, so this might not be on the list for free anymore.

Step 2: Wiring

The first thing to look at when you have a new part is the datasheet.  If you look at the pinout, you will see COM (basically ground), v1 (+5V), XOUT, and YOUT.  Connect the following:
Pin 1 (COM) to GND
Pin 3 (COM) to GND
Pin 4 (YOUT) to A1
Pin 5 (XOUT) to A0
Pin 6 (Vs) to 5V
Pin 7 (Vs2) to 5V

Note : Do not connect pin 2 to anything or else this will not work.

Step 3: Code

Just copy and paste and upload to your Arduino.

/* AccelerometerRead Sketch

Uses the ADXL206 or other dual axis accelerometer and prints the value
to the serial monitor.
*/

int sensorValuex;     // make variables for the values
int sensorValuey;

void setup() {
  Serial.begin(9600);  // begin serial communication
}

void loop() {
  sensorValuex=analogRead(0);     // assigns the variable to the analog pin
  sensorValuey=analogRead(1);
  Serial.print("x, ");
  Serial.print(sensorValuex, DEC);     // prints x and y values to the serial
  Serial.print(", y,");                // monitor
  Serial.println(sensorValuey, DEC);
  delay(150);         // don't let the readings go too fast!
}

Step 4: Dual-Axis Fun!

 Open the Serial Monitor and move the accelerometer around.  Have some fun, attach to a robot or even use with an RGB led to make different colors!
<p>Wow, great sample. That chip is listed for approximately $700 for 1 at mouser and digikey.</p><p>Been looking for a DIP accelerometer, and they are hard to find. Thought this might be good until I looked at the price!!</p>
This is a good instructable. And a good Accelerometer. I used the same one in my project. Thanks for sharing.
How sensitive is it? I'm planning on getting an accelerometer to record some seismic activity
This is a very sensitive accelerometer, but only on two axis. If the table shakes, the accelerometer should pick it up. I'm pretty sure that there is something on the datasheet that tells how sensitive it is (possibly in G's?). If you are looking for an easy to use 3 axis accelerometer, go with the ADXL335. Sparkfun has a BOB for only $25.

About This Instructable

4,249views

15favorites

License:

Bio: White House Maker Faire // 16 years old // CEO of Qtechknow, maker and electronics enthusiast, I teach Arduino classes, and put making into schools! My successful ... More »
More by Qtechknow:NFC Door Lock with the Qduino Mini (under $100) Qtechknow Robot Obstacle Course Your Image on an Arduino! - TFT LCD Screen Guide 
Add instructable to: