System Integration — Final Project¶
This week SSTM¶

Assignment¶
Design and document the system integration for the final project by showing how all subsystems work together as one complete product.
1. Introduction to System Integration to FP¶
Her tried to integrating all parts of the final project into one functional embedded system.
The project combines electronics, embedded programming, PCB design, mechanical structure, and sensor interaction into a complete fabricated product.
The system is designed around the XIAO ESP32-C3 microcontroller and a KY-003 Hall effect sensor for magnetic field detection and alarm triggering.
Source: (edited with AI copilot with prompt “combine the following side mirror in two detachable and base parts”)

2. Project Overview¶
Final Project Description¶
The final project is to detect a theft for cars part specially car side mirror many time vulnerable using a magnetic detection and alarm system that uses a Hall effect sensor to detect nearby magnetic fields.
When a magnet is detected, the XIAO ESP32-C3 processes the sensor signal and activates visual indicators using LEDs.
The project demonstrates embedded electronics integration, PCB fabrication, sensor communication, and enclosure assembly using digital fabrication tools.
Main Features¶
- Magnetic field detection using KY-003 Hall sensor
- Visual feedback using indicator LED
- Compact custom PCB design
- Embedded programming with ESP32-C3
- Custom fabricated enclosure and mounting system
Expected Functionality¶
The system continuously monitors the Hall effect sensor input.
When magnetic detection occurs, the ESP32-C3 activates the output LED and processes the event in real time.

3. System Overview¶
Main Functional Blocks¶
The project is divided into the following subsystems.
Mechanical System¶
- Enclosure structure
- PCB mounting system
- Sensor positioning
- Cable organization
Electronics System¶
- XIAO ESP32-C3 micro controller
- KY-003 Hall effect sensor
- Status LED with resistor
- Push button switch
- Power distribution circuit
- Pin headers and connectors
Embedded Software¶
- Sensor reading
- Digital signal processing
- LED output control
- System monitoring
Communication System¶
- GPIO digital communication
- USB programming interface
- Optional I2C expansion header

4. System Block Diagram¶
The block diagram shows how all components communicate inside the project.
KY-003 Hall Sensor
↓
XIAO ESP32-C3
↓
Status LED
Additional integrated components:
USB Power
↓
ESP32-C3
↓
Sensor + LED
5. Mechanical Integration¶
Structure Design¶
The enclosure was designed to securely hold the PCB, sensor, and wiring while maintaining a compact and organized structure.
The design also improves protection, accessibility, and final product appearance.
Design Considerations¶
- PCB mounting alignment
- Sensor exposure positioning
- Internal wire routing
- Structural stability
- Easy assembly and maintenance


Assembly Process¶
The assembly process includes:
- PCB fabrication using FR4 material
- Soldering electronic components
- Installing the Hall sensor
- Mounting the XIAO ESP32-C3
- Organizing wiring connections
- Final enclosure assembly



6. Electronics Integration¶
Main Electronics Components¶
- XIAO ESP32-C3
- KY-003 Hall effect sensor
- LED with resistor
- 3-pin horizontal SMD socket
- 2-pin I2C horizontal header
- USB power connection
PCB Integration¶
The PCB was designed in KiCad and integrated into the enclosure with proper connector placement and organized routing.
Important considerations included:
- Short signal paths
- Stable grounding
- Reliable sensor connection
- Proper 3.3V power distribution
- Easy soldering and maintenance


Wiring Integration¶
The wiring system includes:
- 3.3V power lines
- GND connections
- Sensor signal routing
- LED output wiring
- Push button connections
Organized wiring improves reliability, safety, and easier debugging.

