I want to use only accelerometer data with 100 hz sample rate to monitor vibration of a pump.
is it possible to set sample rate to 100 hz?
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.
I want to use only accelerometer data with 100 hz sample rate to monitor vibration of a pump.
is it possible to set sample rate to 100 hz?
You can use accelerometer at 100Hz.
As mentioned in KXTj9 data sheet you need to write 111 to least 3 bits(LSBs) of control register 2 (i2c add = 0x1D).
Just modify it into driver code.
Hello Sedef,
Try to change the interval in sensorAccPeriod and see if that works.
The accelerometer read is scheduled in line 586 in the SensorTag.c source file:
readAccData();
osal_start_timerEx( sensorTag_TaskID, ST_ACCELEROMETER_SENSOR_EVT, sensorAccPeriod );
Hi Eirik,
Your answer is correct but I have one doubt here.
We can change sensorAccPeriod to change polling interval but what about sensor's own frequency?
I guess Sedef , he needs to do both changes. One to change frequency of accelerometer to 100Hz and another to change polling interval. Right?
Please correct me if I am wrong.
Hi Eirik
I am a mechanical engineer and new to programming in general.
I have gone through the User Guide and documentations but GATT Sensor Tag Attribute table confuses me.
It states Accelerometer Period lower limit as 100 ms.
Another thing is do I need to purchase CC Debugger for custom firmware?
Thanks
Hi Maulik,
I have gone through Kionix Accelerometer data sheet and it looks I can achive desired 100Hz sample rate.
But I am confused about polling interval.
Since I am not an expert on programming, I want to understand if Sensor Tag is suitable for monitor pump vibration.
Hi Sedef,
There are two points here to achieve your desired functionality
1. You need to enable physical sensor to sample data at 100 HZ. It means accelerometer will sample data at 100 Hz which we can set through control register 2. Now Once sensor has sampled data, firmware needs to read it at regular interval.
2. This interval should also be 100 Hz , since you need to get sample rate = 100Hz. This is called polling interval when firmware polls physical sensor for data. This you can change from Sensor tag service.
If you change polling interval to 100 but your sensor generates data at 10hz then you'll read old data which may not give accurate results. That's why I was telling you to change sampling rate from control register.
Hope this will give you clear picture.
Hi Sedef,
Similar to your problem, I would like to use the SensorTag with accelerometer update reates higher than the currently supported default limitation of 10Hz.
As I am not very familiar with firmware development, do you think you could provide your solution to me?
thanks,
kate
Hi Sedef,
I'm an engineering student from France, and I also need to sample and retrieve accelerometer data from the SensorTag at 100Hz (while I'm currently stuck at 10Hz) for an academic project. Unfortunately, I don't have a license for IAR Workbench and the demo version don't allow me to compile the firmware, although I made the right changes. So if you managed to upgrade the firmware with the accelerometer related changes, could you please send me your firmware? That would help me a lot!
Thanks,
BM
Hi Baptiste,
I could not upgrade the firmware myself either. Sorry cant help.
Maybe somebody from TI helps you. Good luck.
Thanks for your answer ! It's shame TI did not design the tools to take advantage of all the sensor tag possibilities. I think they totally missed the point ; why sell a product for tech hobbyists and encourage them to innovate on this structure without giving them a chance to put their hands on it ? Anyway, thank you for your prompt answer.
BM
Have you checked following github link?
maybe one of those guys can help.
https://github.com/search?q=sensortag&ref=cmdform
Hi Maulik Vaghela,
Where can I edit the ctrl_reg_2 ? Is "HAL/Target/Drivers/hal_acc.c" the right file? Or what do you mean by "driver code"?
Thanks a lot.