RAM
-button to upload the program to the watch. Bangle has both volatile RAM-memory as well as flash-memory for long-term storage. RAM content disappears after power-down, while content in flash remains. When testing and developing, it is safer to just upload to RAM as possible serious program crashes won’t mess up the watch that much as if you save to flash. That said, it is close to impossible to completely brick the watch with a buggy program, a factory reset should help in almost all cases.Collect Data
- collect data for different activitiesInference
- run inference to test the current ML-model without storing any further dataExercise
- run inference and also collect what activities were performed and the length of them into a CSV-fileCollect Data
on the watch, and select one of the predefined activities, scroll down to see more.Start Recording
.Storage
iconSave
icon for each activity file individually.(StorageFile)
-appendix that you’ll need to remove. So, rename acti_2024_10_29_20_03.csv (StorageFile)
to acti_2024_10_29_20_03.csv
.Data acquisition
CSV-Wizard
Choose File
, select any of your activity files, and click Upload file
Looks good, next
Yes, this is time-series data...
Each row contains a reading, and sensor values are columns.
Yes, it's <timestamp>
Time elapsed in milliseconds
80 ms
(the default accelerometer is 12.5 Hz which means one sample is 80 ms in length)Great, let's look at your values
Yes, it's <activity>
<x, y, z>
Next, split up into samples
Limit to <3040> ms
Use the last value of "activity" as the label for each sample...
Finish wizard
Create impulse
and configure the following settings:
Time-series data:
Window size 1,000 ms.
Window increase 500 ms.
Frequency (Hz) 12.5
Zero-pad data [x]
Raw data
as Processing block and Classification
as Learning block. As Bangle isn’t one of the officially supported devices, the other available blocks for accelerometer data would need to be developed in Espruino to work identically as the Edge Impulse ones. I actually tried to replicate the Spectral Analysis processing block, but was not successful.
Raw data
from the menu.Save parameters
Generate features
Classifier
from the menu.Number of training cycles 700
1st dense layer 30 neurons
2nd dense layer 15 neurons
3rd dense layer 8 neurons
Save & train
to start trainingModel testing
from the menu.Classify all
Dashboard
from the menu.Save
icon next to Tensorflow Lite (float32)
Storage
iconUpload files
impulse1
as file name and click Ok
.
impulse4
Inference
.Exercise
.exercise
+ timestamp when file created)