Skip to content
/ tracksb Public

A DIY, IMU-based skateboard activity tracker

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

eupn/tracksb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tracksb

A DIY, IMU-based skateboard activity tracker. The idea is to come up with algorithms to track activity during skateboarding sessions.

A companion mobile app could be used to get useful insights into the session.


Board

The current revision is D. It uses:

  • STM32WB55 (hal) as a Cortex-M4F + Bluetooth (BLE) microcontroller
  • BNO08x (driver) as an all-in-one IMU with an accelerometer, gyroscope and magnetometer together with a built-in sensor fusion algorithm
  • AXP173 (driver) as a Li-Po battery charging, power-path and gas gauge controller
  • Type-C USB Port for charging & optional USB data/DFU
  • SOICbite programming port suitable for fast and convenient programming & debugging of the device firmware with a standard SOIC-8 clip
Revision D board picture

Revision D PCB picture

A link to Upverter Design rev. D for schematic and PCB layout.

Device System Diagram

Device System Diagram

Firmware

Firmware is written in Rust, currently it's very minimal and can't do much. It can be found in firmware directory.

It's built with RTIC, embassy and uses probe-run for board flashing and debugging via RTT logging.

Firmware TODO List

Here are some stuff that should be done or improved, in no particular order.

  • Validate and fix IMU axes and quaternion data
  • Use interrupts for communication with PMIC and IMU
    • Poll IMU via interrupt
    • Use interrupt for PMIC status updates (charging, button, etc.)
    • async/.await for interrupts
  • Use async I/O for I2C comm with PMIC & IMU
    • async DMA I2C
  • Bluetooth features
    • Integrate BLE support from stm32wb55 crate
    • async/.await BLE
    • BLE
      • Stream quaternions via GATT service with one characteristic
      • Stream accelerometer and gyroscope data
      • Battery level service
        • Fix race condition against PMIC (access PMIC exclusively from one task?)
        • Fix being locked on BLE mutex if there's no motion data events (IMU disabled)
      • Device Info Service
    • Cleanup static mut and unsafe code
  • PMIC
    • Implement battery gas gauge via built-in coulomb counters
  • Flash RGB LED instead of simple on/off
    • Simple flash
    • Red light on HardFault
    • PWM effects
  • Optimize power consumption and use low-power modes
    • Fix debugging/RTT in sleep mode
    • LPTIM-based delays instead of dumb loops
    • Enter Low-Power mode in async executor loop
    • Detect when device is IDLE and scale down the IMU frequency
    • Asynchronously wait for the PMIC to appear on I2C bus on the very first start (battery just plugged)
      • Async I2C retry
      • Wait for PWROK interrupt
  • Non-Volatile Logging

Software

  • A BLE client for PC that logs received data is here
  • A Processing sketch that visualise data is here

Device and board orientation

Intended axes orientation and position of the device

Board and device orientation

About

A DIY, IMU-based skateboard activity tracker

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published