Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ADXL343 I2C/SPI - STEMMA QT / Qwiic: Examples, Pinouts, and Specs

Image of ADXL343 I2C/SPI - STEMMA QT / Qwiic
Cirkit Designer LogoDesign with ADXL343 I2C/SPI - STEMMA QT / Qwiic in Cirkit Designer

Introduction

The ADXL343 is a low-power, 3-axis accelerometer manufactured by Adafruit, designed for motion sensing applications. It features a compact form factor and supports both I2C and SPI communication protocols, making it versatile and easy to integrate into a wide range of projects. With STEMMA QT / Qwiic connectors, the ADXL343 simplifies wiring and enables quick prototyping without soldering.

Explore Projects Built with ADXL343 I2C/SPI - STEMMA QT / Qwiic

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32 and ADXL343-Based Battery-Powered Accelerometer with SPI Communication
Image of vibration module: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
This circuit features an ESP32 microcontroller interfaced with an ADXL343 accelerometer via SPI communication, powered by a 12V battery regulated down to 5V and 8V using 7805 and 7808 voltage regulators. The ESP32 reads accelerometer data and outputs it via serial communication, with additional components including a pushbutton and a rocker switch for user input.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Health Monitoring System with Nucleo WB55RG and OLED Display
Image of Pulsefex: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
This circuit is a multi-sensor data acquisition system that uses a Nucleo WB55RG microcontroller to interface with a digital temperature sensor (TMP102), a pulse oximeter and heart-rate sensor (MAX30102), and a 0.96" OLED display via I2C. Additionally, it includes a Sim800l module for GSM communication, powered by a 3.7V LiPo battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
Image of 512: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Leonardo and ADXL345 Accelerometer-Based Motion Detection System
Image of mini project: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
This circuit interfaces an ADXL345 accelerometer with an Arduino Leonardo via I2C communication. The Arduino provides power and ground to the accelerometer and reads acceleration data through the SDA and SCL lines.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ADXL343 I2C/SPI - STEMMA QT / Qwiic

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of vibration module: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
ESP32 and ADXL343-Based Battery-Powered Accelerometer with SPI Communication
This circuit features an ESP32 microcontroller interfaced with an ADXL343 accelerometer via SPI communication, powered by a 12V battery regulated down to 5V and 8V using 7805 and 7808 voltage regulators. The ESP32 reads accelerometer data and outputs it via serial communication, with additional components including a pushbutton and a rocker switch for user input.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Pulsefex: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
Battery-Powered Health Monitoring System with Nucleo WB55RG and OLED Display
This circuit is a multi-sensor data acquisition system that uses a Nucleo WB55RG microcontroller to interface with a digital temperature sensor (TMP102), a pulse oximeter and heart-rate sensor (MAX30102), and a 0.96" OLED display via I2C. Additionally, it includes a Sim800l module for GSM communication, powered by a 3.7V LiPo battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 512: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of mini project: A project utilizing ADXL343 I2C/SPI - STEMMA QT / Qwiic in a practical application
Arduino Leonardo and ADXL345 Accelerometer-Based Motion Detection System
This circuit interfaces an ADXL345 accelerometer with an Arduino Leonardo via I2C communication. The Arduino provides power and ground to the accelerometer and reads acceleration data through the SDA and SCL lines.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Motion detection and gesture recognition
  • Tilt sensing in portable devices
  • Vibration monitoring
  • Robotics and drone navigation
  • Wearable devices and fitness trackers

Technical Specifications

The ADXL343 offers a range of features and specifications that make it suitable for various motion sensing applications.

Key Specifications

Parameter Value
Operating Voltage 3.3V (STEMMA QT / Qwiic compatible)
Communication Protocols I2C, SPI
Measurement Range ±2g, ±4g, ±8g, ±16g (configurable)
Resolution 10-bit or 13-bit
Output Data Rate (ODR) 0.1 Hz to 3200 Hz
Operating Temperature -40°C to +85°C
Power Consumption 23 µA in measurement mode (typical)
Dimensions 25.4mm x 17.8mm x 4.6mm

Pin Configuration

The ADXL343 breakout board includes the following pins:

