The PCB can be configured in various ways to meet project needs. Some examples include:
Bare Bones: PCB requires Teensy headers, primary connector, buttons and button filtering, power management circuitry and input filtering to be bridged. It would also be recommended to include the USB connector and switch to allow the external case USB port to be used.
BLE Minimal: Same as bare bones but with the nRF52832 BLE module added to allow communication with the browser app. Not required for logging but helpful to check sensors and communicate with the device.
GPS Minimal: Same as bare bones but with the addition of an Adafruit Ultimate GPS module for position logging
Complete: All of the above. Input filters can be set if needed or bridge for direct analog input.
Firmware must be configured to match the device setup. If not using GPS or adding other sensors the main.cpp and SDLog.cpp files should be changed as needed to provide setup and logging for the devices.
Recommended to use VSCode and PlatformIO for programming. Arduino can be used but requires very careful library management. The MTP libraries in particular are very fragile.
The main device loop used a state based approach. States include:
0 - Poll sensors and stream constant updates to a connected Web App instance. There is both a fast (BLEUpdate) and slow (BLEUpdateSlow) method to stream sensors at different rates. Note that only the linear sensors really require the fast refresh in order to provide real-time visualization.
1 - USB storage emulation. Can access the files on the device SD card (READ ONLY, no delete or add).
2 - Logging mode. Will create a file and log continuously until the state is exited by a button trigger.
3 - File streaming test.
4 - Testing state to stream any data required to the WebApp console.
States can be changed by sending SC<STATE_NUM> (e.g. "SC1")
to the device over BLE from the web app.
Is programmed entirely separate to the Teensy. For basic operation the Adafruit nRF52832 Feather firmware with Serial bridging should be flashed. https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/software-resources.
To load device firmware after assembly see https://github.com/adafruit/Adafruit_nRF52_Arduino
Install dependencies then:
- Select Tools > Board > Adafruit Feather nRF52840 Express
- Select Tools > Programmer > J-Link for Feather52
- Select Tools > Burn Bootloader with the board and J-Link connected
Firmware can be programmed using standard Arduino and loaded over a USB to Serial Bridge such as:
https://www.adafruit.com/product/3309
Connections can all be made to the Teensy headers and are:
PIN 36 - Jumper to 3.3V pin to power the device on
PIN 35 - TX on USB Serial device
PIN 34 - RX on USB Serial device
PIN 33 - DTR Reset on USB Serial device.
GND - GND to USB Serial device
The visualization software is a Vue3 based web app that used the WebBluetooth API. WebBluetooth currently has very limited browser support but is supported by Chrome(not iOS), Edge, and ConnectBrowser(iOS).
Data processing required a local server to running on port 5000 for processing the CSV files.
The Web App can be self hosted, run locally, or accessed at https://data.syn.bike. The app is setup as PWA to allow offline usage once cached.
npm install
npm run serve
A small flask server is used to allow Python scientific stack processing of the CSV file. The connection is handled via a socket.io connection to allow the file to be sent once and then provide continuous updates as the range selection window is changed. There is two primary functions that handle the signal processing:
- process_data: handles peak finding, speed calculation, and other full vector calculations. Is only run once for each data file.
- process_histograms: gets histogram results from the processed data. Is run everytime the selected range is changed.
pip install -r requirements.txt
py server.py
Input CSV must be in the following order for correct processing:
Sample Time | Front Raw | Rear Raw | Lat | Long | Speed |
---|---|---|---|---|---|
UInt | UInt | UInt | Float | Float | Float |
The CSV should not have a header row.