element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sudden Impact Wearables Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sudden Impact Wearables Design Challenge
  • More
  • Cancel
Sudden Impact Wearables Design Challenge
Blog Skier impact monitor 10 - RRD storage
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: hlipka
  • Date Created: 9 Mar 2015 11:42 PM Date Created
  • Views 421 views
  • Likes 0 likes
  • Comments 0 comments
  • impact_skiers
  • sudden_impact
Related
Recommended

Skier impact monitor 10 - RRD storage

hlipka
hlipka
9 Mar 2015

(Complete list of all blog entries in this series)

After getting the ADXL375 to run, I needed to work on storing the acceleration history. In my test project I configured the accelerometer to use a 12.5Hz data rate since that allowed to write the measured data directly to the LCD. But for my use case I need a much better resolution (the head injury criterion integrates the acceleration over a period about about 15ms, so I need at least 1ms resolution).

So I set the data rate to 1600Hz - this gives good time resolution, and even uses less power than the 800Hz data rate (but it reduces the resolution since the LSB is always 0 now). The FIFO is 32 values deep, and the notification watermark (which generates an interrupt signal) is set to 24. This way I can always read 24 values in one go and process them - that's data for exactly 15ms (which is the recommended time period).

Each time the ADXL375 triggers a high watermark interrupt, the PSoC4 reads 24 values (which are guaranteed to be there) and calculates the length of the acceleration vector. Since the ADXL needs some time to prepare the next values to be read from the FIFO, it can be used for calculation.

Together with the last 24 calculated acceleration values, the PSoC now can calculate the 24 integrals (by just summing up the values). From these integrals it calculates the maximum. It also calculates the average acceleration value, and sums it up.

Once per second another interrupt is triggered, which takes the data from the last elapsed second, and stores it away (maximum of the integrated values, maximum measured acceleration, average acceleration). If values for 60 seconds have been collected, they are aggregated again and stored per minute. This RRD structure allows to get historical data while still having.

Right now I'm just using the collected values to show average and maximum acceleration for the last second the the last minute on the LCD.

Next steps

Since the RRD storage code now works fine, I can move it to the BLE project and use it to transfer it to the Android app. I also got another LiIon battery. Its much smaller than the one I have now, even though it still has 380mAh capacity. But this is something for the next hardware update.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube