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 C
. 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
A link to Upverter Design for schematic and PCB layout.
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 and uses probe-run for board flashing and debugging via RTT logging.
Firmware TODO List
- Stream quaternions via USB virtual serial port
- Port to RTIC v6
- 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.)
- Bluetooth functionality
- Integrate with BLE support from stm32wb55 crate
-
async/.await
BLE- Powered by
embassy
- Powered by
- BLE
- Stream quaternions via GATT service with one characteristic
- Stream accelerometer and gyroscope data
- Battery Level service
- Device Info Service
- Cleanup
static mut
andunsafe
code- Use async mutex for shared resources
- PMIC
- Implement battery gas gauge via built-in coulomb counters
- Flash RGB LED instead of simple on/off
- Simple flash
- PWM effects
- Optimize power consumption and use low-power modes
- Fix debugging/RTT in sleep mode
- Enter Low-Power mode in async executor loop
- Detect when device is IDLE and scale down the IMU frequency
- Sleep instead of busy-waiting for the PMIC interrupt on the very first start (battery just plugged)