sparkfun H3LIS331DL Breakout Hookup Manual

sparkfun H3LIS331DL Breakout Hookup Manual

Accelerometer

Advertisement

Quick Links

Page 1 of 12
H3LIS331DL Accelerometer Breakout Hookup
Guide
Introduction
The H3LIS331DL is a high-g accelerometer with I2C and SPI interface
options. It offers an adjustable output range of 100, 200, or 400g, and an
adjustable data rate of up to 1kHz.
SparkFun Triple Axis Accelerometer Breakout -
H3LIS331DL
 SE N-1448 0
...
Required Materials

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the H3LIS331DL and is the answer not in the manual?

Questions and answers

Summary of Contents for sparkfun H3LIS331DL

  • Page 1 H3LIS331DL Accelerometer Breakout Hookup Guide Introduction The H3LIS331DL is a high-g accelerometer with I2C and SPI interface options. It offers an adjustable output range of 100, 200, or 400g, and an adjustable data rate of up to 1kHz. SparkFun Triple Axis Accelerometer Breakout - H3LIS331DL ...
  • Page 2: Suggested Reading

    SparkFun Triple Axis Accelerometer Breakout - H3LIS331DL SEN-14480 Arduino Pro 328 - 3.3V/8MHz DEV-10914 It's blue! It's skinny! It's the Arduino Pro! SparkFun's minimal design a… Arduino Stackable Header Kit PRT-10007 These headers are made to work with the Arduino Main Board, Ardui…...
  • Page 3: Hardware Overview

    Hardware Overview The H3LIS331DL breakout is fairly simple. H3LIS331DL Sensor IC - This is the sensor IC. Its operating voltage only extends up to 3.6V, so to use it with a 5V Arduino or Arduino clone, you’ll need some kind of voltage translation! It is perfectly centered on the PCB.
  • Page 4 SparkFun Standard I C Header - Most boards which can be communicated to via I C use this pinout, making it easy to stack them or connect them in a daisy chain.
  • Page 5 Page 5 of 12 CS Jumper - Removing the solder from this jumper enables SPI mode. When the part’s CS line is low at boot, it enables SPI mode. SA0 Pin - When the chip is in SPI mode, this goes from being the address select pin to being the MISO pin.
  • Page 6: Library Overview

    - Converts from raw data to an actual convertToG(maxScale, reading) g-reading. The first parameter is the maximum reading for the current mode, as set by the function. Options are 6/12/24g for the setFullScale() LIS331HH and 100/200/400g for the H3LIS331DL.
  • Page 7: Hardware Hookup

    Page 7 of 12 - Set the setHighPassCoeff(high_pass_cutoff_freq_cfg hpcoeff) coefficient for the high pass filter. The actual cutoff frequency is dependent upon the data rate set by . The cutoff frequency is (fs)/(6*Hpc), setODR() where fs is the sampling frequency and Hpc is the high pass coefficient as set by these constants: •...
  • Page 8: Example Code

    Page 8 of 12 The H3LIS331DL supports I C, SPI, and three-wire SPI data transfer. The library supports I C and SPI mode. Obviously, since SPI requires four wires and I C only requires two, there are different circuit configurations for each mode.
  • Page 9 Page 9 of 12 S PA R K F U N L I S 3 3 1 A R D U I N O L I B RA RY For the most part, the example code for SPI mode and I C mode is identical.
  • Page 10 Page 10 of 12 #include "SparkFun_LIS331.h" #include <SPI.h> LIS331 xl; void setup() // put your setup code here, to run once: pinMode(9,INPUT); // Interrupt pin input pinMode(10, OUTPUT); // CS for SPI digitalWrite(10, HIGH); // Make CS high pinMode(11, OUTPUT); // MOSI for SPI pinMode(12, INPUT);...
  • Page 11 Page 11 of 12 // This next section configures an interrupt. It will cause INT1 on the accelerometer to go high when the absolute v alue of the reading on the Z­axis exceeds a certain level fo certain number of samples. xl.intSrcConfig(LIS331::INT_SRC, 1);...
  • Page 12 115200 baud. Resources and Going Further Now that you’ve successfully got your H3LIS331DL up and running, it’s time to incorporate it into your own project! • For lower dynamic ranges (6-24g) SparkFun offers the LIS331 breakout board, which is library compatible with this one.

Table of Contents