Raspberry Pi Pico W (https://www.raspberrypi.com/products/raspberry-pi-pico/) GPS module (https://www.adafruit.com/product/746)
Pico
Pico | GPS Module | |
---|---|---|
6 - TX | RX | Using UART1 on the Pico |
7 - RX | TX | |
36 - +3.3V | VIN | |
18 - GND | GND |
For ease if viewing, a screen with a minumum width of 4" is required but I've had trouble finding a good screen in that size. I ordered on of these 2.42" OLED screens in white to experiment with.
Micropython library: https://github.com/rdagger/micropython-ssd1309
Handlebar switch We could repurpose the Checkmate switch (https://www.icoracing.com/collections/checkmate-products/products/checkmate-thumb-switch) or opt for cheaper option like this one from Lithuania (https://www.ebay.com/itm/115052979147) or an even cheaper option like this (https://www.ebay.com/itm/184490093751?var=692193959146).
Added 3 buttons for command and control on the breadboard.
We have the option of wiring up the bikes existing front wheel speed sensor or adding another sensor. Alternatively we can add a GPS module and rely soley on GPS. They each have their pros and cons nicely outlined in this article (https://www.icoracing.com/pages/why-gps-is-so-wrong-for-measuring-distance-travelled).
Battery or wiring into bikes electrical system. Initially, we will rely on battery power as it is simpler and eliminates the problem of noise from the bikes electrical system. Use Pololu powerswitch to turn device on and off
Once we have all of the hardware in hand and wired up, we will design a case for it and print it using our 3d printer.
- Modes: -- Ride --- Reset (Clear distance and time) --- Start time --- Stop time -- Circuit --- Reset (Clear distance and time) --- Start time --- Stop time --- Mark lap -- Enduro
- Configuration: Setup wheel speed sensor, Upload route sheet
- GPS polling
- Polling for switches
- Track distance traveled
- Render current screen
- Webserver with self-hosted WIFI access point - To be used for uploading configuration and route sheets
- GPS module - Read GPS module and set GPS data for access from the main application
- Only fleshed out the "Ride" mode currently. Still need to work on the more advanced "Circuit Race" and "Enduro Race" modes
- Each mode will have the following: -- A list of informational screens that can be cycled through -- A list of actions and the button combinations to activate them
- The main menu will be a finite state machine (FSM)
- Each mode will have its own more detailed state diagram and FSM within the application
- GPS read task is blocking
https://github.com/nauticalcoder/dirt-tracker/issues