A simulated automotive system featuring a Digital Instrument Cluster (IPC) and Vehicle Control Unit (VCU) for electric vehicles, built on Raspberry Pi and STM32 with CAN bus communication. The VCU centrally manages vehicle states and I/O configurations, while ECU nodes (STM32-based) run identical firmware for scalability and flexibility. This project demonstrates a zonal E/E architecture, HMI design adhering to ISO 2575 and ISO 26262 principles, and CAN networking for real-time data exchange.
- Digital HMI: Qt/QML-based interface displaying speed, battery level, odometer, trip distance, external temperature, gear position (P/R/N/D), and tell-tales (e.g., turn signals, high/low beam, hazard lights) compliant with ISO 2575.
- Vehicle State Management: VCU handles states like Off, Charging, and Driving, processing data from simulated ECUs.
- CAN Bus Communication: Structured CAN protocol (29-bit IDs) for reliable data exchange between VCU (Raspberry Pi) and ECU nodes (STM32), supporting up to 64 digital inputs/outputs and 32 analog inputs per ECU.
- Dynamic I/O Configuration: Flexible I/O mapping via JSON files, allowing runtime reconfiguration without code changes (e.g., mapping inputs like turn signals to outputs like LEDs).
- Real-Time Processing: Low-latency data handling with ADC reading via DMA, FIFO queues for CAN frames, and signal-slot mechanisms in Qt.
- Scalability: Zonal architecture supporting multiple ECU nodes; tested for stability under varying bus loads.
- Algorithms: Battery percentage calculation based on energy consumption; Distance-to-Empty (DTE) estimation blending short-term and long-term consumption data.
- Raspberry Pi 5 (4GB RAM, 4-core 2.4GHz CPU)
- STM32F103C8 (ARM Cortex-M3, 72MHz, with CAN transceiver SN65HVD230)
- USB to CAN adapter (e.g., Makerbase CANable v1.0) for Raspberry Pi
- Waveshare 7-inch HDMI Capacitive Touch Screen LCD (1024×600) for IPC
- Inputs: Potentiometer (speed simulation), temperature sensor, switches/buttons (turn signals, beams, hazard, gear)
- Outputs: LEDs (lights, indicators), buzzer
- Linux OS (custom Yocto image recommended)
- Qt 5 with Qt Creator for HMI development
- STM32CubeIDE for ECU firmware
- SocketCAN for Linux CAN communication
- GCC cross-compiler for ARM
- Yocto Project for building custom Raspberry Pi images
-
Clone the repository:
git clone https://github.com/Tdieney/VCU_Cluster_System.git cd VCU_Cluster_System -
Set up Raspberry Pi 5 (VCU):
Follow Build image for Raspberry Pi 5 to create a Yocto-based Linux image with Qt and SocketCAN support. -
Set up STM32 (ECU Nodes):
See ECU Nodes for firmware flashing, CubeMX configuration (CAN at 1Mbps, GPIO mappings), and hardware wiring. -
Build VCU Software:
See VCU software overview for building the Qt application, including CAN handler integration and JSON config loading. -
3D Printed Case:
Refer to hardware/README.md for 3D-printed case STL files, wiring diagrams, and setup images (e.g., CAN bus connections with 120 Ohm resistors).
- Flash and power up the STM32 ECU nodes; connect via CAN bus.
- Attach sensors and outputs as per the pin mappings in ecu_nodes/README.md.
- Launch the system: The HMI will display real-time data (e.g., speed from potentiometer via CAN). Interact via switches to toggle lights and observe UI updates.
- Configure I/O: Edit
io_configs/io_config.jsonfor custom mappings (e.g., assign "turn_left_switch" to a new index) and reload the VCU app. - Monitor CAN traffic: Use tools like
candumpor PCAN-View for debugging.
Demo Video: Google Drive Link
.
├── .gitignore
├── README.md
├── report_PoC.docx
├── .vscode/
│ └── settings.json
├── docs/
│ ├── report_vn/
│ │ ├── Report.docx
│ │ └── Report.pptx
│ └── yocto/
│ ├── 1. Build image for Raspberry Pi 5.md
│ ├── 2. CAN Communication.md
│ ├── 3. Systemd startup script.md
│ ├── 4. Integrating Qt into a Yocto Project.md
│ └── 5. Auto-launch Qt application.md
├── ecu_nodes/
│ ├── README.md
│ ├── .metadata/
│ ├── img/
│ └── stm32f1_ecu_nodes/
├── hardware/
│ ├── Case_for_7inch_display_and_Pi5.stl
│ ├── README.md
│ └── img/
├── software/
│ ├── README.md
│ ├── qtapp/
│ └── screenshots/
- ECU Nodes
- Hardware Setup
- VCU Software Overview
- Build image for Raspberry Pi 5
- CAN Communication
- Systemd Startup Script
- Integrating Qt into a Yocto Project
- Auto-launch Qt Application
- Fork the repository.
- Create a feature branch.
- Commit changes.
- Push and open a pull request.
- ISO 26262: Road vehicles – Functional safety (2018)
- ISO 2575: Road vehicles – Symbols for controls, indicators and tell-tales (2024)
- Qt Documentation: doc.qt.io
- SocketCAN Documentation: docs.kernel.org/networking/can.html
- Yocto Project Documentation: docs.yoctoproject.org
- STM32 Reference Manual (RM0008): STMicroelectronics (2018)
- CAN Protocol Tutorial: controllerstech.com/can-protocol-in-stm32
- Zonal Architecture Overview: Molex Technical Article (2022)
For issues or inquiries, open a GitHub issue or contact [vanthinh.nguyentran.4@gmail.com].

