Stufin
Home Quick Cart Profile

ADXL335 Triple-Axis Accelerometer

Buy Now on Stufin

Component Name

ADXL335 Triple-Axis Accelerometer

Description

The ADXL335 is a high-performance, low-power, triple-axis accelerometer from Analog Devices. It is a popular component in the Internet of Things (IoT) ecosystem, used in a wide range of applications that require motion sensing, vibration monitoring, and orientation detection.

Functionality

The ADXL335 is designed to measure acceleration forces in three orthogonal axes (x, y, and z) simultaneously. It converts the acceleration measurements into analog voltage signals, which can be easily read and processed by a microcontroller or other devices.

Key Features

### Sensor Characteristics

Measurement Range

3g (g = 9.8 m/s)

Sensitivity

265 mV/g (typical)

Resolution

10 bits (1024 levels)

Bandwidth

1600 Hz (typical)

### Output Characteristics

Output Type

Analog (voltage)

Output Voltage Range

0 V to VCC (typically 3.3 V or 5 V)

Output Impedance

32 k (typical)

### Power Management

Supply Voltage

2.0 V to 3.6 V

Supply Current

350 A (typical) at 3.3 V supply

Low Power Mode

Yes, with reduced current consumption (10 A typical)

### Operation Modes

Measurement Mode

Continuous acceleration measurement

Standby Mode

Power-saving mode with reduced current consumption

Sleep Mode

Low-power mode with minimal current consumption

### Package and Pinout

Package

5 mm 5 mm 1.45 mm (16-lead LFCSP)

Pinout

+ VCCPower supply pin
+ GNDGround pin
+ XOUTX-axis output pin
+ YOUTY-axis output pin
+ ZOUTZ-axis output pin
+ SCLSerial clock input pin (for SPI interface)
+ SDASerial data input/output pin (for SPI interface)
### Other Features
Self-testBuilt-in self-test capability for device verification

Noise Reduction

Internally filtered outputs for reduced noise

Operating Temperature

-40C to +125C ( industrial temperature range)

The ADXL335 is a versatile and reliable accelerometer suitable for various IoT applications, such as

Motion detection and gesture recognition

Vibration monitoring and analysis

Orientation and tilt sensing

Inertial measurement and navigation

Robotics and unmanned systems

Industrial automation and condition monitoring

When using the ADXL335, developers can take advantage of its high sensitivity, low power consumption, and compact package to design innovative IoT devices that require precise acceleration measurements.

Pin Configuration

  • ADXL335 Triple-Axis Accelerometer Pinout Guide
  • The ADXL335 is a low-power, triple-axis accelerometer that measures acceleration in three perpendicular axes (x, y, and z). It has a compact package with 8 pins, which are explained below:
  • Pinout Structure:
  • The ADXL335 has the following pinout structure:
  • | Pin # | Pin Name | Description |
  • | --- | --- | --- |
  • | 1 | VCC | Power Supply |
  • | 2 | GND | Ground |
  • | 3 | XOUT | X-axis Acceleration Output |
  • | 4 | YOUT | Y-axis Acceleration Output |
  • | 5 | ZOUT | Z-axis Acceleration Output |
  • | 6 | ST | Self-Test Input |
  • | 7 | 0V | Zero-G Reference |
  • | 8 | VIO | Input/Output Voltage (optional) |
  • Pin-by-Pin Explanation:
  • 1. VCC (Power Supply)
  • Function: Provides power to the ADXL335.
  • Voltage Range: 2.0 V to 3.6 V.
  • Recommended Operating Voltage: 3.3 V.
  • 2. GND (Ground)
  • Function: Provides a common ground reference for the ADXL335.
  • Connect to the system's ground plane.
  • 3. XOUT (X-axis Acceleration Output)
  • Function: Outputs the acceleration measured along the x-axis.
  • Analog output signal, proportional to the acceleration.
  • Typically connected to an analog-to-digital converter (ADC) for digitization.
  • 4. YOUT (Y-axis Acceleration Output)
  • Function: Outputs the acceleration measured along the y-axis.
  • Analog output signal, proportional to the acceleration.
  • Typically connected to an analog-to-digital converter (ADC) for digitization.
  • 5. ZOUT (Z-axis Acceleration Output)
  • Function: Outputs the acceleration measured along the z-axis.
  • Analog output signal, proportional to the acceleration.
  • Typically connected to an analog-to-digital converter (ADC) for digitization.
  • 6. ST (Self-Test Input)
  • Function: Activates the self-test mode when driven high (VCC).
  • In self-test mode, the ADXL335 outputs a predefined test pattern on the XOUT, YOUT, and ZOUT pins.
  • Normally, this pin is tied to GND or left floating.
  • 7. 0V (Zero-G Reference)
  • Function: Provides a zero-gravity reference point for the ADXL335.
  • This pin should be connected to the system's analog ground or a quiet analog voltage reference.
  • 8. VIO (Input/Output Voltage, optional)
  • Function: Allows the ADXL335 to operate with a separate I/O voltage (VIO) if needed.
  • If not used, this pin should be tied to VCC or left floating.
  • Connection Guidelines:
  • When connecting the ADXL335 to a microcontroller or other devices, follow these guidelines:
  • Use a 10nF to 100nF decoupling capacitor between VCC and GND.
  • Connect the XOUT, YOUT, and ZOUT pins to an analog-to-digital converter (ADC) for digitization.
  • Ensure proper routing and bypassing of the power supply lines to minimize noise and interference.
  • Ground the ST pin or leave it floating, depending on your application's requirements.
  • By following these guidelines and properly connecting the pins, you can ensure reliable operation and accurate acceleration measurements with the ADXL335.

