What it is: The ADXL345 is a small, low-power 3-axis accelerometer with excellent resolution. It's ideal for tilt sensing, tap/double-tap detection, freefall detection, and vibration monitoring.
How it works: I2C device at address 0x53. It measures acceleration on X/Y/Z in g (or m/s²); at rest, gravity registers as ~9.8 m/s² on the vertical axis. Shares SDA/SCL with the OLED.
Wiring (shared I2C bus with the OLED):
ADXL345 SDA -> GPIO4
ADXL345 SCL -> GPIO5
ADXL345 VCC -> 3V3
ADXL345 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "Adafruit ADXL345" (installs "Adafruit Unified Sensor" and "Adafruit BusIO"), plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: acceleration X/Y/Z in m/s². Tap or tilt the board to see the values respond.
Gotchas: Default address is 0x53 (0x1D if the SDO pin is tied high). It's a 3.3V part — don't feed VCC 5V unless your board has a regulator. Choose the ±2g range (default) for the finest resolution.