LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Advice for reading data from a 9DOF IMU (SPI/I2C).

Hello everyone,

I am working on a project where I need to read data from an IMU model BNO085. This IMU is interesting because it has an integrated ARM32 that uses sensor fusion algorithms to estimate orientation (pitch, roll, yaw angles), linear acceleration, gyroscope, and magnetometer data, and so on...

The main problem is that this sensor uses a communication protocol called SHTP (Sensor Hub Transport Protocol), which is used to manage multiple SPI/I2C sensors. This protocol is somewhat complex to understand. This sensor has good libraries for use with Arduino and some other MCUs. However, I would like to use a cRIO and an NI 9401 module to read data from this sensor via FPGA. However, I have little experience with LabVIEW (I started working with it about four months ago). I tried using the API for reading SPI/I2C sensors, but without success.

I am now considering using an Arduino to read the sensor data and then send this data to the cRIO using some serial protocol (UART/RS232, SPI). Do you think this is a good idea, or should I invest more time trying to make the SPI communication (with this SHTP protocol) work?

Thanks!
Lucian.

0 Kudos
Message 1 of 3
(84 Views)

Hi lucian,

 

using the Arduino as interface converter might be the faster way to implement the communication…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(76 Views)

Give this article a read:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019VSSSA2&l=en-US

 

See if that helps. I wouldn't recommend trying to make your own SPI library, but it sounds like NI has one. It will probably take up some resources on your system but it'll probably work.

 

Using an Arduino to shift from SPI to UART would probably be a quicker way to go, and it wouldn't tie up your cRIO card (which is WAY more expensive than an Arduino clone, which could be just a couple dollars!)

0 Kudos
Message 3 of 3
(40 Views)