Pin Name Description
VIN Power input (3.3V or 5V compatible)
GND Ground connection
SDA I2C data line (also used for SPI MOSI in SPI mode)
SCL I2C clock line (also used for SPI SCK in SPI mode)
CS Chip Select (used in SPI mode; tie to GND for I2C mode)
INT1 Interrupt 1 output (configurable for motion detection, free-fall, etc.)
INT2 Interrupt 2 output (configurable for additional interrupt functionality)

Usage Instructions

The ADXL343 can be used in either I2C or SPI mode, depending on your project requirements. Below are the steps to integrate and use the ADXL343 in a circuit.

Connecting the ADXL343

  1. I2C Mode:

    • Connect VIN to a 3.3V or 5V power source.
    • Connect GND to the ground of your circuit.
    • Connect SDA to the I2C data pin on your microcontroller (e.g., Arduino UNO A4).
    • Connect SCL to the I2C clock pin on your microcontroller (e.g., Arduino UNO A5).
    • Tie the CS pin to GND to enable I2C mode.
  2. SPI Mode:

    • Connect VIN and GND as described above.
    • Connect SDA to the SPI MOSI pin on your microcontroller.
    • Connect SCL to the SPI SCK pin on your microcontroller.
    • Connect CS to a digital pin on your microcontroller to act as the chip select.
    • Optionally, connect INT1 and INT2 to monitor interrupts.

Arduino Example Code (I2C Mode)

Below is an example of how to use the ADXL343 with an Arduino UNO in I2C mode. This code uses the Adafruit ADXL343 library, which can be installed via the Arduino Library Manager.

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL343.h>

// Create an ADXL343 object
Adafruit_ADXL343 adxl = Adafruit_ADXL343(12345); // Pass an arbitrary sensor ID

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor to open

  // Initialize the ADXL343
  if (!adxl.begin()) {
    Serial.println("Failed to find ADXL343 chip. Check wiring!");
    while (1);
  }
  Serial.println("ADXL343 found!");

  // Set measurement range to ±4g
  adxl.setRange(ADXL343_RANGE_4_G);
  Serial.print("Range set to: ");
  switch (adxl.getRange()) {
    case ADXL343_RANGE_2_G: Serial.println("±2g"); break;
    case ADXL343_RANGE_4_G: Serial.println("±4g"); break;
    case ADXL343_RANGE_8_G: Serial.println("±8g"); break;
    case ADXL343_RANGE_16_G: Serial.println("±16g"); break;
  }
}

void loop() {
  // Read acceleration data
  sensors_event_t event;
  adxl.getEvent(&event);

  // Print acceleration values
  Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" m/s^2 ");
  Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" m/s^2 ");
  Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.println(" m/s^2");

  delay(500); // Delay for readability
}

Best Practices

  • Use pull-up resistors (4.7kΩ recommended) on the SDA and SCL lines if your microcontroller does not have internal pull-ups.
  • Ensure the CS pin is properly tied to GND for I2C mode or controlled for SPI mode.
  • Avoid excessive vibrations or shocks to the sensor during operation to prevent damage.

Troubleshooting and FAQs

Common Issues

  1. ADXL343 not detected:

    • Verify the wiring, especially the SDA and SCL connections.
    • Ensure the CS pin is tied to GND for I2C mode.
    • Check that the correct I2C address (default: 0x53) is being used.
  2. Incorrect or unstable readings:

    • Ensure the sensor is securely mounted to avoid mechanical noise.
    • Verify the power supply voltage is stable and within the specified range.
  3. Interrupts not triggering:

    • Double-check the interrupt configuration in your code.
    • Ensure the INT1 or INT2 pins are connected to the correct microcontroller pins.

FAQs

Q: Can I use the ADXL343 with a 5V microcontroller?
A: Yes, the ADXL343 breakout board includes level-shifting circuitry, making it compatible with both 3.3V and 5V systems.

Q: How do I change the measurement range?
A: Use the setRange() function in the Adafruit ADXL343 library to configure the range (e.g., ±2g, ±4g, etc.).

Q: What is the default I2C address of the ADXL343?
A: The default I2C address is 0x53. If there are address conflicts, you can modify the address by adjusting the ALT ADDRESS pin on the breakout board.

Q: Can I use both I2C and SPI simultaneously?
A: No, the ADXL343 operates in either I2C or SPI mode, but not both at the same time. Select the mode by configuring the CS pin.

By following this documentation, you can successfully integrate and use the ADXL343 in your projects!