You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add the project description.
* Add the schematic for the project.
* Updated the files
* Update files
* Update files
* Changed the file location
* Updated the corect format for the schematic
* Updated the correct schematic format
* Updated the correct schematic format
* Corrected error from ./build_website.sh
* Finalize project documentation
* Finalize project documentation
* Added photos
* Uploaded the photos with correct size
* Added Demo
* Added the correct format for info section in index.md
---------
Co-authored-by: POPAGEORGEMATEI <119328898+POPAGEORGEMATEI@users.noreply.github.com>
Ferris Goes Vroom is an autonomous line-following car that tracks a black line on a white surface, aiming for the fastest possible lap time. The car uses a row of IR sensors mounted under the chassis to detect the line position, and a PID controller continuously adjusts the speed of the two DC motors to stay on track and minimize lap time. A small OLED display shows real-time information such as current speed and system state.
16
-
17
+
Ferris Goes Vroom is an autonomous line-following car that tracks a black line on a white surface. The car uses a 5-channel IR sensor module mounted under the chassis to detect the line position, and adjusts the two DC motors to stay on track. A small OLED display shows real-time information such as line detection state and speed. An MPU6050 accelerometer estimates the current speed by integrating acceleration over time.
17
18
What sets this project apart is the use of **Rust** with the **Embassy** async framework on an STM32 microcontroller — an uncommon choice in the embedded world, but one that brings memory safety and high performance. A set of colored LEDs provides real-time visual feedback about the system state: line detected, line lost, or maximum speed reached.
18
19
19
20
## Motivation
@@ -30,89 +31,63 @@ its own little way.
30
31
31
32
The system is organized into four main modules that run concurrently as Embassy async tasks:
32
33
33
-
**Sensor Subsystem:**Three to five TCRT5000 IR sensors are mounted transversally under the car. They read the surface reflectivity and return digital values depending on whether they detect the black line or the white background. The combined readings are used to compute the line position error relative to the car's center.
34
+
**Sensor Subsystem:**A TCRT5000 5-channel IR sensor module is put in front of the chassis. Each channel reads surface reflectivity — black surfaces absorb IR (digital LOW) and white surfaces reflect it (digital HIGH). The combined pattern of S1–S5 readings determines the line position relative to the car center.
34
35
35
36
**PID Control Engine:** The control engine receives the error value from the sensor subsystem every few milliseconds and computes a correction using proportional, integral, and derivative terms. This correction is applied differentially to the two motors: if the car drifts right, the left motor speeds up and the right motor slows down, and vice versa. The three PID constants (Kp, Ki, Kd) are tuned experimentally on the real track.
36
37
37
-
**Motor Drive Subsystem:** An L298N dual H-bridge driver receives PWM signals from the STM32 and translates them into motor voltages. The two DC motors are independently controlled, allowing the car to steer by varying the speed difference between left and right.
38
-
39
-
**LED Feedback Module:** Three LEDs connected to GPIO output pins indicate the current system state. Green lights when the line is detected and tracking is active. Red lights when the line is lost and the car is searching. Blue lights when the car is running at maximum speed.
40
-
41
-
**Display Module:** A 0.96" SSD1306 OLED display connected via I2C shows real-time information including current speed, system state (tracking / line lost), and lap time.
**Motor Drive Subsystem:** An L298N dual H-bridge driver receives PWM signals from two STM32 timer channels (TIM2_CH3 and TIM3_CH1) and independently drives the two DC motors. Speed is controlled differentially — when turning, the outer motor runs at 100% duty cycle while the inner motor runs at 50%, allowing smooth cornering. For sharp corrections, one motor stops completely.
39
+
40
+
**LED Feedback Module:** Three 5mm LEDs indicate the current system state: red lights when no line is detected and the car is stopped, blue lights when the line is detected and tracking is active, and green lights when the car is moving forward on the line.
41
+
42
+
**Display & Speed Module:** A 0.96 SSD1306 OLED display connected via I2C shows real-time line detection state. An MPU6050 accelerometer, also connected via I2C, estimates speed by integrating the X-axis acceleration (ax) over time with dt = 50ms.
43
+
44
+
#### Block Diagram
45
+

