PROJECT: Line Tracing Car
Date: 2025-11-04
Author/Partner:
Github: repository link
Demo Video: Youtube link
PDF version:
Introduction
Design an embedded system to control an RC car to drive on the racing track. The car can be controlled either (1) manually with your Laptop keyboard by Bluetooth communication or (2) automatically to drive around the track.
From the start to the finish line, it needs to complete the given missions.

Preparation Mission
Move the car to the start line by manual control. (Manual Mode)
The car needs to STOP automatically when it finds an obstacle in front
Start Line Mission
The car should be in AUTO Mode
It should start when the obstacle is removed
The track timer is started
Intermission Mission
Stop the car when it sees an obstacle
To raise the obstacle from the ground, the car's arm should ring the bell (touch sensor)
When the obstacle is raised, the car should continue driving
Finish Line Mission
Stop the car when it sees an obstacle
It needs to ring the bell (touch sensor) to finish
The track timer will be stopped and recorded
Requirement
Hardware
MCU
NUCLEO-F411RE
Actuator/Sensor/Others: Minimum
Bluetooth Module(HC-06)
DC motor x2, DC motor driver(L9110s or L298N)
IR Reflective Sensor (TCRT 5000) x2
HC-SR04 x2
RC Servo Motor (SG90)
Additional sensor/actuators are acceptable
Software
VS code, CMSIS, EC_HAL library
Preparation
Complete the following tutorials:
Use ecSTM32F411v2.h and void MCU_init(void) in your project code.
Problem Definition
Design your RC car that has the following functions:
Line tracing on the given racing track
2 control modes: Manual Mode and AUTO Mode
Completes the given missions:
Preparation Mission
Start Mission
Intermission Mission
Finish Mission
The track time will be recorded
On the PC, connected to MCU via bluetooth:
Print the car status every 1 sec such as “( MOD: A DIR: F STR: 00 VEL: 00 )”
Manual Mode
Mode Change (MOD):
When 'M' or 'm' is pressed, it should enter Manual Mode
LD2 should be ON in Manual Mode
Speed (VEL):
Increase or decrease speed each time you push the arrow key “UP” or “DOWN”, respectively.
You can choose the speed keys
Choose the speed level: V0 ~ V3
Steer (STR):
Steering control with keyboard keys
Increase or decrease the steering angles each time you press the arrow key “RIGHT” or “LEFT”, respectively.
Steer angles with 3 levels for both sides
Example: Level -3, -2, -1, 0, 1, 2, 3 // '-' angle is turning to left
Driving Direction (DIR)
Driving direction is forward or backward by pressing the key “F” or “B”, respectively.
You can choose the control keys
Emergency Stop
RC car must stop running when key “S” is pressed.
This must be the highest priority
Automatic Mode
Mode Change:
When 'A' or 'a' is pressed, it should enter AUTO Mode
LD2 should blink at 1 second rate in AUTO Mode
It should drive on the racing track continuously
Stops temporarily when it detects an object nearby on the driving path.
If there is an obstacle in the front and on the side, use the servo motor to touch the bell (pressure sensor)
When the pressure sensor responds, the obstacle is removed.
If the obstacle is removed, it should drive continuously
Procedure
Report contents
In the report, explain concisely how your system works with state tables/diagram or flow-chart.
List all necessary states (states, input, output etc) to implement this design problem.
List all necessary conditional FLAGS for programming.
Show the logic flow from initialization.
Any additional relevant diagrams or explanations.
Configuration Table (fill for your project)
System Clock
RCC
PLL 84MHz
delay_ms
SysTick
Motor DIR
Digital Out
...
….
TIMER
TIMER1
TIMER2
Timer Interrupt
...
10msec
ADC
ADC
….
DC Motor Speed
PWM2
RC Motor
PWM1
ADC sampling trigger
PWM3
RS-232 USB cable(ST-LINK)
USART2
No Parity, 8-bit Data, 1-bit Stop bit 38400 baud-rate
Bluetooth
USART1
TXD: PA9 RXD: PA10
No Parity, 8-bit Data, 1-bit Stop bit 9600 baud-rate
Circuit Diagram
You need to include the circuit diagram

Code
Your code goes here: ADD Code LINK such as github
// YOUR MAIN CODE ONLY
// YOUR CODE with CommentsResults
Experiment images and results
Show experiment images /results
Add demo video link
Reference
Complete list of all references used (github, blog, paper, etc)
What to submit
EC_LineTracingCar_ID1_ID2.zip
Report:
\report\
\
imgfolderEC_LineTracingCar_ID1_ID2_Report.md
EC_LineTracingCar_ID1_ID2_Report.pdf
Source code:
\src\
\includefolderEC_LineTracingCar_ID1_ID2_main.c
Example:

Troubleshooting
Last updated
Was this helpful?