Have questions about the project?
Have questions about this project or want to discuss a similar idea? I’d be happy to connect and explore how we can work together.
Category: Automotive Software Engineering
Project Type: Academic Engineering Project
Technologies: Embedded C, CAN Bus, ADC, GPIO, PIT Timer
Institution: Technische Universität Chemnitz, Germany
Modern vehicles use Electronic Control Units (ECUs) to monitor vehicle parameters and exchange information between different electronic systems.
The Controller Area Network (CAN) bus is an important communication protocol in automotive systems. It enables multiple ECUs to exchange information reliably.
As part of my M.Sc. Automotive Software Engineering studies at Technische Universität Chemnitz, I worked on a CAN-based ECU development project using Embedded C.
The project focuses on CAN message transmission and reception, vehicle speed processing, engine RPM data handling, indicator control, and Virtual Cockpit communication.
The main objectives of this project were:
Develop a CAN-based embedded ECU using C programming.
Implement CAN message transmission and reception.
Understand CAN message buffers and filtering.
Read analog signals using ADC.
Convert potentiometer values into vehicle speed.
Process engine RPM information.
Control indicator lights using GPIO.
Implement timer-based operations using PIT.
Manage ECU operating states using a state machine.
Explore vehicle data communication with a Virtual Cockpit interface.
The ECU processes driver inputs and vehicle-related signals before preparing CAN messages for the Virtual Cockpit interface.
The main functional modules include:
CAN Communication Module
Handles CAN message transmission, reception, message buffers, and receive callbacks.
ADC Module
Reads analog input from a potentiometer and converts the ADC values into vehicle speed.
GPIO Module
Handles digital input signals and indicator LED control.
PIT Timer Module
Manages periodic interrupts, CAN transmission timing, and indicator blinking operations.
ECU State Management
Controls ECU operating states, including IDLE and ENGINE_ON, based on received CAN messages.
CAN communication is one of the main components of this project.
The implementation supports:
CAN message transmission (Tx).
CAN message reception (Rx).
CAN message buffer handling.
Standard Identifier (SID) filtering.
Receive callback implementation.
Vehicle-related signal communication.
CAN Message Handling
The current implementation uses the following CAN identifiers for ECU state management:
| CAN ID | Function |
|---|---|
| 0x11 | Switch ECU from IDLE to ENGINE_ON |
| 0x10 | Switch ECU from ENGINE_ON to IDLE |
The application also prepares CAN messages containing engine status, vehicle speed, RPM, and indicator light information.
The project uses a potentiometer as an analog input source.
The ADC module reads the potentiometer value and converts the input into a vehicle speed value.
Input range: 0–4095
Vehicle speed range: 0–240 km/h
This demonstrates how analog input signals can be processed and represented as vehicle-related parameters in an embedded ECU.
The project includes RPM value generation and CAN data transmission.
The RPM information is prepared for CAN communication using separate low and high data bytes.
This demonstrates basic vehicle signal processing and data handling in automotive embedded applications.
The GPIO module handles digital switch inputs and indicator LED outputs.
Key functions include:
Reading left and right indicator switch inputs.
Controlling indicator LEDs.
Processing indicator status.
Transmitting indicator information through CAN messages.
The Periodic Interrupt Timer (PIT) is used for time-dependent operations.
The implementation explores:
Periodic timer interrupts.
Timer callback functions.
Periodic CAN transmission.
Indicator blinking control.
These operations demonstrate the importance of timer-based execution in embedded ECU development.
The application is organized into modular C source and header files.
| Module | Responsibility |
|---|---|
| main.c | Main application and ECU state management |
| can.c / can.h | CAN communication |
| adc.c / adc.h | Analog input processing |
| pit.c / pit.h | Timer configuration and callbacks |
| siu.c / siu.h | GPIO and system integration |
| init.c / init.h | Peripheral initialization |
This modular structure improves code organization and makes individual ECU functions easier to understand and maintain.
| Technology | Application |
|---|---|
| Embedded C | ECU software development |
| CAN Bus | Automotive communication |
| ADC | Analog sensor input processing |
| GPIO | Digital input and output control |
| PIT | Periodic timer operations |
| ECU State Machine | Operating state management |
| Virtual Cockpit | Vehicle data visualization concept |
Through this academic project, I explored:
Automotive CAN communication.
Embedded C programming.
ECU software architecture.
CAN transmission and reception.
CAN message filtering.
ADC-based sensor processing.
GPIO peripheral control.
Timer interrupts and callbacks.
ECU state machine implementation.
Vehicle speed and RPM data processing.
This project strengthened my understanding of automotive communication and embedded software development.
purposes. The implementation is not certified or validated for production vehicle use.
The complete source code and supporting technical documents are available in my GitHub repository.
GitHub Repository:
https://github.com/obydur/CAN-Based-ECU-Virtual-Cockpit
The repository includes C source files, header files, CAN communication documentation, ADC, GPIO and PIT-related technical documents.
Developing a CAN-based ECU provided practical exposure to automotive communication and embedded software concepts.
By working with CAN message handling, ADC input processing, GPIO control, timer-based operations, and ECU state management, I gained a deeper understanding of how automotive embedded systems exchange and process vehicle-related information.
I am continuing to develop my expertise in Embedded C, CAN communication, AUTOSAR, ECU development, and automotive software engineering.
Author: Obydur Rahman
M.Sc. Automotive Software Engineering
Technische Universität Chemnitz, Germany
Disclaimer: This is an academic engineering project developed for educational
Have questions about this project or want to discuss a similar idea? I’d be happy to connect and explore how we can work together.