7. Software Integration¶
Firmware Architecture¶
The firmware controls the complete system by integrating sensor input and output responses using the ESP32-C3.
The software continuously reads the Hall sensor signal and updates the LED output accordingly.
Embedded Programming¶
The firmware was developed using the Arduino IDE for the XIAO ESP32-C3.
Main software functions include:
- Digital sensor reading
- Output control
- Event detection
- Serial debugging
Code
/*
XIAO ESP32-C3
Hall Sensor + RGB LED + Buzzer Alarm System
Pin Connections
Hall Sensor OUT -> D0
RGB Red -> D2
RGB Green -> D7
RGB Blue -> D8
Buzzer -> D3
Behavior
Startup:
Red -> Green -> Blue -> White + Beep
Safe State:
Solid Green
Alarm State:
Alternating Red/Blue
Pulsing buzzer
-------------------------------
IMPORTANT
-------------------------------
- Power Hall sensor from 3.3V
- Code assumes COMMON-CATHODE RGB LED
- Serial baud: 115200
*/
const int hallPin = D0;
const int redPin = D2;
const int greenPin = D7;
const int bluePin = D8;
const int buzzerPin = D3;
// -------------------------------
// Setup
// -------------------------------
void setup() {
Serial.begin(115200);
pinMode(hallPin, INPUT_PULLUP);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
// Turn everything OFF first
setRGB(LOW, LOW, LOW);
digitalWrite(buzzerPin, LOW);
Serial.println("System Starting...");
startupTest();
Serial.println("System Ready");
}
// -------------------------------
// Main Loop
// -------------------------------
void loop() {
int hallState = digitalRead(hallPin);
Serial.print("Hall State: ");
Serial.println(hallState);
// Most Hall sensors:
// LOW = magnet detected
// HIGH = no magnet
if (hallState == LOW) {
// -------------------------
// ALARM MODE
// -------------------------
Serial.println("MAGNET DETECTED!");
// Red ON
setRGB(HIGH, LOW, LOW);
tone(buzzerPin, 2000);
delay(200);
// Blue ON
setRGB(LOW, LOW, HIGH);
noTone(buzzerPin);
delay(200);
} else {
// -------------------------
// SAFE MODE
// -------------------------
Serial.println("Safe State");
// Solid Green
setRGB(LOW, HIGH, LOW);
noTone(buzzerPin);
delay(100);
}
}
// -------------------------------
// RGB Helper Function
// -------------------------------
void setRGB(bool redState, bool greenState, bool blueState) {
digitalWrite(redPin, redState);
digitalWrite(greenPin, greenState);
digitalWrite(bluePin, blueState);
}
// -------------------------------
// Startup LED/Buzzer Test
// -------------------------------
void startupTest() {
// RED
setRGB(HIGH, LOW, LOW);
tone(buzzerPin, 1000);
delay(300);
// GREEN
setRGB(LOW, HIGH, LOW);
tone(buzzerPin, 1200);
delay(300);
// BLUE
setRGB(LOW, LOW, HIGH);
tone(buzzerPin, 1500);
delay(300);
// WHITE (all colors)
setRGB(HIGH, HIGH, HIGH);
tone(buzzerPin, 2000);
delay(500);
// OFF
setRGB(LOW, LOW, LOW);
noTone(buzzerPin);
delay(200);
}
8. Power Management¶
Power Distribution¶
The project uses USB power supplied to the ESP32-C3 board.
The power system distributes stable voltage to:
- Hall effect sensor
- Indicator LED

9. Enclosure Design¶
The enclosure was designed to transform the prototype into a compact and organized product.
10. Testing & Debugging¶
System Testing¶
The full system was tested to verify:
- Hall sensor detection
- LED functionality
- Stable power operation
- PCB connectivity
- Firmware response
Debugging Process¶
Several issues were identified and corrected during development.
Mechanical Issues¶
- PCB mounting alignment
- Sensor positioning
Electronics Issues¶
- Loose solder joints
- Incorrect GPIO connections
- Power instability
11. Failure Analysis¶
Possible Failure Modes¶
Mechanical¶
- Weak enclosure mounting
- Sensor misalignment
- when failed some button detached
Solutions¶
- Improved PCB mounting
- Better cable organization
- Stable voltage distribution
- Firmware optimization and testing
12. Final Assembly¶
After integrating all systems:
- PCB was mounted
- Components were soldered
- Firmware was uploaded
- Wiring was organized
- Enclosure was assembled
- Final testing was completed
13. Final Result¶
The project successfully demonstrates integration between:

- Embedded electronics
- PCB fabrication
- Sensor systems
- Mechanical enclosure design
- Embedded programming
Video Demo¶
14. Reflection¶
This assignment improved my understanding of complete system integration and embedded product development.
I learned how to combine:
- PCB design
- Embedded programming
- Sensor integration
- Mechanical assembly
- Product documentation
The project also improved my workflow in:
- KiCad PCB design
- ESP32-C3 programming
- Digital fabrication
- System debugging
- Final project integration
15. Files working on¶
Design Files¶
- Schematics

- KiCad PCB files

- Firmware source code
- CAD models
Fabrication Files¶
- STL files
- SVG files
16. References¶
- Fab Academy documentation
- Final Project documentation
- KY-003 Hall sensor datasheet
- XIAO ESP32-C3 documentation
- KiCad documentation
- Arduino IDE resources