76
46
77
47
### Communication Protocols
78
48
79
49
| Protocol | Usage |
80
50
|----------|-------|
81
51
|**GPIO Input**| Reading IR sensors, computing line position |
82
52
|**GPIO Output**| Controlling LEDs |
53
+
|**PWM (TIM)**| Controlling motor speed via L298N ENA/ENB |
83
54
|**ADC**| Reading analog IR sensor values for precise line position |
84
55
|**PWM (TIM)**| Controlling motor speed via L298N |
85
-
|**I2C**| Communication with SSD1306 OLED display |
86
56
87
57
## Log
88
58
89
59
### Week 1
90
60
Defined the project concept and architecture. Researched and selected the hardware components needed for the build. Started working on the project documentation.
91
61
92
62
### Week 2
93
-
*(coming soon)*
63
+
Verified each component one by one. Assembled the hardware — mounted the chassis, connected the TCRT5000 sensor module, L298N motor driver, OLED display, MPU6050, LEDs, and LiPo battery.
94
64
95
65
### Week 3
96
-
*(coming soon)*
66
+
Wrote test code to verify all components working together — sensor readings, motor control, LED feedback, OLED display, and MPU6050 speed estimation.
97
67
98
68
### Week 4
99
-
*(coming soon)*
69
+
Finalized the project software with complete line-following logic. Finalized documentation and assembled all components in their final positions on the car.
100
70
101
71
## Hardware
102
72
103
73
The project is built around the **STM32 Nucleo-U545RE-Q**, featuring an ARM Cortex-M33 core running at 160MHz with 256KB of SRAM and 2MB of Flash, and an integrated ST-LINK/V3E debugger for easy flashing and RTT logging from Rust.
104
74
105
-
Three to five **TCRT5000 IR reflectance sensors**are mounted in a row under the front of the chassis. Each sensor emits infrared light and reads back the reflection — black surfaces absorb IR (digital LOW) and white surfaces reflect it (digital HIGH). The combined pattern of readings is used to compute the signed error of the line position relative to the car center.
75
+
**A TCRT5000 5-channel IR sensor module**is mounted under the front of the chassis is mounted in a row under the front of the chassis. Each sensor emits infrared light and reads back the reflection — black surfaces absorb IR (digital LOW) and white surfaces reflect it (digital HIGH). The combined pattern of readings is used to compute the signed error of the line position relative to the car center.
106
76
107
-
An**L298N dual H-bridge motor driver** receives PWM signals from two STM32 timer channels and independently drives the two **DC motors with gearboxes**. The speed difference between the motors is the steering mechanism — no servo is needed.
77
+
A**L298N dual H-bridge motor driver** receives PWM signals from two STM32 timer channels and independently drives the two **DC motors with gearboxes**. The speed difference between the motors is the steering mechanism — no servo is needed.
108
78
109
-
Three **5mm LEDs** (green, red, blue) with 220Ω current-limiting resistors are connected to GPIO output pinsand provide live system state feedback.
79
+
Three 5mm LEDs (green, red, blue) with 220Ω current-limiting resistors are connected to GPIO output pins: red lights when no line is detected and the car stops, blue lights when the center sensors are aligned on the line, and green lights when the motors are running.
110
80
111
81
A **0.96" SSD1306 OLED display** is connected via I2C and shows real-time data: current speed, system state, and lap time.
112
82
113
-
A **LiPo 7.4V battery** powers the system autonomously. The L298N has a built-in 5V regulator that powers the logic side, while the motors are driven directly from the battery voltage.
83
+
A LiPo 7.4V battery powers the system autonomously. A HW-286 step-down regulator converts the 7.4V battery voltage to 5V to power the STM32 Nucleo, while the motors are driven directly from the battery voltage through the L298N.
84
+
85
+
The car chassis is either a commercial kit that holds all components in a compact and balanced layout. All components are connected on a breadboard with jumper wires.
86
+
87
+

88
+

