Overview

The ADXL335 is a classic 3-axis analog MEMS accelerometer manufactured by Analog Devices. Housed in a compact 4×4 mm4 \times 4\text{ mm} 16-lead LFCSP package, it measures dynamic acceleration (motion, vibration, shock) and static acceleration (gravity tilt) across a ±3g\pm 3g full-scale range.

Unlike digital accelerometers (such as the ADXL345 or MPU6050) that output I2CI^2C or SPI registers, the ADXL335 features pure ratiometric analog voltage outputs for X, Y, and Z axes. Each axis output voltage is centered at VCC2\frac{V_{CC}}{2} (1.65V1.65\text{V} at 3.3V supply) and shifts by 300 mV/g300\text{ mV/g}. It is widely used in simple tilt switches, RC model leveling, and analog microcontroller projects.

Quick reference

Module supply voltage (VCC)3.3 V to 5.0 V DC (GY-61 module includes 3.3V regulator)
IC supply voltage (VDD)1.8 V to 3.6 V DC (3.3 V nominal)
Output signal3 Ratiometric Analog Voltages (VX,VY,VZV_X, V_Y, V_Z)
Full-scale range±3g\pm 3g (typical)
Sensitivity300 mV/g300\text{ mV/g} (at 3.3V supply)
Zero-gg bias voltageVCC2\frac{V_{CC}}{2} (1.65V1.65\text{V} at 3.3V supply)
Operating current350 μA350\ \mu\text{A} typical

Pinout

Common 5-pin GY-61 breakout board header:

PinNameTypeDescription
1VCCPowerSupply voltage (+3.3 V to +5.0 V DC)
2GNDPowerGround reference (0 V)
3X / XOUTAnalog OutputX-axis acceleration analog voltage
4Y / YOUTAnalog OutputY-axis acceleration analog voltage
5Z / ZOUTAnalog OutputZ-axis acceleration analog voltage

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply Voltage (Module)VCCV_{CC}3.33.3 / 5.05.5VPower rail with 3.3V regulator
Active Supply CurrentICCI_{CC}350450µAVDD=3.0 VV_{DD} = 3.0\text{ V}
Full-Scale RangeRangeRange±3.0\pm 3.0±3.6\pm 3.6gMinimum range ±3.0g\pm 3.0g
SensitivitySaccS_{acc}270300330mV/gRatiometric to VDD=3.3VV_{DD} = 3.3\text{V}
Zero-gg Voltage OutputV0gV_{0g}1.51.651.8VVDD=3.3 VV_{DD} = 3.3\text{ V}
Bandwidth (X, Y)fXYf_{XY}0.55001600HzSet by external filtering caps CX,CYC_X, C_Y
Bandwidth (Z)fZf_Z0.5500550HzSet by external filtering cap CZC_Z

Analog Voltage Conversion Formula

Because outputs are ratiometric (proportional to supply voltage VDDV_{DD}), acceleration in gg-force is calculated as:

Acceleration (g)=VoutVzero_gSensitivity=Vout(VDD/2)0.300 V/g\text{Acceleration } (g) = \frac{V_{out} - V_{zero\_g}}{\text{Sensitivity}} = \frac{V_{out} - (V_{DD} / 2)}{0.300\text{ V/g}}

For a 10-bit ADC reading on Arduino (3.3V reference VREF=3.3VV_{REF} = 3.3\text{V}):

gx=(ADCx512)×3.31023×0.300g_x = \frac{\left( ADC_x - 512 \right) \times 3.3}{1023 \times 0.300}

Wiring

ADXL335 PinArduino UnoESP32Notes
VCC3.3V3.3VConnect 3.3V pin to Arduino AREF pin
GNDGNDGNDSystem ground
XAnalog A0VP / GPIO36 (ADC1)X-axis analog signal
YAnalog A1VN / GPIO39 (ADC1)Y-axis analog signal
ZAnalog A2GPIO34 (ADC1)Z-axis analog signal
Warning

ADC Reference Matching:

  • Because ADXL335 output sensitivity scales with supply voltage (300 mV/g300\text{ mV/g} at 3.3V vs 450 mV/g450\text{ mV/g} at 5V), the microcontroller ADC reference (VREFV_{REF}) MUST match the ADXL335 supply voltage.
  • On 5V Arduino boards, connect the Arduino 3.3V pin to the AREF pin and call analogReference(EXTERNAL) in software.

Example

cpp
const int xPin = A0;
const int yPin = A1;
const int zPin = A2;

// Zero-g ADC baselines (calibrated per sensor)
int zeroG_X = 512;
int zeroG_Y = 512;
int zeroG_Z = 512;

void setup() {
  Serial.begin(9600);
  // Set ADC reference to 3.3V AREF pin on 5V Arduino Uno
  analogReference(EXTERNAL);
}

void loop() {
  int rawX = analogRead(xPin);
  int rawY = analogRead(yPin);
  int rawZ = analogRead(zPin);

  // 3.3V / 1024 = 3.22 mV per count; 300 mV/g sensitivity -> 0.0107 g per count
  float gx = (rawX - zeroG_X) * 0.0107;
  float gy = (rawY - zeroG_Y) * 0.0107;
  float gz = (rawZ - zeroG_Z) * 0.0107;

  Serial.print("X: "); Serial.print(gx); Serial.print(" g\t");
  Serial.print("Y: "); Serial.print(gy); Serial.print(" g\t");
  Serial.print("Z: "); Serial.print(gz); Serial.println(" g");

  delay(200);
}

Common mistakes

  • Not setting analogReference(EXTERNAL) on 5V Arduino: Reading a 3.3V analog sensor using a default 5.0V ADC reference reduces measurement resolution and distorts gg-force math.
  • Forgetting per-sensor zero-gg offset calibration: Manufacturing tolerances introduce ±150 mV\pm 150\text{ mV} offset shifts. Place the sensor flat on a level surface and calibrate zero-gg ADC constants for X and Y, and +1g+1g for Z.

Notes

  • ADXL335 vs ADXL345: ADXL335 is 3-axis analog (±3g\pm 3g max); ADXL345 is 13-bit digital I2CI^2C/SPI (±16g\pm 16g max).

Assets & downloads