LSM303C 6DoF Hookup Guide

Pages
Contributors: .Brent.
Favorited Favorite 1

Hardware Assembly

I2C Example

The basic use case for the LSM303C requires 4 connections to the ┬ÁController or ┬ÁProcessor; power, ground, I2C clock and data. The following images shows how we used a SparkFun FTDI Basic Breakout, and an 3.3V Arduino Pro Mini to power and interface to a LSM303C 6 DOF Breakout board.

LSM303C and Arduino Mini

An LSM303C wired up to and Arduino Pro Mini for the MinimalistExample (IIC)

Make connections to the breakout anyway that makes you happy. The board in the above photo has a straight header soldered to it. We could have used a right angle header, or wire, etc. Please note that different mounting orientations will alter the orientation of the axes. Make sure your code matches the physical orientation for your projects.

For this demo, we made the following connections:

Arduino Pro MiniLSM303C BreakoutNotes
VCCVDD+3.3V
GNDGND+0V
SDASDA/SDI/SDOSerial data @ +3.3V CMOS logic
SCLSCL/SCLKSerial clock @ +3.3V CMOS logic

The whole system in our testing was powered via USB through the FTDI basic.

USB to FTDI to Pro Mini to I2C LSM303C Breakout Fritzing diagram

Electrical connections for demo

SPI Example

Four hardware changes need to be made to interface the sensor using SPI. Move the SDA/SDI/SDO connection from SDA on the Arduino Pro Mini to digital pin 10, move the SCK/SCLK connection from SCL on the Arduino Pro Mini to digital pin 11, and add the two chip select lines.

Arduino Pro MiniLSM303C BreakoutNotes
VCCVDD+3.3V
GNDGND+0V
Digital 10SDA/SDI/SDOSerial data @ +3.3V CMOS logic
Digital 11SCL/SCLKSerial clock @ +3.3V CMOS logic
Digital 12CS_XLAccelerometer chip select @ +3.3V CMOS logic
Digital 13CS_MAGMagnetometer chip select @ +3.3V CMOS logic

SPI Hookup

Example of a Pro Mini wired up for SPI


USB to FTDI to Pro Mini to SPI LSM303C Breakout Fritzing diagram

Connecting for SPI interface