This project features the development of an embedded firmware architecture simulating an automotive Body Control Module (BCM) dedicated to smart window actuation. The system bridges digital logic with physical hardware, providing reliable, deterministic control over DC motors while prioritizing user interaction and safety.
Designed with automotive engineering principles in mind, the system implements a robust state machine to handle concurrent inputs, ensuring fluid operation across different window control modes (manual, auto-up, auto-down) and maintaining strict hardware safety tolerances.
- Core Logic Language: [Insert Language, e.g., C / C++ / MicroPython]
- Microcontroller Unit (MCU): [Insert Hardware, e.g., ESP32 / STM32 / Arduino Uno]
- Hardware Interfacing: [Insert Actuators/Drivers, e.g., L298N Motor Driver / Relays / DC Motors]
- Architecture: Event-driven state machine with hardware interrupts and debounced input handling.
The BCM operates through a highly structured loop to ensure zero-latency response to user commands while monitoring hardware states:
- Input Acquisition Layer: Reads digital signals from physical switches (Up/Down commands) utilizing software/hardware debouncing techniques to prevent phantom triggers.
- Control Logic Layer (The BCM): Processes inputs through a deterministic state machine. It evaluates current window position, user commands, and active safety flags before authorizing motor movement.
- Actuation Layer: Translates logic states into PWM (Pulse Width Modulation) or digital signals directed to the motor drivers, managing polarity for bidirectional motor control.
To mimic real-world automotive standards, the system's logic responds to the following interaction matrix:
| User Input / Event | System State | Hardware Action |
|---|---|---|
| Short Press (Up/Down) | Auto-Mode Triggered | Continuous motor actuation until end-stop is reached |
| Long Press / Hold | Manual Mode Active | Motor actuates only while the switch remains engaged |
| Opposite Direction Pressed | Interrupt & Halt | Motor stops immediately to prevent hardware damage |
| [Optional: Current Spike] | [Anti-Pinch Safety Flag] | [Motor reverses direction to prevent injury/obstruction] |
Modify this table according to your exact physical schematic:
| Component | MCU Pin | Function |
|---|---|---|
| Window Switch UP | [e.g., GPIO 4] |
Digital Input (Pulled High/Low) |
| Window Switch DOWN | [e.g., GPIO 5] |
Digital Input (Pulled High/Low) |
| Motor Driver IN1 | [e.g., GPIO 18] |
Digital Output (Motor Forward/Up) |
| Motor Driver IN2 | [e.g., GPIO 19] |
Digital Output (Motor Reverse/Down) |
- Clone the repository to your local environment:
git clone [https://github.com/HJLeslye/Smart-BCM-Automotive-Window-Control.git](https://github.com/HJLeslye/Smart-BCM-Automotive-Window-Control.git)
- Hardware Setup: Wire the MCU, motor drivers, and switches according to the schematic defined in the project files.
- Compilation & Flashing:
- Open the project in your IDE (e.g., [Insert IDE, e.g., Arduino IDE / PlatformIO]).
- Select the appropriate target MCU board and COM port.
- Compile and upload the firmware.
Leslye Hernández Jiménez Engineering in Information and Communication Technologies
LinkedIn: View Profile Email: hdezj.leslye@gmail.com
Developed as an engineering prototype for automotive embedded systems.