# ADXL335 Triple Axis Accelerometer (GY-61)

**Type:** Product page · **SKU:** CE06578 · **Brand:** [Core Electronics](https://core-electronics.com.au/brands/core-electronics-australia)
**Page:** https://core-electronics.com.au/adxl335-triple-axis-accelerometer-gy-61.html ([markdown](https://core-electronics.com.au/adxl335-triple-axis-accelerometer-gy-61.html.md))

If you need a low-power, low-cost accelerometer with analogue output, take a look at this module. powered by the triple-axis ADXL335 accelerometer with a measurement range of up to ±3.6 g.

## Pricing

- **Price:** $13.35 (inc GST) — $12.14 AUD, exc GST
- **Quantity discounts:** 10+ $11.20 (exc GST) · 50+ $10.73 (exc GST)

## Availability & dispatch

- In stock, ships same business day if ordered before 2PM (Australia/Sydney).
- We can dispatch 50 today; more stock is typically available with a 8–12 day lead time.

## Description

If you need a low-power, low-cost accelerometer with analogue output, take a look at this module. powered by the triple-axis ADXL335 accelerometer with a measurement range of up to ±3.6 g.

Board has an on-board regulator capable of accepting voltages from 1.8-6V. The board includes 0.1uF capacitors that give the device a bandwidth of 50Hz

- measurement range:±3.6 g.
- Sensor Output: Analogue 3 channel(X,Y,Z)
- Bandwidth:50Hz
- Module supply voltage range: 1.8 V to 6.0V
- I/O voltage range: 1.8 V to 6.0V
- Power Use: 320µA
- Wide temperature range (−40°C to +85°C)
- Dimensions (LxWxH): 
    - Without Header: 21 mm x 15 mm x 3 mm
    - With Header: 21 mm x 15 mm x 11 mm

### Examples

**Raspberry Pi Pico - MicroPython**

```

from machine import ADC, Pin
import utime

# Define the ADC object for X, Y and Z inputs
xAxisPin = ADC(Pin(26)) # change pins as needed
yAxisPin = ADC(Pin(27))
zAxisPin = ADC(Pin(28))

# Define ADC Maximum Value
ADCMaxVal = 65535  # The default ADC resolution for Raspberry Pi Pico is 16 bit

# Define Maximum mV Value
mVMaxVal = 3300  # The default voltage reference for Pico is 3.3V or 3300 mV

# Multiply any read ADC value by mVPerADC to convert to mV
mVPerADC = mVMaxVal / ADCMaxVal

# Define the supply midpoint in mV
supplyMidPointmV = 3230 / 2

# Define mv per 1g detected
mVperg = 323

class AccelerometerReading:
    def __init__(self, x=0, y=0, z=0):
        self.x = x
        self.y = y
        self.z = z

def acceleration():
    # Read the x, y, and z values
    xAxisValADC = xAxisPin.read_u16()
    yAxisValADC = yAxisPin.read_u16()
    zAxisValADC = zAxisPin.read_u16()

    # Convert the ADC values to millivolts
    xAxisValmV = xAxisValADC * mVPerADC
    yAxisValmV = yAxisValADC * mVPerADC
    zAxisValmV = zAxisValADC * mVPerADC

    # Calculate the accelerometer measurements in g
    reading = AccelerometerReading()
    reading.x = (xAxisValmV - supplyMidPointmV) / mVperg
    reading.y = (yAxisValmV - supplyMidPointmV) / mVperg
    reading.z = (zAxisValmV - supplyMidPointmV) / mVperg

    return reading

while True:
    reading = acceleration()
    print('x:', reading.x, 'y:', reading.y, 'z:', reading.z)
    utime.sleep_ms(100)
```

**Arduino - C++**

```

// Define Analog input pins for accelerometer outputs 
int xAxisPin = A0; int yAxisPin = A1; int zAxisPin = A2;

// Variables to hold ADC data from the analog input pins 
int xAxisValADC = 0; int yAxisValADC = 0; int zAxisValADC = 0;

// Variables to hold voltage values after converting from ADC units to mV 
float xAxisValmV = 0; float yAxisValmV = 0; float zAxisValmV = 0;

// Define ADC Maximum value 
int ADCMaxVal = 1023;

// Define Maximum mV value 
float mVMaxVal = 5000;

// Define supply midpoint in mV 
float supplyMidPointmV = 3230 / 2;

// Define mv per 1g detected 
int mVperg = 323;

// Multiply any acquired ADC value by mVPerADC to convert to mV 
float mVPerADC = mVMaxVal / ADCMaxVal;

// Declare a struct to hold the accelerometer values
struct AccelerometerReading {
  float x;
  float y;
  float z;
};

void setup() {
  Serial.begin(9600);

  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
}

void loop() {
  AccelerometerReading reading = acceleration();
  Serial.print("x: ");  Serial.print(reading.x);
  Serial.print(" y: "); Serial.print(reading.y);
  Serial.print(" z: "); Serial.println(reading.z);  
  delay(100);
}

AccelerometerReading acceleration() {
  //Read the x, y, and z values from
  //the analog input pins
  xAxisValADC = analogRead(xAxisPin);
  yAxisValADC = analogRead(yAxisPin);
  zAxisValADC = analogRead(zAxisPin);

  //Convert the ADC values to millivolts
  xAxisValmV = xAxisValADC * mVPerADC;
  yAxisValmV = yAxisValADC * mVPerADC;
  zAxisValmV = zAxisValADC * mVPerADC;

  /* This code is calculating the g force. It does this by subtracting the median voltage value from the voltage received from the analog input. 
  This resultant value is then divided by the number of millivolts per g as given by the accelerometer. 
  The final data is in terms of g units. */
  AccelerometerReading reading;
  reading.x = (xAxisValmV - supplyMidPointmV) / mVperg;
  reading.y = (yAxisValmV - supplyMidPointmV) / mVperg;
  reading.z = (zAxisValmV - supplyMidPointmV) / mVperg;
  return reading;
}
```

## Images

- [Product image 1](https://core-electronics.com.au/media/catalog/product/c/e/ce06578-2_1.jpg)
