This project implements a multi-node automotive safety system using CAN Bus communication.
The system simulates a real-time vehicle environment where speed and obstacle distance are continuously monitored, and automatic braking is applied when collision risk is detected.
The system consists of three independent ECUs connected through CAN Bus.
- Uses HC-SR04 Ultrasonic Sensor
- Generates trigger pulse
- Measures echo pulse width using Timer
- Calculates obstacle distance
- Transmits distance data via CAN Bus
This node continuously monitors the obstacle distance in front of the vehicle.
- Uses MCP3204 12-bit SPI ADC
- Reads analog voltage from potentiometer
- Converts analog signal to digital value
- Maps ADC value to vehicle speed
- Transmits speed data via CAN Bus
The potentiometer is used to simulate vehicle speed in this project.
- Receives speed and distance frames via CAN
- Displays real-time values on:
- 16x2 LCD
- UART terminal
- Calculates Time-To-Collision (TTC)
- Determines collision risk zone
- Controls:
- Safe zone indicator LED
- Danger zone indicator LED
- Relay-based automatic braking
This ECU acts as the central decision-making unit.
- Ultrasonic ECU measures obstacle distance.
- Speed ECU measures vehicle speed.
- Both ECUs transmit data via CAN Bus.
- Main ECU receives speed and distance.
- TTC is calculated.
- Collision risk zone is determined.
- Brake is applied automatically if required.
- Dashboard continuously updates speed and distance.
-
Safe Zone:
- Vehicle runs normally
- Safe indicator ON
-
Warning Zone:
- Warning LED activated
- Driver alert condition
-
Danger Zone:
- Relay activated
- DC motor/generator stopped
- Automatic braking applied
When the obstacle is removed, the vehicle resumes normal operation.
- Embedded C
- Keil µVision IDE
- Flash Magic
- UART Serial Terminal
- LPC2129 ARM7 Microcontroller
- HC-SR04 Ultrasonic Sensor
- MCP3204 SPI ADC (12-bit)
- Potentiometer
- 16x2 LCD Display
- Relay Module
- DC Motor