Skip to content

Commit 6e44109

Browse files
Project/alexandru.barbu2809 (#1253)
* :I have added the project description. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Still rebasing Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Added some more details as requested in the PR. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Still rebasing Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Getting close Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Deleted useless file. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Changed the name of the svg files. Tried to resize the KiCad but the end result looks worse. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Added the state machine diagram for the code section Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Refactored the wording. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Fixed svgs Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> * Fixed res size for state machine diagram. Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com> --------- Signed-off-by: Barbu Alexandru Daniel <186506659+AlexandruDanielBarbu@users.noreply.github.com>
1 parent 8f46f2e commit 6e44109

4 files changed

Lines changed: 92 additions & 54 deletions

File tree

21.1 KB
Loading
11.7 KB
Loading
7.5 KB
Loading

website/versioned_docs/version-acs_cc/project/2026/alexandru.barbu2809/index.md

Lines changed: 92 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,98 +8,137 @@ A black box that logs data on an SD card if the RC car has been in an accident.
88

99
:::
1010

11-
<!-- do not delete the \ after your name -->
12-
1311
## Description
1412

15-
The project will do 2 things:
16-
1. Detect if the RC car was involved in a crash
17-
2. If a crash had occurred log data such as acceleration, speed etc on an SD card.
13+
This project serves two main purposes:
14+
1. Detecting whether the RC car was involved in a crash.
15+
2. Logging telemetry data, such as acceleration and orientation in space, onto an SD card in the event of an accident.
1816

1917
## Motivation
2018

21-
I am passionate about cars. Many of my solo projects had involved cars from modeling to simulating the forces that act on a car.
19+
I am deeply passionate about cars. Many of my previous solo projects have revolved around automotive engineering, ranging from 3D modeling to simulating the physical forces that act upon a vehicle in motion.
2220

2321
## Architecture
2422

25-
Add here the schematics with the architecture of your project. Make sure to include:
26-
- i will do a Kalman filter so i need a crate for handling math and matrix multiplication
27-
- i will have to do some custom graphs to determine when an accident happened so another rust crate there
28-
- from what i understand i also need a filter that stabilizes the signal from the IMU sensor
23+
Project architecture schematic:
24+
[draw.io schema of the project](docs/schema-block-black-box.drawio.webp)
2925

30-
<!-- TODO:
31-
- what are the main components (architecture components, not hardware components)
32-
- how they connect with each other -->
26+
The core of the system is a Kalman filter that performs sensor fusion between the accelerometer and the gyroscope. To eliminate noise, the filter records multiple readings over a 2-second interval, stabilizing the raw IMU signal before processing acceleration. Because these algorithms require complex linear algebra, a dedicated Rust mathematics crate handles all matrix multiplications.
3327

34-
## Log
28+
Building upon this stabilized data, the system compares deceleration and impulsewith some thresholds to accurately detect an accident. The exact crash threshold was determined empirically by running test measurements, plotting the results, and analyzing the data. Once a crash is detected, the system immediately logs the car's acceleration and orientation to a CSV file on the SD card.
29+
30+
Additionally, the hardware includes two physical buttons to streamline testing and demo reruns: one safely ejects the SD card to prevent data corruption, while the other resets the IMU state to eliminate gyroscope drift and ensure a fresh start.
3531

36-
<!-- write your progress here every week -->
32+
Below is the state machine diagram of the project:
33+
[Image](docs/state-machine-release.drawio.webp)
34+
35+
Noteworthy graphs of my test runs can be found in the `README.md` of the software side of the project.
36+
37+
## Log
3738

3839
### Week 23 Feb - 29 Mar
3940

40-
Looking for an idea, validating idea, idea is too simple so back to square 1.
41+
Started by brainstorming and validating initial ideas. The first concept was too simple, so I went back to square one.
4142

42-
Asking people for problems that my project could solve, I am not satisfied with the ideas.
43+
I then asked peers about problems my project could solve, but I was not satisfied with the suggestions.
4344

44-
Finding out about back boxes and how they record data for a plane crash, adapting the idea for a smaller scope so i chose a car instead of a plane.
45+
Eventually, I researched aviation black boxes and how they record flight data during a crash. I adapted this concept for a smaller scope, choosing an RC car instead of a plane.
4546

46-
Validating idea with the course staff, idea is good.
47+
After validating this idea with the course staff, it was approved.
4748

48-
Looking for components, finding components, ordering them, they get delivered to the wrong address, waiting for components some more time.
49+
I then searched for and ordered the necessary components. Unfortunately, they were delivered to the wrong address, which caused additional delays.
4950

5051
### Week 30 Mar - 26 Apr
5152

52-
Doing small scale beginner project on the board to get the feel of how to program in rust on the STM board.
53+
Worked on small-scale beginner projects on the STM board to get a feel for programming in Rust.
5354

54-
Waiting for the rest of the components to be delivered.
55+
Continued waiting for the rest of the components to be delivered.
5556

56-
### Week 12 - 18 May
57+
### Week 27 Apr - 10 May
5758

58-
### Week 19 - 25 May
59+
The parts finally arrived at the correct address.
5960

60-
## Hardware
61+
Researched Kalman filters. [Good information was found here](https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python).
6162

62-
Components:
63-
- IMU 6 axis
64-
- MicroSD card module
65-
- STM board (provided by the university)
66-
- buzzer
67-
- LED
68-
- wires
69-
- breadboard
70-
- power supply 4 AA batteries
63+
Bought the RC car body and conducted further research on the specific type of Kalman filter needed, as well as how the car's chassis would affect the readings.
7164

72-
### Schematics
65+
Wired the project hardware to the RC car.
7366

74-
Place your KiCAD or similar schematics here in SVG format.
67+
Fixed an issue where the IMU sensor was not reading data, thanks to the lab assistants.
7568

76-
### Bill of Materials
69+
### Week 11 - 17 May
70+
71+
Added the external power supply.
72+
73+
Made significant progress on the software side:
74+
- Refactored the lab code for the MPU6500 component to fit my specific needs.
75+
- Implemented the code for the SD card logging system.
76+
- Tested the buzzer, the two buttons, and the RGB LED.
77+
- Tested sensor fusion and the Kalman filter implementation.
78+
- Discovered two bugs:
79+
- `probe-rs` was not reading the board (caused by unplugging it from the PC at a bad time). This was eventually fixed.
80+
- When connecting the external power supply, the board lights up, but the code does not execute. This issue was resolved later.
81+
82+
### Week 18 - 24 May
83+
84+
Worked on the state machine for the test bench.
85+
86+
Sought help regarding the power supply issue and decided to use a powerbank. However, the powerbank kept shutting down due to the low current draw from the STM board. I tried plugging my phone into the second port to keep it awake, but the powerbank only had one USB-A port. To fix this, I went to Altex Orhideea and bought a 3-meter Hama data cable to keep the project wired to my laptop during tests. I expected signal degradation due to the cable's length, but it works perfectly, and the board is now properly powered.
87+
88+
### Week 25 - 27 May
89+
90+
Refactored Kalman Filter and crash detection.
7791

78-
<!-- Fill out this table with all the hardware components that you might need.
92+
Conducted several test runs to calibrate the crash detection system.
7993

80-
The format is
81-
```
82-
| [Device](link://to/device) | This is used ... | [price](link://to/store) |
94+
After calibration, performed additional tests to validate the new parameters.
8395

84-
```
96+
Generated plots from the log files to analyze the gathered data.
8597

86-
-->
98+
Developed and tested the release build of the project.
99+
100+
Recorded the final project demonstration and posted it on YouTube [here](https://www.youtube.com/watch?v=s0vU-t5tHtw&list=PLj-KCdUICNfDgmbNKMuRmQCIzfgc7HheH&index=1).
101+
102+
Polished the overall project presentation.
103+
104+
## Hardware
105+
106+
Components:
107+
- 6-axis IMU
108+
- MicroSD card module
109+
- STM board (provided by the university)
110+
- Buzzer
111+
- LED
112+
- Wires
113+
- Breadboard
114+
- 4x AA battery power supply
115+
116+
### Schematics
117+
118+
[KiCad schema](docs/automotive-black-box.webp)
119+
120+
> [!NOTE]
121+
> I am not entirely sure about the exact part numbers for the buttons, as they are generic hobbyist components, but I recreated them in the schematic to the best of my ability.
122+
123+
### Bill of Materials
87124

88125
| Device | Usage | Price |
89126
|--------|--------|-------|
90-
| [STM32U545](https://www.st.com/resource/en/user_manual/um3062-stm32u3u5-nucleo64-boards-mb1841-stmicroelectronics.pdf) | The microcontroller | [113 RON](https://ro.mouser.com/ProductDetail/STMicroelectronics/NUCLEO-U545RE-Q?qs=mELouGlnn3cp3Tn45zRmFA%3D%3D&utm_id=6470900573&utm_source=google&utm_medium=cpc&utm_marketing_tactic=emeacorp&gad_source=1&gad_campaignid=6470900573&gbraid=0AAAAADn_wf1J6XpRotkoYj96_ZbUSaPnH&gclid=Cj0KCQjw77bPBhC_ARIsAGAjjV9JETny_HVaRTMCWUsjLF5mX_nrK4cA6P9VX1bEVQVYmCTCGeIwhOAaAlZUEALw_wcB) |
127+
| [STM32U545](https://www.st.com/resource/en/user_manual/um3062-stm32u3u5-nucleo64-boards-mb1841-stmicroelectronics.pdf) | Main microcontroller | [113 RON](https://ro.mouser.com/ProductDetail/STMicroelectronics/NUCLEO-U545RE-Q?qs=mELouGlnn3cp3Tn45zRmFA%3D%3D&utm_id=6470900573&utm_source=google&utm_medium=cpc&utm_marketing_tactic=emeacorp&gad_source=1&gad_campaignid=6470900573&gbraid=0AAAAADn_wf1J6XpRotkoYj96_ZbUSaPnH&gclid=Cj0KCQjw77bPBhC_ARIsAGAjjV9JETny_HVaRTMCWUsjLF5mX_nrK4cA6P9VX1bEVQVYmCTCGeIwhOAaAlZUEALw_wcB) |
91128
| [MPU-6500 6 axe](https://sigmanortec.ro/Modul-Accelerometru-Giroscop-I2C-MPU-6500-6-axe-p136248782) | Accelerometer and gyroscope for crash detection | 12 RON * 2 |
92-
| [Suport baterii AA, 4AA](https://sigmanortec.ro/Suport-4-baterii-AA-cu-capac-si-intrerupator-p172447738) | Power up the project | 7 * 2 RON |
93-
| [Modul MicroSD](https://sigmanortec.ro/Modul-MicroSD-p126079625) | For live telemetry | 5 * 2 RON |
94-
| LED | Visual effect of the crash | - |
95-
| Buzzer | Auditorial effect of the crash | - |
96-
| Wires | - | - |
97-
| Breadboard | Link components together | - |
98-
129+
| [Suport baterii AA, 4AA](https://sigmanortec.ro/Suport-4-baterii-AA-cu-capac-si-intrerupator-p172447738) | Project power supply | 7 RON * 2 |
130+
| [Modul MicroSD](https://sigmanortec.ro/Modul-MicroSD-p126079625) | Live telemetry logging | 5 RON * 2 |
131+
| LED | Visual crash indicator | - |
132+
| Buzzer | Auditory crash indicator | - |
133+
| Wires | Interconnecting components | - |
134+
| Breadboard | Prototyping circuit layout | - |
135+
| RC car | Base chassis for the project | 130 RON |
99136

137+
> [!NOTE]
138+
> Huge thanks to the lab assistants for providing detailed feedback on what hardware to buy!
100139
101140
> [!NOTE]
102-
> I bought 2 of each part just in case one breaks.
141+
> I bought two of each component just in case one breaks.
103142
104143
## Software
105144

@@ -128,9 +167,8 @@ The format is
128167

129168
## Links
130169

131-
<!-- Add a few links that inspired you and that you think you will use for your project -->
132-
133170
1. [Volvo car crash NCAP test](https://www.youtube.com/watch?v=jIuPI1k_kVU&t=10s)
134171
2. [What is a black box](https://www.google.com/search?q=what+is+a+black+box&rlz=1C1GCEA_enRO1076RO1076&oq=what+is+a+black+box&gs_lcrp=EgZjaHJvbWUyCQgAEEUYORiABDIHCAEQABiABDIHCAIQABiABDIHCAMQABiABDIHCAQQABiABDIICAUQABgWGB4yCAgGEAAYFhgeMggIBxAAGBYYHjIICAgQABgWGB4yCAgJEAAYFhge0gEJMTQ5ODNqMGo0qAIAsAIA&sourceid=chrome&ie=UTF-8)
135172
3. [Kalman filter - 1](https://kalmanfilter.net/)
136173
4. [Kalman filter - 2](https://www.youtube.com/watch?v=IFeCIbljreY)
174+
5. [KiCad tutorial](https://www.youtube.com/watch?v=vLnu21fS22s&t=551s)

0 commit comments

Comments
 (0)