Digital Dash — High-Level Design
1. Overview
The Baja dashboard gives the driver a clear view of vehicle speed, engine RPM, and important warnings. It needs to be readable in sunlight, work without Internet access, and handle rough terrain and power interruptions. If a sensor or connection stops working, the display must make that clear instead of showing an old reading as though it is current.
This document compares two options:
- Raspberry Pi with C/Raylib: a Pi reads the sensors and draws the dashboard on a separate screen.
- Amazon Fire tablet with Flutter: an ESP32 reads the sensors and sends the readings to an Android app over Bluetooth or Wi-Fi.
The recommended starting point is to test the Fire tablet with an ESP32 over Wi-Fi. This combines the screen, computer, touch controls, and battery in one device. Bluetooth Low Energy (BLE) is another connection option to test. Keep the Pi design as an alternative until the tablet has passed tests for readability, charging, temperature, mounting, and connection recovery. The final choice should depend on those results and the total installed cost.
2. Main design idea
Separate reading the sensors from drawing the dashboard. Sensor readings must continue at the correct rate even if the screen slows down or the wireless connection drops.
For the Pi option, one part of the program reads sensors while another draws the screen. For the tablet option, the ESP32 reads sensors and the Flutter app draws the screen. Both designs use the same definitions for values, units, error states, and how old a reading can be before it is no longer useful.
Speed and RPM are the main driver readings. Temperature and supply voltage can be added where the vehicle has suitable sensors. Wheel circumference, pulses per revolution, gauge ranges, and warning limits must be checked with the vehicle team.
3. What the system needs to do
Before a run, a team member turns on the dashboard and checks that the correct vehicle is connected and its sensors are working. During the run, the driver should not need to pair devices, select a network, or navigate setup menus. Speed and RPM should remain easy to see. Warnings should use words or symbols as well as color.
The first version includes live readings, sensor and connection status, warnings, and a local log for troubleshooting. Telemetry simply means the sensor readings sent from the vehicle electronics to the display. The dashboard displays information; it does not control the engine or replace the vehicle’s safety circuits. Pit monitoring and cloud services can be considered later.
Initial performance targets
These are starting targets to test, rather than results already achieved.
| Requirement | Target | How to check it |
|---|---|---|
| Reading updates | Send speed and RPM 20 times per second. Update temperature and voltage 1–5 times per second. | Measure the time between updates while the full system is running. |
| Display delay | Show a new speed or RPM reading within 150 ms for at least 95% of updates. | Apply a known signal and compare it with the screen using a timed recording. |
| Old readings | Mark speed or RPM as out of date after 500 ms without a new measurement. Show a disconnected warning after 2 seconds without valid messages. | Stop sensor updates and interrupt the wireless connection separately. |
| Screen refresh | At least 30 frames per second; aim for 60 if practical. | Measure frame rate with logging and warnings enabled. |
| Startup | Show the dashboard within 30 seconds of power-on. Show live readings within 5 seconds once both devices and their connection are ready. | Repeat startup with no Internet connection. |
| Reconnection | Return to live readings within 5 seconds after the connection becomes available again. | Restart the ESP32, interrupt the connection, and close/reopen the app. |
| Long run | Run for four hours without a crash, steadily increasing memory use, or old readings shown as live. | Test in the vehicle and review the log. |
| Driver use | Readings and warnings are clear in sunlight, with a helmet and gloves. | Have drivers test the installed display. |
Sending 20 updates per second does not mean checking a pulse sensor only 20 times per second. The sensor-reading hardware or software must capture every pulse at the highest expected wheel and engine speeds.
4. Overall system layout
The system reads sensor signals, converts them into useful values, checks them, and displays them. A snapshot is one message containing the latest readings and their status. The display checks both the values and their age before showing them.
flowchart LR
S[Vehicle sensors] --> P[Input protection and signal conditioning]
P --> A[Read sensors and apply calibration]
A --> T[Message with readings and status]
T --> R[Receive and check message]
R --> M[Store latest readings and their age]
M --> D[Display gauges and warnings]
R --> L[Save troubleshooting log]
Input protection keeps sensor voltages and electrical noise from damaging the Pi or ESP32. Signal conditioning turns the sensor output into a signal the electronics can read reliably. Calibration converts that signal into the correct engineering units.
5. Option A — Raspberry Pi with C/Raylib
The Pi runs a C program that uses Raylib to draw the dashboard on a separate screen. Digital sensors connect through protected GPIO inputs. Analog sensors, such as some temperature sensors, need an analog-to-digital converter (ADC) because the Pi cannot read analog voltages directly through its GPIO pins.
A separate sensor-reading task captures wheel and engine pulses. It records the time of each pulse or uses a hardware counter, rather than checking the input once per screen frame. It then calculates speed and RPM and passes the latest values to the drawing code. Timing should use a clock that measures elapsed time and is unaffected by changes to the system’s date and time.
flowchart TB
S[Wheel, engine, and health sensors] --> C[Protected inputs and ADC if needed]
subgraph PI[Raspberry Pi]
C --> A[Separate sensor-reading task]
A --> N[Calculate values and check sensor status]
N --> Q[Latest readings]
E[Optional receiver for ESP32 data] --> Q
Q --> R[Raylib drawing loop]
Q --> L[Troubleshooting log]
W[Service that restarts a crashed app] --> R
end
R --> D[Separate dashboard screen]
The Pi could also receive readings from an ESP32 instead of reading sensors directly. This would let it use the same sensor hardware as the tablet. For each reading, choose one source so the program does not accidentally mix values from two sources.
The software needs to handle failed GPIO setup, failed reads, and missing sensor updates. The speed calculation must also return to zero when the wheel stops. Any startup gauge sweep should be clearly marked as a self-test. Game screens and simulated readings should be disabled in the version used during a race.
The team must also set up automatic startup, a service that restarts the program after a crash, and a repeatable build using known library versions. Fonts and images should load correctly without depending on which folder the program starts from.
The main benefit is control: the team controls the hardware, operating system, and startup behavior. The main drawback is the number of separate parts to mount and power. The total cost includes the Pi, screen, storage, power supply, wiring, enclosure, and a way to handle power loss without damaging stored files.
6. Option B — Fire tablet with Flutter and ESP32
The ESP32 reads the sensors, calculates the values, and sends them to the tablet. It keeps reading sensors even when the tablet is disconnected. The Flutter app checks incoming messages, stores the latest readings, and draws the gauges and warnings.
The app should keep the connection code separate from the display code. A Wi-Fi receiver and a Bluetooth receiver can then produce the same data format for the rest of the app. Use one connection method at a time for the first version.
flowchart TB
S[Vehicle sensors] --> P[Input protection]
subgraph ESP[ESP32 sensor controller]
direction TB
A[Read sensors] --> C[Calculate speed, RPM and health values]
C --> T[Send latest readings and sensor status]
end
P --> A
T --> W[Wi-Fi or Bluetooth]
subgraph TAB[Fire tablet — Flutter app]
direction TB
R[Receive and check messages] --> M[Store readings and check their age]
M --> D[Display gauges and warnings]
R --> L[Save troubleshooting log]
end
W --> R
The exact Fire tablet model and operating system need to be chosen early. Fire OS supports Android apps, but Flutter libraries and device permissions still need to be tested on that tablet. Libraries that depend on Google Play services may need alternatives. See Amazon’s Fire tablet guidance and Android app compatibility guidance.
The app runs full-screen in landscape and keeps the screen awake during a run. If the app is paused or the tablet sleeps, it checks the connection and waits for new readings before returning to the live display. Test automatic startup and recovery on the actual device. Installing the app does not guarantee that it will launch automatically after power-on.
Wi-Fi option
The ESP32 creates its own Wi-Fi network, and the tablet joins it. No router or Internet connection is needed. The app connects to a known local address and opens a WebSocket, which keeps a connection open so the ESP32 can send readings as they are ready.
When connecting, the devices exchange their identity, message-format version, software version, and calibration information. This helps prevent the tablet from displaying readings from the wrong vehicle or using a message format it does not understand.
Wi-Fi is a useful starting point because its messages are easy to inspect during development. Test that the tablet stays connected even when the network has no Internet access. Give each vehicle its own network password, and have the app verify the sensor unit it connects to.
Bluetooth option
Use Bluetooth Low Energy (BLE) as the Bluetooth candidate. The ESP32 provides a data service, and the tablet subscribes to updates. This avoids joining a separate Wi-Fi network, but device discovery, permissions, pairing, and reconnection still need testing.
BLE sends small messages, so its data may need a more compact format than Wi-Fi. If a reading message is split into several pieces, the receiver must check that all pieces belong together and discard incomplete messages after a short timeout. Test that it can deliver the required 20 updates per second.
Bluetooth Classic and BLE are different technologies. Support depends on the exact ESP32 model, so check the Espressif Bluetooth documentation before selecting a board. Test Wi-Fi and BLE separately before considering automatic switching between them.
7. Data format and update flow
Both options should use clear, agreed definitions for the data. Each message contains the latest readings along with enough information to check where they came from and whether they are usable.
| Message information | Purpose |
|---|---|
| Format version | Lets the receiver check whether it understands the message. |
| Device ID | Identifies the vehicle’s sensor unit. |
| Restart ID | Changes when the ESP32 restarts, so the app can recognize a new run of its software. |
| Message number | Helps detect missing, repeated, or out-of-order messages. |
| Measurement timing | Shows when readings were taken and how old each one is. |
| Calibration version | Records which calibration settings produced the readings. |
| Reading and status | Gives each value, its unit, and whether the sensor is working. |
Use km/h for speed, RPM for engine speed, degrees Celsius for temperature, and volts for supply voltage. A missing reading should be marked unavailable. It must not become zero by default, because zero may be a valid measurement.
Wi-Fi can start with JSON, a text format that is easy to read while debugging. BLE can use a smaller binary format with the same information. In both cases, check message size, required fields, supported versions, and sensible values. A broken message should be rejected without crashing the app or making an old reading appear fresh.
Keep only the latest readings for the live display. If the connection falls behind, discard older queued updates instead of replaying them to the driver. Store historical readings separately in the log.
Checking freshness requires more than knowing when a message arrived. The ESP32 should report the age of each measurement so the app can detect a sensor that has stopped updating while the connection still works. The app also measures how long it has been since a valid message arrived. The devices have separate clocks, so their timestamps cannot simply be subtracted. Connection setup should establish how their elapsed-time clocks compare and how accurate that comparison is. If message delay cannot be kept within the allowed limit, show readings as unavailable and reconnect.
sequenceDiagram
participant S as Sensors
participant E as ESP32
participant T as Tablet connection code
participant M as Latest readings
participant U as Dashboard
S->>E: Sensor pulses and measurements
T->>E: Connect and request device information
E-->>T: Identity, format version, calibration, timing
T->>T: Check that the device and format are correct
loop Send updates 20 times per second
E-->>T: Readings, sensor status, age, message number
T->>M: Store checked readings
M->>U: Update gauges and warnings
end
Note over M,U: Keep checking reading age between messages
T--xE: Connection lost
M->>U: Mark old readings unavailable and show warning
T->>E: Try to reconnect
E-->>T: Device information and new readings
T->>M: Resume live display after checking data
8. Fault handling and maintenance
The dashboard starts with Waiting for data. It enters Live only after receiving valid, current readings. If one sensor fails, mark that reading unavailable while continuing to show the others. If the whole connection fails, show a clear disconnected warning. Reconnecting alone is not enough to clear the warning: new readings must arrive first.
stateDiagram-v2
[*] --> Starting
Starting --> Waiting: Screen ready
Waiting --> Live: Valid current readings received
Live --> Degraded: A reading is old or invalid
Degraded --> Live: Readings valid again
Live --> Disconnected: No valid messages for 2 seconds
Degraded --> Disconnected: No valid messages for 2 seconds
Disconnected --> Waiting: Connection restored
Waiting --> Incompatible: Wrong device or unsupported message format
Incompatible --> Waiting: Connection or software corrected
A wheel sensor with no pulses could mean the car has stopped, rather than that the sensor has failed. Choose a no-pulse timeout based on wheel size and pulses per revolution. Below the speed that can be measured reliably, show zero. If the circuit cannot distinguish a disconnected sensor from a stationary wheel, document that limitation. Apply the same reasoning to RPM.
Temperature and voltage warnings should not flicker on and off near a limit. Require the condition to last briefly, and use a slightly different threshold to clear the warning. For example, a temperature warning could turn on above one limit and clear only after the temperature falls below a lower limit. The powertrain and electrical teams choose the actual values.
The log should record readings, sensor errors, connection losses, software versions, and calibration settings. Give logs a fixed storage limit and replace the oldest files when that limit is reached. Logging problems should not stop the live display. As a rough estimate, 256 bytes per update at 20 updates per second uses about 18.4 MB per hour before file and connection overhead.
Both designs need protected, regulated power, secure connectors, and supported wiring so vibration does not pull on the connections. The Pi needs a safe shutdown or another way to protect its storage during power loss. The tablet needs enough charging power to run continuously at the required brightness without overheating or draining its battery. Its battery may keep the screen on during a power interruption, but readings will still stop if the ESP32 loses power.
Test the complete installed system for vibration, sunlight, heat, dust, and water exposure. Keep pairing and settings changes outside race mode. Record software and calibration versions, and keep the previous working software available so the team can restore it if an update causes problems.
9. Comparing the options
| Factor | Pi + Raylib | Fire tablet + Flutter + ESP32 |
|---|---|---|
| Main hardware | Pi, separate screen, storage, power supply, and enclosure. | Tablet, ESP32, power supply, and mount. |
| Sensor readings | Read directly on the Pi, or optionally receive from an ESP32. | ESP32 reads sensors and sends values wirelessly. |
| Startup | Team controls the Pi’s operating system and automatic startup. | Must test how the tablet starts and resumes the app. |
| Main concerns | Power loss, storage, wiring, and reliable pulse capture. | Wireless connection, app sleep/resume, charging, sunlight, and heat. |
| Team skills | C, Linux, and hardware integration. | Dart/Flutter, Android, and ESP32 programming. |
| Cost | Include the screen, enclosure, wiring, power supply, and spares. | Include the ESP32, mount, wiring, power supply, and spares. |
Start by testing the tablet, but do not choose it based on the tablet price alone. Compare the cost and reliability of the complete installed systems. Use the Pi if the tablet cannot meet the display, charging, startup, or connection requirements. After testing, choose one main system for the vehicle so the team does not have to maintain two race-ready versions.
10. Build and test plan
- Choose the hardware and settings. Confirm the tablet model, Pi and screen, ESP32 board, sensors, wiring, and power requirements. Check wheel circumference, pulse counts, gauge ranges, and warning limits.
- Check sensor measurements. Apply known pulse frequencies and voltages. Verify speed, RPM, calibration, stopped-wheel behavior, and readings at the highest expected speeds.
- Build a complete Wi-Fi path. Send ESP32 readings to the Flutter app and display them at 20 updates per second. Use clearly labeled simulated data when real sensors are unavailable during development.
- Test faults. Send broken, repeated, delayed, and out-of-order messages. Stop sensor updates, restart the ESP32, interrupt power, close the app, and fill log storage. Check that old readings are never shown as live.
- Compare connection and display options. Test BLE and compare it with Wi-Fi for update delay, reconnection, power use, and development effort. Run the same driver tests on the Pi where needed to decide between platforms.
- Test in the vehicle. Check sunlight readability, cold startup, mounting, vibration, charging, and heat. Complete the four-hour run and record which requirements passed.
- Prepare for handover. Save the tested software and settings. Document wiring, installation, startup, troubleshooting, and how to restore the previous version. Have drivers and the electrical and mechanical leads approve their parts of the system.
11. Decisions still needed
| Decision | Responsible team member | When needed |
|---|---|---|
| Tablet model, operating system, and startup method | Dashboard software lead | Before choosing the final platform. |
| ESP32 model, sensor interfaces, and calibration | Electrical lead | Before finalizing sensor hardware and firmware. |
| Required readings and warning limits | Electrical and powertrain leads | Before driver testing. |
| Wi-Fi or BLE for the vehicle | Dashboard software lead | After testing both connections. |
| Enclosure, mount, and environmental protection | Mechanical lead and drivers | Before using the system in a race. |
| Total installed cost, spares, and power-loss handling | Electrical and mechanical leads | Before final hardware purchases. |
Appendix — Technical references
- Raylib dashboard: C/Raylib display and Raspberry Pi sensor integration.
- Amazon Fire tablet development: developing apps for Fire tablets.
- Porting Android apps to Fire OS: checking Android app compatibility.
- ESP32 Bluetooth architecture: Bluetooth support across ESP32 models.