Code Examples

ADXL335 Triple-Axis Accelerometer Documentation
Overview
The ADXL335 is a low-power, triple-axis accelerometer with high sensitivity and low noise. It measures acceleration in three axes (x, y, z) and provides analog output voltages proportional to the acceleration. This component is suitable for a wide range of applications, including robotics, industrial automation, and wearable devices.
Pinout and Connections
The ADXL335 has 8 pins:
VCC: Power supply (2.0-3.6V)
 GND: Ground
 XOUT: X-axis output
 YOUT: Y-axis output
 ZOUT: Z-axis output
 ST: Self-test (optional)
 0G/CS: Zero-g detection/output (optional)
 Vin: Analog input (optional)
Example 1: Basic Accelerometer Reading with Arduino
In this example, we will connect the ADXL335 to an Arduino board and read the acceleration values in three axes.
Connections:
VCC to Arduino 3.3V
 GND to Arduino GND
 XOUT to Arduino A0
 YOUT to Arduino A1
 ZOUT to Arduino A2
Code:
```c++
const int xPin = A0;     // X-axis output
const int yPin = A1;     // Y-axis output
const int zPin = A2;     // Z-axis output
void setup() {
  Serial.begin(9600);
}
void loop() {
  int xValue = analogRead(xPin);
  int yValue = analogRead(yPin);
  int zValue = analogRead(zPin);
float xAccel = (xValue  3.3) / 1024;
  float yAccel = (yValue  3.3) / 1024;
  float zAccel = (zValue  3.3) / 1024;
Serial.print("X: ");
  Serial.print(xAccel);
  Serial.print(" g, Y: ");
  Serial.print(yAccel);
  Serial.print(" g, Z: ");
  Serial.print(zAccel);
  Serial.println(" g");
delay(100);
}
```
Example 2: Measuring Tilt Angle with Raspberry Pi
In this example, we will connect the ADXL335 to a Raspberry Pi and calculate the tilt angle of the device using the acceleration values.
Connections:
VCC to Raspberry Pi 3.3V
 GND to Raspberry Pi GND
 XOUT to Raspberry Pi ADC channel 0
 YOUT to Raspberry Pi ADC channel 1
 ZOUT to Raspberry Pi ADC channel 2
Code:
```python
import RPi.GPIO as GPIO
import time
import math
GPIO.setmode(GPIO.BCM)
x_channel = 0
y_channel = 1
z_channel = 2
GPIO.setup(x_channel, GPIO.IN)
GPIO.setup(y_channel, GPIO.IN)
GPIO.setup(z_channel, GPIO.IN)
def read_accel(channel):
    return GPIO.input(channel)  3.3 / 1024
while True:
    x_accel = read_accel(x_channel)
    y_accel = read_accel(y_channel)
    z_accel = read_accel(z_channel)
# Calculate tilt angle
    roll = math.atan2(y_accel, z_accel)  180 / math.pi
    pitch = math.atan2(x_accel, math.sqrt(y_accel2 + z_accel2))  180 / math.pi
print("Roll: {:.2f}, Pitch: {:.2f}".format(roll, pitch))
time.sleep(0.1)
```
Example 3: Wake-on-Motion with ESP32
In this example, we will connect the ADXL335 to an ESP32 board and use the accelerometer to wake up the board from deep sleep mode when motion is detected.
Connections:
VCC to ESP32 3.3V
 GND to ESP32 GND
 XOUT to ESP32 ADC channel 0
 YOUT to ESP32 ADC channel 1
 ZOUT to ESP32 ADC channel 2
Code:
```c++
#include <WiFi.h>
#include <ESP32AnalogRead.h>
const int xPin = 0;     // X-axis output
const int yPin = 1;     // Y-axis output
const int zPin = 2;     // Z-axis output
void setup() {
  Serial.begin(115200);
// Configure ADC channels
  analogReadResolution(12);
  analogSetAttenuation(ADC_6db);
// Configure wake-up pin
  esp_sleep_enable_ext0_wakeup(GPIO_NUM_0, 1);
}
void loop() {
  int xValue = analogRead(xPin);
  int yValue = analogRead(yPin);
  int zValue = analogRead(zPin);
float xAccel = (xValue  3.3) / 4096;
  float yAccel = (yValue  3.3) / 4096;
  float zAccel = (zValue  3.3) / 4096;
// Check if motion is detected
  if (xAccel > 0.5 || yAccel > 0.5 || zAccel > 0.5) {
    Serial.println("Motion detected! Wake up!");
// Wake up from deep sleep mode
    esp_deep_sleep_start();
  }
delay(100);
}
```
Note: In this example, we assume that the ESP32 is in deep sleep mode and will wake up when motion is detected. The specifics of deep sleep mode configuration may vary depending on the ESP32 board and firmware used.