

The LSM303C is a 6-axis motion sensor that integrates a 3-axis accelerometer and a 3-axis magnetometer into a single compact package. This combination allows the sensor to detect orientation, motion, and magnetic field strength in three-dimensional space. It is widely used in applications such as robotics, drones, mobile devices, and other systems requiring precise motion tracking and navigation.
The LSM303C is particularly valued for its small size, low power consumption, and high sensitivity, making it ideal for portable and battery-powered devices.








The LSM303C comes in a 12-pin LGA package. Below is the pin configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Power supply (1.8V to 3.6V) |
| 2 | GND | Ground |
| 3 | SCL/SPC | I²C clock line / SPI clock |
| 4 | SDA/SDI/SDO | I²C data line / SPI data input/output |
| 5 | CS | SPI chip select (active low) |
| 6 | INT1 | Interrupt 1 output |
| 7 | INT2 | Interrupt 2 output |
| 8 | DRDY_M | Data-ready signal for magnetometer |
| 9 | DRDY_A | Data-ready signal for accelerometer |
| 10 | RES | Reserved (leave unconnected) |
| 11 | VDD_IO | I/O voltage reference |
| 12 | GND | Ground |
Below is an example of how to interface the LSM303C with an Arduino UNO using the I²C protocol:
#include <Wire.h>
// LSM303C I2C address
#define LSM303C_ACC_ADDRESS 0x1D // Accelerometer address
#define LSM303C_MAG_ADDRESS 0x1E // Magnetometer address
// Register addresses
#define CTRL_REG1_A 0x20 // Accelerometer control register
#define CTRL_REG1_M 0x20 // Magnetometer control register
#define OUT_X_L_A 0x28 // Accelerometer X-axis low byte
#define OUT_X_L_M 0x28 // Magnetometer X-axis low byte
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication
// Configure accelerometer
Wire.beginTransmission(LSM303C_ACC_ADDRESS);
Wire.write(CTRL_REG1_A);
Wire.write(0x57); // Enable accelerometer, 100 Hz ODR
Wire.endTransmission();
// Configure magnetometer
Wire.beginTransmission(LSM303C_MAG_ADDRESS);
Wire.write(CTRL_REG1_M);
Wire.write(0x60); // Enable magnetometer, 10 Hz ODR
Wire.endTransmission();
}
void loop() {
int16_t accX, accY, accZ;
// Read accelerometer data
Wire.beginTransmission(LSM303C_ACC_ADDRESS);
Wire.write(OUT_X_L_A | 0x80); // Set auto-increment for multi-byte read
Wire.endTransmission(false);
Wire.requestFrom(LSM303C_ACC_ADDRESS, 6);
if (Wire.available() == 6) {
accX = Wire.read() | (Wire.read() << 8);
accY = Wire.read() | (Wire.read() << 8);
accZ = Wire.read() | (Wire.read() << 8);
}
// Print accelerometer data
Serial.print("Acc X: "); Serial.print(accX);
Serial.print(" | Acc Y: "); Serial.print(accY);
Serial.print(" | Acc Z: "); Serial.println(accZ);
delay(500); // Wait for 500 ms
}
By following this documentation, you can effectively integrate the LSM303C into your projects for accurate motion and orientation sensing.