This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 detect movement

Other Parts Discussed in Thread: BLE-STACK

Hi everybody, I'm new in development with accelerometer/gyroscope sensors.

I'm creating ann IOS Application that connect to a TI SensorTag and tries to detect movements of the sensor (sensor goes up/down, left/right, rotates, etc. etc.).

I'm googling every day searching for something like tutorial or code that could help me.

At this moment I tried to implement a simple version of Kalman Filter but I didn't succeded and I don't know if this is the right way for my purposes.

I would like to know how to calculate the roll/pitch/yaw values, reading the data from accelerometer and gyroscope.

Furthermore I noticed that the outputs of accelerometer and gyroscope continue to oscillate in a little interval of values also when my SensorTag is stable on the ground, so I can't be able to know when my sensor is really motionless.

Could you help me please?

Thanks

  • Hi Roberto,

    Have you checked if the accelerometer on the sensor tag already supports those functions? If so, you may not have to do fancy calculations on the sensor tag but simply setup the accelerometer to run roll/pitch etc. Check the datasheet.

    Regarding the small interval of values when still, I suggest you filter them OR you move to a place with a true constant gravitational constant :) 

    Best Regards

    Joakim

  • Hi, thanks for your reply! What do you mean when you asked me if I checked if the accelerometer already supports those functions? How can I investigate that?

    Moreover, could you tell me where I can find the datasheet, please?


    About small interval of values, how can I filter them? Could you help me with some idea? Please! Thanks again!

  • Hi Roberto,

    The Sensor Tag has it's own wiki page here: http://processors.wiki.ti.com/index.php/Bluetooth_SensorTag.

    The accelerometer is a KXTJ9 from Kionix and I quickly checked the datasheet and it seems like this particular component lacks the cool features you are looking for. Sorry for misguiding you.

    To filter values, you would have to check them in the HalAccRead function. If they are to small changes compared to the last values, simply don't update the stored values. They won't be sent over the air if you don't store them.

    Btw. I googled "KXTJ9 Datasheet" to find the datasheet.

    Best Regards

    Joakim

  • Hi, thanks for your help!

    Could you tell me how to access to HalAccRead function, please?

    At this moment I receive the values after connecting my app to the SensorTag.

    While the sensor is connected, I receive periodically(10 values per second) the values form the sensor and all these values are varying in a small interval also when my sensor is motionless.

    I didn't applied any filter to the values.

    for the roll/pitch/yaw angles I could use the gyroscope, maybe?


    Thanks again for your useful help.

  • Hi,

    1. Download and Install BLE Stack (www.ti.com/ble-stack)
    2. Obtain IAR Embedded Workbench for 8051 v8.20
    3. Open Sensor Tag project: C:\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\SensorTag\CC2541DB
    4. Open hal_acc.c (It's available in the project workspace: HAL->Target->Includes)
    5. Function HalAccRead starts at line 213

    Best Regards

    Joakim Lindh

  • Hi,

    I would like to know if there was anyone who was able to implement a roll/pitch/yaw functionality on the sensortag.

    Roll&pitch can be derived from the accelerometer but yaw cannot and I believe it requires sensor fusion integrating gyroscope with magnetometer data.

    For instance, if the sensortag is laying down, if we rotate it along a vertical up and down Z axis, I'd like to see the numbers go from 0-360 similar to a compass.  I've implemented a complimentary filter, but it still doesn't seem to provide a 0-360 type of measurement.

    Is anyone familiar with what is required to accomplish this?