- EOL
Attention! The product has been discontinued. Check other products incategory. |
Description
The sensor is used to determine acceleration and magnetic field. The measurement of these quantities is allowed by 3-axis accelerometer and magnetometer, as well as necessary for the proper operation of the system, passive elements. Built-in regulator allows you to power the module with any voltage from the range of 2.5 V to 5.5 V.
To communicate with the central unit are used buses: I2C (TWI) or SPI. Voltage converter on the I2C input lines and allows you to communicate in any voltage standard ranging from 2.5 V to 5.5 V. Pins are the populargoldpin connectors for connecting the sensor viawiresor to directly attach to the breadboard.
The product is compatible with Arduino To faciliatte the operation of the sensor, the manufacturer has prepared sample code with the library for modules of Arduino. |
LSM303 compared to previous versions
Compared to previous versions - theLSM303DLMandLSM303DLHC, LSM303 offers a number of improvements, such as:
- the wider measurement range of the sensors: accelerometer up to 16g, compass up to 12 gauss
- shared I2C address for both sensors (compass and accelerometer), which makes the module appears as one device
- the choice of communication interface - I2C or SPI
The LSM303D module is not pin-compatible with earlier versions of the LSM303. In the case of application of the new module as a replacement, you should change the connections and update the addressing of I2C.
Specification
- Supply voltage: 2,5 to 5,5 V
- Current consumption: 5 mA
- Digital interface: I2C or SPI
- Accelerometer: 16 bits / axis
- Magnetometer: 16 bits / axis
- Sensitivity range (configurable):
- Accelerometer: ±2, ±4, ±6, ±8, or ±16 g
- Magnetometer: ±2, ±4, ±8, or ±12 Gauss
- Dimensions: 22.9 cm x 10.2 x 2.54 mm
- Weight (without connectors): 0.6 g
Details inthe documentationand onthe diagram of the module.
Service and pins
The sensor has nine pins for self-assemblyof goldpin connectors- 2.54 mm pitch (included).
PIN | Description |
VDD | Regulator's voltage output of 3.3 V.Current is up to 150 mA. |
VIN | Power - you should connect the voltage from 2.5 to 5.5 V. |
GND | The ground of the system. |
SDA / SDI / SDO | I2C data line and SPI communication line. It has a voltage converter, the status is high, the voltage's value is VIN, low is 0 V. |
SCL / SPC | Clock line of the I2C and SPI. It has a voltage converter, the high status is the value of the VIN voltage, low is 0 V. |
SDO / SA0 | SPI data line in four-wire mode or change of address for I2C.This input does not have a voltage converter, high status is 3.3 V. |
CS | The choice of SPI bus (chip select). By default, it is pulled up to the voltage VDD which means that the device is set to work with I2C bus. |
INT2 | The configurable interrupt no. 2.This input does not have a voltage converter, high status is 3.3 V. |
INT1 | The configurable interrupt no. 1.This input does not have a voltage converter, high status is 3.3 V. |
Dimensions
Board is a rectangle: 22.9 cm x 10.2 mm, the thickness is not exceeding 2.54 mm. To mount the sensor, use the hole with an inner diameter of 2.2 mm. Pins are the popular goldpin connectors for connecting the sensor viawiresor to directly attach to breadboard.
The I2C bus (TWI)
The choice of bus is carried out by indicating a signal on CS pin. By default, it is pulled up to voltage VDD which means that the system is operating in I2C mode. The SCL and SDL communication inputs have voltage converters so they can work with voltages ranging from 2.5 V to 5 V.
Device's address is 7-bit. The youngest bit of address can be configured using the lines SA0 (001110x). By default, it is pulled up to VDD voltage by creating address: 0011101b. To change the value of the youngest bit, it is necessary to pull the line to ground which will make the address change to: 0011110b.
The SPI bus
To enter SPI mode, you must indicate low state at pin CS. SPC (clock) and SDI (input data) communication inputs have voltage converters which means that they can operate with voltages from 2.5 V to 5 V.
In default mode of 4-wire, sensor sends data to the MASTER device by inputting the SDO output data which does not have the power converter. The user can select 3-wired mode where the output SDI and SDO will be on one pin, controlled through a system LSM303D. Configuration details are available inthe documentation.
First run
Details on usage can be found in thedocumentationof the sensor. Below are the most important informations:
- Accelerometer and magnetometer are disabled by default. You have to run them by modifying the right registers CTRL1 and CTRL7.
- You can read values from registers continuously by setting the most significant bit of the address to value 1 - auto increment option.
- The auto increment function in the SPI mode can be enabled by setting the second bit (bit 1, marked as MS inthe documentation) of the settings SPI.
- Unlike LSM303-series, LSM303D sensors have a common address of the I2C bus. Thanks to this, they are visible as one device.
Useful links |