Post Go back to editing

Kindly reply on Accelerometer queries asked multiple times earlier

Category: Hardware
Product Number: ADXL357

Hello      

We have asked the below query multiple times on this forum but no help is provided. Please help in proceeding further regarding this matter.

We have been using ADXL357 interfaced with STM32L562 Microcontroller. We are able to read and config the various registers of ADXL357 and read acceleration data in the X, Y and Z Data registers. We are unsure that we are obtaining the correct values or not. In other words, we wish an explanation on how to calculate 'g' value from these registers' data. Also, we need to know that how to calculate the threshold values of 'g' for this Accelerometer. We are calculating 'g' values from Raw data using below formula:

Vibration in 'g' = 20 bit Raw data * (1 / Sensitivity)

We have 3 same PCBs with us on which this Accelerometer is mounted and we are getting three completely different values on each board in steady state i.e. when PCBs are placed on table in no movement condition.

In our case, even if apply some vibrations  manually to the device, the raw data of each axis are same everytime. How to proceed further ?

Kindly help.

Parents
  •    

    Thank your for your reply.

    The equation mentioned by you for calculating Acceleration in 'g' will lead to a huge value. For e.g. the typical sensitivity corresponding to 10g test condition is 51200 LSB/g as mentioned in datasheet and raw data will be of 20 bit which will be obtained from FIFO. If we multiply them then this will give a large value which can't be 'g' definitely. Are you sure about the correctness of the equation you provided ? Please verify.

    I am providing the values which I obtained on two different PCBs in both conditions (Steady state and Vibrations by hands).

    1st PCB (Corresponding to 10g test value):

    Raw data of X-axis: 0x3DE9, Raw data of Y-axis: 0x610D, Raw data of Z-axis: 0x11401

    Sensitivity taken = 51200 LSB/g

    2nd PCB (Corresponding to 10g test value):

    Raw data of X-axis: 0xA002, Raw data of Y-axis: 0x3C01, Raw data of Z-axis: 0x12C01

    Sensitivity taken = 51200 LSB/g

    These readings are same and not changing during steady state as well as while shaking PCBs manually with hands.

    Below is our code for your observation:

    uint8_t Status_Reg_Read[] = {0x04};

    uint8_t Status_Reg_Read_Value[1];

    uint8_t Range_Cntrl_Reg_Value[] = {0x2C, 0x81};

    uint8_t Filter_Setting_Reg_Value[] = {0x28, 0x0A};

    uint8_t Power_Cntrl_Reg_Value[] = {0x2D, 0x00};

    uint8_t Self_Test_Reg_Value[] = {0x2E, 0x03};

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Status_Reg_Read, sizeof(Status_Reg_Read), 1000)==HAL_OK)

    {

    if( HAL_I2C_Master_Receive(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Status_Reg_Read_Value, sizeof(Status_Reg_Read_Value), 1000) == HAL_OK)

    {

    uint8_t data[] = "\r\nX-Axis \r\n";

    HAL_UART_Transmit (&huart1, data, sizeof (data), 10);

    printf("OK");

    }

     

    }

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Range_Cntrl_Reg_Value, sizeof(Range_Cntrl_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Filter_Setting_Reg_Value, sizeof(Filter_Setting_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    /////////////*****Power Control Register must be set at LAST after other Configuration registers*****//////////////////

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Power_Cntrl_Reg_Value, sizeof(Power_Cntrl_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Self_Test_Reg_Value, sizeof(Self_Test_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

Reply
  •    

    Thank your for your reply.

    The equation mentioned by you for calculating Acceleration in 'g' will lead to a huge value. For e.g. the typical sensitivity corresponding to 10g test condition is 51200 LSB/g as mentioned in datasheet and raw data will be of 20 bit which will be obtained from FIFO. If we multiply them then this will give a large value which can't be 'g' definitely. Are you sure about the correctness of the equation you provided ? Please verify.

    I am providing the values which I obtained on two different PCBs in both conditions (Steady state and Vibrations by hands).

    1st PCB (Corresponding to 10g test value):

    Raw data of X-axis: 0x3DE9, Raw data of Y-axis: 0x610D, Raw data of Z-axis: 0x11401

    Sensitivity taken = 51200 LSB/g

    2nd PCB (Corresponding to 10g test value):

    Raw data of X-axis: 0xA002, Raw data of Y-axis: 0x3C01, Raw data of Z-axis: 0x12C01

    Sensitivity taken = 51200 LSB/g

    These readings are same and not changing during steady state as well as while shaking PCBs manually with hands.

    Below is our code for your observation:

    uint8_t Status_Reg_Read[] = {0x04};

    uint8_t Status_Reg_Read_Value[1];

    uint8_t Range_Cntrl_Reg_Value[] = {0x2C, 0x81};

    uint8_t Filter_Setting_Reg_Value[] = {0x28, 0x0A};

    uint8_t Power_Cntrl_Reg_Value[] = {0x2D, 0x00};

    uint8_t Self_Test_Reg_Value[] = {0x2E, 0x03};

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Status_Reg_Read, sizeof(Status_Reg_Read), 1000)==HAL_OK)

    {

    if( HAL_I2C_Master_Receive(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Status_Reg_Read_Value, sizeof(Status_Reg_Read_Value), 1000) == HAL_OK)

    {

    uint8_t data[] = "\r\nX-Axis \r\n";

    HAL_UART_Transmit (&huart1, data, sizeof (data), 10);

    printf("OK");

    }

     

    }

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Range_Cntrl_Reg_Value, sizeof(Range_Cntrl_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Filter_Setting_Reg_Value, sizeof(Filter_Setting_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    /////////////*****Power Control Register must be set at LAST after other Configuration registers*****//////////////////

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Power_Cntrl_Reg_Value, sizeof(Power_Cntrl_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    if(HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)ACCMETER_IC_ADDRESS, (uint8_t *)Self_Test_Reg_Value, sizeof(Self_Test_Reg_Value), 1000)==HAL_OK)

    {

    printf("OK");

    }

Children
No Data