We are using a LIS2DH12TR. In our application
if we set to 2G we get a result of 400
4G = 200
8G = 100
but 16G goes to 33 and we expected 50
Are we missing something?
We get same result over 20 devices
Thanks
Dan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-14 2:33 AM
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-14 4:12 AM
Hi Dan, as reported in the conversion table of the datasheet p.10, please note that the conversion factor for the FS=16g case is not the double of the FS=8g one.
Please consider also the ST official C drivers for the LIS2DH12 on Github, in particular the lis2dh12_reg.c file. Assuming you are running the device in Normal mode, these are the functions to be used to convert raw-data into engineering units:
float lis2dh12_from_fs2_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 4.0f;
}
float lis2dh12_from_fs4_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 8.0f;
}
float lis2dh12_from_fs8_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 16.0f;
}
float lis2dh12_from_fs16_nm_to_mg(int16_t lsb)
{
return ( (float)lsb / 64.0f ) * 48.0f;
}
You can see that if you insert your raw data inside these expressions, you will always get 25mg.
Regards
