

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.








The ADXL343 offers a range of features and specifications that make it suitable for various motion sensing applications.
| 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 |
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) |
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.
I2C Mode:
VIN to a 3.3V or 5V power source.GND to the ground of your circuit.SDA to the I2C data pin on your microcontroller (e.g., Arduino UNO A4).SCL to the I2C clock pin on your microcontroller (e.g., Arduino UNO A5).CS pin to GND to enable I2C mode.SPI Mode:
VIN and GND as described above.SDA to the SPI MOSI pin on your microcontroller.SCL to the SPI SCK pin on your microcontroller.CS to a digital pin on your microcontroller to act as the chip select.INT1 and INT2 to monitor interrupts.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
}
SDA and SCL lines if your microcontroller does not have internal pull-ups.CS pin is properly tied to GND for I2C mode or controlled for SPI mode.ADXL343 not detected:
SDA and SCL connections.CS pin is tied to GND for I2C mode.0x53) is being used.Incorrect or unstable readings:
Interrupts not triggering:
INT1 or INT2 pins are connected to the correct microcontroller pins.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!