Comments: LSM6DS3 Breakout Hookup Guide
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
Hello, I am using LSM6DS6 breakout board with Arduino Mega using I2C. Can I get sampling rate of 6.6 KHz using this? I am using the FIFO example using I2C.
Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.
That being said... if you are referring to the data output rate, according to the datasheet (pages 20 & 52), you can only get the accelerometer data at that speed.
Hello I use lsm6ds3 from sparkfun, an arduino uno and a level shifter. it works in i2c but not in SPI. I followed the same assembly but no example in SPI works. Do you have any idea what I'm missing. Thanks.
Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.
That being said, a SPI connection requires a different hardware and software setup. So if your hardware assembly and/or code is exactly the same as the I2C, it will not work.
Hi, I am using the Sparkfun LSM6DS3 library and running the MinimalistExample. I am able to get the Gyro and Temp values. But, I am getting all zero acceleration values along all the axes.
Accelerometer: X = 0.0000 Y = 0.0000 Z = 0.0000
Gyroscope: X = 1.4700 Y = -2.1700 Z = -0.8400
Thermometer: Degrees C = 22.1875 Degrees F = 71.8250
I have cross-checked all the control register values with the datsaheet but no luck. Any ideas on what might be wrong ?
Thank you
Hi ! I would like to know if it's possible to control this sensor with only Labview or if I have to use an Arduino board? Thanks for yours answers.
Hi, i am using this sensor for a while now ,and i have a problem when i use together accelerometer and gyroscope. When i use them seperately eberything works great but if use both of them and acquire data from them fifo buffer accelerometers data are not good at all. I use teensy 3.6 and the ODRs for the sensors are really low 104Hz eatch. Thank you
Hi
I actually purchased LSM6DS3 breakout board and soldered the pins. Later we interfaced with arduino based on your hookup guide. But without connecting the two modules. I just loaded the code into arduino board and getting some default log output.The code which we used is from the sparkfun github library.The output is same even if it is interfaced with the breakout board using connecting wires. The breakout board is not able to speak with arduino .We are unable to get the real time data.Can u help me out with this?.Thank you
I have a question about using LSM6DS3 with arduino. What data rate from accelerometer can be effectively read and logged - what is the limit? Is it possible to get and log all 6664 samples per second for each axis? If not, is it possible with any other hardware than arduino? Is there any working example? Thank you!
The short answer is: an UNO or other 328p isn't fast enough to get data out and be able to do anything with it with the sensor running at full speed. I would recommend starting with a samd21, esp, or teensy for the additional speed and memory. This also has the advantage of 3.3V interfacing signals. With a 16MHz processor, you might be limited to about 1000 samples/sec.
Looking closer at the 16MHz redboard I have connected... running the SPI bus at 4 MHz (default used in the FifoExample), I measure activity on the bus and find that I can get 16 bits of data back every 20us. If the first byte is address, that's 16 bits of real data every 40us. If we request 3 16 bit values, (x, y, and z) that's 120us communication time per sample. Well, 1/6333 = 150us so it looks like a lost cause for the uno.
There's also a somewhat intelligent system inside, so you may find some settings effect others (it over-rides sample rates by ODR rates in the fifo). I don't have the time right now to investigate, but am actually going to work with this sensor in a couple weeks for an enginursday blog post. I think I'll be connecting it to a samd21, but also have tertiary plans involving some teensys.
They're pretty cheap, even if you don't end up using it for your project I would recommend picking one up to play with. Even without it, download the library through the library manager to see the examples.
I have the LSM6DS3 working with a redboard but I want to log data instead of just watching the IMU for changes, I have connected the board to a raspberryPI and I can see it the i2c tools in linux. In the arduino library setup of the IMU is handled by the library with the .begin call. Is there a setup example for perl, python or C that I can use with my linux config or do I need to work that out on my own? Thanks.
I am working with this breakout board in I2C mode with the FIFO example. It works well at 50Hz but if I go any faster (say 100Hz) the process stops at " myIMU.fifoClear();" in the "setup()" function. Has anyone got this to work at full speed? I am using a "Feather ARM M0" Atmel processor board.
Thanks for the confirmation re: power. Now I'm having an issue in trying to read out multiple bytes. For example if I want to read the Z-accelleration, I can get the lower byte by sending a 0xAC. I can get the higher byte by sending a 0xAD, but I can't seem to get both bytes in a single read. I've added the extra clock cycles with zeros at the end of my tx buffer. So I'll send [AC 00 00 00]. What I get back is [FF D9 D9 D9]. When I read the two bytes separately, I'll send [AC 00 00 00] and get [FF FB FB FB] and I'll send [AD 00 00 00] and get [FF 07 07 07]. That works out to 2043 which is really close to +1g, so I know the values are good. I just can't get the multibyte read to work. The multiSPI Arduino example clearly has it working, because the code never interacts directly with the higher byte. It sets up a 16bit buffer and gets it all with one read. I'm trying to do the same thing but can't seem to make it work. Any hints on how to proceed?
Forgot to include context. I'm developing my own application on another microcontroller. It's a DC9003A-B Wireless Sensor Mote from Linear.
I figured out my own issue. In my implementation I'm spinning 32 clock cycles no matter what, with a 4 byte buffer for Tx and for Rx. The very first configuration byte I'm sending is to register 0x10, and I send [10 44 00 00]. This accidentally overwrites 0x11 and 0x12 with zeros. 0x11 defaults to zero anyway, but 0x12 has one bit set by default. That one bit is what enables this multibyte read and write capability. So, in my first configuration write, I'm disabling my own ability to do a multibyte read in the future. I've fixed my code.
Hey, mind if I contact you via your account email? I was hoping to get a glimpse of your project and maybe figure out a way to make my code better / less confusing. Let me know,
Thanks, Marshall
Yes, you can contact me via my account email. No problem! I would be happy to help out if I can.
In the wiring diagram for SPI connection, you don't have anything connected to power or ground on the breakout board. I don't know anything about SPI, but does the board get powered through the SPI interface?
Good catch, you are correct. It's the classic pitfall. "Is the device powered?" well, no, of course it isn't working then. I've fixed the diagram by connecting ground and 3.3v power.
And to answer your question, the SPI interface does not include power and ground. Though it's called "4-wire" it assumes the presence of a common ground and that the devices have been powered.
Thanks for letting us know!