This is the instrument cluster app in Coda: a Qt6 application with C++ backend for the best performance possible and the sleekest drip. The main design inspiration was the instrument cluster of Tesla Model Y's.
The app is designed to be run on a custom Yocto distro on a Raspberry Pi 5. Note that the app's CMakeLists file has been modified since it depends on both libgpiod and a custom library for using libgpiod; both present in Coda's official meta layer here. You can simply utilise the created repo manifest to fetch everything related to the Cluster Node for you if you want to run it yourself.
- Light Control: interactive buttons for low, high, and fog beams.
- Speedometer: show the speed in the middle of the screen.
- Detected Road sign Displayed: With the Help of the AI ECU, the detected road sign is displayed on the cluster.
- Selected Gear: the selected gear is highlighted.
- Interactive Car Model: car animation that stops and moves depending on the current speed.
- Dark/Light Mode.
- Blinkers: interactive buttons for left and right blinkers.
- Clock.
- Ambient Temperature.
The design strategy was to create custom components for every element in the app. The main components present in the Main.qml are:
- FooterBar: contains ITI's logo, clock, and temperature.
- MainScreen: this is the frame that governs the rest of the components.
Inside MainScreen, these components are used:
- GearShiftBar: shows gears.
- LightControlBar: shows light beam controls.
- CarModel: shows the car animation.
- SpeedometerPlusSign: the frame that governs the components at the right hand side (except for the GearShiftBar).
Inside SpeedometerPlusSign, these components are used:
- Indicators: left and right blinkers.
- Speed: speed value + unit + road sign image.
- BottomLine: for styling.
There are 4 classes defined and used in the app:
- System: this is responsible for updating the clock.
- ReadingsCommPortal: this is responsible for fetching the readings sent by the CommManagerService via a Unix Domain Socket.
- LightControl: this is responsible for handling UI light beam buttons' clicks to set the value of certain GPIO pins accordingly.
- Indicators: similar to LightControl, this is responsible for handling blinkers' button clicks to set the value of certain GPIO pins accordingly.
Since Qt6 utilises CMake as its build tool instead of qmake, it made our lives much easier when modifying it. The following lines were added to make it build and link with the libraries with out issues, in addition to enabling the use of qrc files:
set(CMAKE_AUTORCC ON) find_package(PkgConfig REQUIRED)
pkg_check_modules(GPIOD REQUIRED libgpiod)
pkg_check_modules(GPIOHAL REQUIRED gpiohalrpi5)target_link_libraries(appInstrumentCluster
PRIVATE Qt6::Quick
PRIVATE Qt6::Core
PRIVATE ${GPIOD_LIBRARIES}
PRIVATE ${GPIOHAL_LIBRARIES}
)target_include_directories(appInstrumentCluster PRIVATE
${GPIOD_INCLUDE_DIRS}
${GPIOHAL_INCLUDE_DIRS}
)A python script was created to feed the app dummy data through the socket just to check the validity of the implemented logic