114
89
115
-
The car chassis is either a commercial kit or a custom 3D-printed frame that holds all components in a compact and balanced layout. All components are connected on a breadboard with jumper wires.
|[STM32 Nucleo-U545RE-Q](https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html)| Main microcontroller | Provided by university |
101
+
|[TCRT5000 5-channel IR module](https://www.bitmi.ro/senzori-electronici/senzor-tcrt5000-cu-5-canale-pentru-urmarirea-liniei-10796.html)| Line detection | 16.99 RON |
102
+
|[L298N Motor Driver](https://www.bitmi.ro/module-electronice/modul-driver-l298n-cu-punte-h-dubla-pentru-motoare-dc-stepper-10400.html)| Dual DC motor control | 11.99 RON |
103
+
|[OLED Display SSD1306 0.96](https://www.bitmi.ro/electronica/ecran-oled-0-96-cu-interfata-iic-i2c-10488.html)| Real-time info display | 18.98 RON |
|[Resistors 220Ω x3 (kit)](https://sigmanortec.ro/kit-rezistori-30-valori-20-bucati?SubmitCurrency=1&id_currency=2&gad_source=1&gad_campaignid=23069763085&gbraid=0AAAAAC3W72MHJfsM4OIBiavb31HceLdF0&gclid=Cj0KCQjww8rQBhDjARIsAE43KPOJp4UTmhwNo1vMdQtHna5V_TJA_fCljqShhdf_jti3jHOmUQJVbQcaAoqzEALw_wcB)| LED current limiting | 15.16 RON |
106
+
|[LiPo Battery 7.4V](https://www.emag.ro/baterie-gens-ace-g-tech-soaring-1000mah-7-4v-30c-2s1p-xt60-kxg0060208/pd/D5RNQWMBM/?utm_medium=ios&utm_campaign=share%20product&utm_source=mobile%20app)| Autonomous power supply | 61.35 RON |
107
+
|[2WD Car chassis kit](https://sigmanortec.ro/Kit-sasiu-masina-2WD-urmaritor-linie-p172447939?SubmitCurrency=1&id_currency=2&gad_source=1&gad_campaignid=23069763085&gbraid=0AAAAAC3W72MHJfsM4OIBiavb31HceLdF0&gclid=Cj0KCQjww8rQBhDjARIsAE43KPOyOr5N7Gfx9LmCz1uGRrUwDUqEOnw8INjrzhQ2fKjxNQONSaTV7eAaAsCHEALw_wcB)| Mechanical strcuture | 41.21 RON |
108
+
|[Breadboard 400](https://www.bitmi.ro/componente-electronice/breadboard-400-puncte-pentru-montaje-electronice-rapide-10633.html)| Prototyping connections | 6.99 RON |
109
+
|[Jumper wires](https://www.bitmi.ro/electronica/40-fire-dupont-mama-mama-30cm-10503.html)| Prototyping connections(M-M, T-T, M-T) | 22.97 RON |
|[Black electrical tape](https://www.leroymerlin.ro/produse/banda-izolatoare-emos-19-mm-x-20-m-neagra-12085101.html?gclsrc=aw.ds&gad_source=1&gad_campaignid=22336169660&gbraid=0AAAAADwsS17jrlpcrXuL23b_yI2DmuFCj&gclid=Cj0KCQjww8rQBhDjARIsAE43KPO4Wb-Vk0dmpN3WlYYbxvbQjEA4Wd0Gpz1hDJzQXPEn98giooNR63UaAraTEALw_wcB)| Track line for car | 6.49 RON |
112
+
|[M3 screws + nuts set](https://www.leroymerlin.ro/produse/suruburi-metrice-cu-cap-inecat-otel-m3-x-16-mm-10721620.html)| Chassis assembly |~2 RON |
113
+
|[Double-sided adhesive tape](https://www.leroymerlin.ro/produse/banda-dublu-adeziva-moment-power-fix-rezistenta-pana-120-kg-19-mm-x-1-5-m-alb-10575495.html?utm_source=google&utm_medium=cpc&utm_campaign=pmax&utm_content=materiale-constructii-vopsea&gad_source=1&gad_campaignid=22294857356&gbraid=0AAAAADwsS15SufdSsaTf_GoXFaVDVDdK6&gclid=Cj0KCQjww8rQBhDjARIsAE43KPM1ds0XzksdQLlTxEfcRNbOyKP_eLKT_-IymxFJXnC3-K9lwMZFNCYaAoT_EALw_wcB)| Component mounting | 19.98 RON |
114
+
|[HW-286 Step-down regulator](https://www.emag.ro/modul-convertor-coborator-dc-4v-38v-5a-reglabil-1-25v-36v-eficienta-96-putere-75w-protectie-scurtcircuit-pentru-sisteme-diy-si-alimentare-electronica-an7/pd/D19FC1YBM/?cmpid=145971&utm_source=google&utm_medium=cpc&utm_campaign=(RO:Whoop!)_3P-Y_%3e_Jucarii_hobby&utm_content=79559831474&gad_source=1&gad_campaignid=2078923891&gbraid=0AAAAACvmxQihs2WnLDXuriZW-vXAynmTp&gclid=Cj0KCQjww8rQBhDjARIsAE43KPP-zRUIV2l8rovl47pTQG0Q9itRJF-HGXpiUrw259kevNvRdie3-iwaAtLBEALw_wcB)| Voltage regulation 7.4V to 5V | 28.29 RON |
136
115
137
116
## Software
138
117
@@ -153,9 +132,7 @@ The car chassis is either a commercial kit or a custom 3D-printed frame that hol
0 commit comments