cancel
Showing results for 
Search instead for 
Did you mean: 

LIS331 Implementation

groufosse
Associate II
Posted on October 04, 2013 at 16:39

Hello,

I'm hoping to get a bit of guidance here on this application I'm developing using the LIS331HH device.

I have integrated it into the application PCB, and using SPI to communicate with the device. All is well and I can set and read registers, ODR, filters, range, etc. Also, for actual implementation, I have tied the 2 HW interrupt lines to the microcontroller and will be using that in future. For the time, I just want to understand how to implement the right code to deliver the desired outcome. Using some test code, I can see data coming from xL, XH, yL, yH, zL, ZH but don't fully realize how to apply it for the desired outcome.

The application is very straightforward; to measure forces on the PCB that are primarily in 1 axis. After looking at a handful of code samples (there are few to be found) it's gained some clarity but still not there. Also, I didn't find the app notes helpful in terms of actual code implementation.

I understand that the orientation of the device is quite relevant to the data output. The PCB when installed in the assembly can ''roll'' (in x-y) about the Z-axis (meaning Z axis is horizontal relative to me)

So exactly what do I need to do with the output data to meaningfully use it? Here are some questions I hope someone can answer for me:

1 - The range of the device is +/-24g. Can I extend this to just +48g? How?

2 - How do I ''normalize'' the actual position relative to the absolute (calibrated) position and apply this to the data of interest?

3 - I'm primarily interested in the Z force vector. I also understand that there may be relevant applicable forces from x,y contributing to z, as the device rolls about on the z axis. Can I use the simple square root of sum-of-squares to tabulate total force on Z?

I would be mostly appreciative of a code sample, algorithm or clear explanation for this objective.

Thank you, regards,

Gary

#lis331
4 REPLIES 4
Thiago REIS
Associate II
Posted on October 22, 2013 at 15:11

Hello Gay,

Please check the answers to your questions below:

1 - The range of the device is +/-24g. Can I extend this to just +48g? How?

        - This is not possible the maximum FS available in this accelerometer is +/- 24g.

2 - How do I ''normalize'' the actual position relative to the absolute (calibrated) position and apply this to the data of interest?

        - I am not sure what you meant by normalize, but you can set up an average to determine your product initial's positioning, and then develop your solution based on that reference.

3 - I'm primarily interested in the Z force vector. I also understand that there may be relevant applicable forces from x,y contributing to z, as the device rolls about on the z axis. Can I use the simple square root of sum-of-squares to tabulate total force on Z?

        - I believe the Z-axis of the accelerometer already gives you a good idea of what is going on with the z-forces, that is because the sensor computes each axis indenpendetly, so, if you tilt your product, then, the x - y and z values will show a variation due to that movement.

ST does offer a tool for evaluation that can help you on your development, the Unico plataform that you can find on the link below:

http://www.st.com/web/en/catalog/tools/PF257815

 

Please do let me know if there is anything else that I can do to support you?

Thank you very much,

Thiago

Hello,

I'm hoping to get a bit of guidance here on this application I'm developing using the LIS331HH device.

I have integrated it into the application PCB, and using SPI to communicate with the device. All is well and I can set and read registers, ODR, filters, range, etc. Also, for actual implementation, I have tied the 2 HW interrupt lines to the microcontroller and will be using that in future. For the time, I just want to understand how to implement the right code to deliver the desired outcome. Using some test code, I can see data coming from xL, XH, yL, yH, zL, ZH but don't fully realize how to apply it for the desired outcome.

The application is very straightforward; to measure forces on the PCB that are primarily in 1 axis. After looking at a handful of code samples (there are few to be found) it's gained some clarity but still not there. Also, I didn't find the app notes helpful in terms of actual code implementation.

I understand that the orientation of the device is quite relevant to the data output. The PCB when installed in the assembly can ''roll'' (in x-y) about the Z-axis (meaning Z axis is horizontal relative to me)

So exactly what do I need to do with the output data to meaningfully use it? Here are some questions I hope someone can answer for me:

1 - The range of the device is +/-24g. Can I extend this to just +48g? How?

2 - How do I ''normalize'' the actual position relative to the absolute (calibrated) position and apply this to the data of interest?

3 - I'm primarily interested in the Z force vector. I also understand that there may be relevant applicable forces from x,y contributing to z, as the device rolls about on the z axis. Can I use the simple square root of sum-of-squares to tabulate total force on Z?

I would be mostly appreciative of a code sample, algorithm or clear explanation for this objective.

Thank you, regards,

Gary

groufosse
Associate II
Posted on October 22, 2013 at 20:35

OK, I downloaded and installed the package in my Win7 PC.

Is there a virtual com port driver for this that I'm missing? I have the LIS331DLH demo board.

Thanks,

GARY

Thiago REIS
Associate II
Posted on November 18, 2013 at 13:24

Hello Gary,

In order to provide a better feedback to you, could you please send me a screenshot of the issue that you are facing?

The evaluation board should be working with the installed application.

Thank you very much,

Thiago Reis

k88joshi
Associate II
Posted on December 18, 2014 at 21:20

Hello Reis,

I am currently working with LIS331HH sensor and able to read the X,Y,Z registers.  However, these values are in data type int16.  How can I convert it to acceleration in engineering units ? Does the range -32768 to 32767 correspond to -12g to 12g respectively ? 

My FS1 & FS0 are 0 and 1 Respectively.

Please advise.

Thanks,

Kamal Joshi