You are here

ADXL335 3-Axis Accelerometer

ADXL335 - Small, Low Power, 3-Axis ±3 g Accelerometer (datasheet)

Tilt/motion sensing.


(good overview at bldr.org)

Hardware Setup

 
Pin Connections
ADXL335Arduino UNO or FIO
VCC 5V (3.3V on FIO)
GND GND
X A0
Y A1
Z A2
 
NOTE: This is a 3.3V device. If using the Arduino UNO or other 5V platform, be sure to power the MPU6050 breakout from the low voltage (3.3V) line.
 

Code

This has one piece of code to read X, Y, and Z-axis acceleration as analog inputs. The ADXL335 outputs acceleration for each axis on the corresponding pin, as a voltage in some subset of the 0 - 3.3V range.
  • Arduino code: adxl335.zip
    • this code prints the analog in values to the serial port.
    • You can view them in the Serial Monitor, or transmit them via Xbee to a receiving device.
    • NOTE: you will need to test various accelerometer orientations and record the output values to calibrate the device. What is the minimum output voltage for one axis? what is the max? What position produces them? These correspond to min and max acceleration (0G, +1G) on a given axis of rotation. The outputs will not use the full 0-3.3V range!