Arduino library for the Bosch BMI323 6-axis IMU using direct I2C register communication.
This library provides a lightweight and reliable object-oriented interface for:
- Accelerometer acquisition
- Gyroscope acquisition
- Temperature reading
Compatible with ESP32, RP2040, and Arduino-compatible platforms.
Current library version supports I2C communication only.
SPI communication is not implemented in this version.
- Direct 16-bit register communication
- Object-oriented API
- Lightweight implementation
- High-speed I2C communication
- Supports custom I2C pins
- Handles BMI323 dummy I2C bytes internally
- Compatible with Bosch BMI323 devices
- Optimized for embedded systems and rapid prototyping
| Interface | Support Status |
|---|---|
| I2C | Supported |
| SPI | Not implemented |
The library is not yet available through the Arduino Library Manager.
Please install it manually using the ZIP package.
- Download this repository as ZIP
- Open Arduino IDE
- Go to:
Sketch -> Include Library -> Add .ZIP Library...
- Select:
DevLab_BMI323.zip
#include <DevLab_BMI323.h>
#define SDA_PIN 1
#define SCL_PIN 6
DevLab_BMI323 imu(Wire, 0x69);
DevLab_BMI323::SensorData data;
void setup() {
Serial.begin(115200);
if (!imu.begin(SDA_PIN, SCL_PIN, 400000)) {
Serial.println("BMI323 initialization failed.");
while (1);
}
}
void loop() {
if (imu.readData(data)) {
Serial.print("ACC X: ");
Serial.print(data.accX);
Serial.print(" Y: ");
Serial.print(data.accY);
Serial.print(" Z: ");
Serial.println(data.accZ);
Serial.print("GYR X: ");
Serial.print(data.gyrX);
Serial.print(" Y: ");
Serial.print(data.gyrY);
Serial.print(" Z: ");
Serial.println(data.gyrZ);
Serial.print("Temperature: ");
Serial.print(data.temperatureC);
Serial.println(" °C");
}
delay(200);
}| BMI323 | MCU |
|---|---|
| SDA | SDA |
| SCL | SCL |
| VDD | 3.3V |
| VDDIO | 3.3V |
| GND | GND |
| CSB | 3.3V |
| SDO | 3.3V (0x69) or GND (0x68) |
| MCU Platform | Status |
|---|---|
| ESP32 | Tested |
| ESP32-C6 | Tested |
| ESP32-C5 | Tested |
| ESP32-H2 | Tested |
| Arduino-compatible boards | Compatible |
BMI323 I2C burst reads include 2 dummy bytes at the beginning of the transfer.
The DevLab_BMI323 library automatically handles those internally.
Current library version supports only I2C communication.
SPI support may be added in future releases.
DevLab_BMI323/
├── examples/
│ └── BasicRead/
├── src/
│ ├── DevLab_BMI323.h
│ └── DevLab_BMI323.cpp
├── library.properties
├── README.md
└── LICENSE
| Parameter | Value |
|---|---|
| Library Name | DevLab_BMI323 |
| Version | 1.0.0 |
| Communication | I2C |
| Architecture | Cross-platform |
Adrián Rabadán Ortiz
UNIT Electronics - DevLab Ecosystem
MIT License