| Component | Type / Model | Role |
|---|---|---|
| Microcontroller | ATmega324PB Xplained Mini | Central Processing Unit (CPU); manages ADC and PWM signals. |
| Flame Sensor | Optical IR Sensor (Analog) | Detects infrared radiation emitted by a flame. |
| Servo Motor 1 | SG90 / MG90 | Rotates the scanning assembly on the horizontal axis (180°). |
| Servo Motor 2 | SG90 / MG90 | Controls the vertical orientation of the extinguishing nozzle. |
| MiniWater Pump | 3V - 6V DC | Delivers the extinguishing agent toward the fire. |
| Relay Module | 5V Optocoupled | Switches the pump on/off and isolates the power circuit from the MCU. |
| Power Supply | 5V / 2A (External) | Provides the necessary current for the motors and the pump. |
| Connectivity | Breadboard & Jumpers | Used for making electrical connections between modules. |
Design Explanations:
To ensure efficient operation and hardware-level precision, the following pins were selected:
The images above show the final wiring on the breadboard, with the Buck Converter supplying power to the flame sensor and the Xplained Mini board.
To verify the system, the Flame Sensor and the integrated LED (PB5) were tested.
The software implementation is fully functional and stable. The application is written in pure C for the ATmega328P microcontroller using PlatformIO. It successfully runs a real-time fire detection and suppression loop. The system concurrently monitors a flame sensor via both digital and analog channels, triggers an instantaneous acoustic alarm via hardware interrupts, controls a high-power water pump through an isolated relay module, and drives a 2-axis sweep mechanism using hardware PWM.
In order to maximize execution speed, minimize memory footprint, and strictly adhere to low-level academic requirements, no external third-party libraries (such as Arduino.h or Servo.h) were used.
The primary novelty of this project lies in its Hybrid Dual-Channel Sensor Architecture. Instead of relying on a single data path, the flame sensor is evaluated simultaneously through two distinct subsystems:
1. A **Digital Safety Path** linked directly to a high-priority hardware interrupt line. 2. An **Analog Measurement Path** processed via the ADC.
This creates a fail-safe paradigm: the acoustic alarm bypasses any software delay or loop blockage to guarantee immediate warning, while the analog loop calculates the spatial presence of the threat to dynamically orchestrate physical suppression.
The architecture incorporates core concepts from three foundational PM laboratories:
The software layout is divided into explicit hardware initialization blocks and a single, low-latency execution loop:
+-----------------------------------------------------------------------+
| Hardware Initialization |
| (ADC_init() | PWM_init() | INT0_init() | sei()) |
+-----------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------+
| Main Loop [while(1)] |
+-----------------------------------------------------------------------+
| 1. Sample raw IR intensity from PC0 (ADC0). |
| 2. Evaluate threshold criteria (valoare_foc < 400). |
+-----------------------------------------------------------------------+
| |
[Fire Detected: FALSE] [Fire Detected: TRUE]
| |
v v
+------------------------------------+ +------------------------------------+
| - Pull PD4 LOW (Activate Relay) | | - Pull PD4 HIGH (Deactivate Relay) |
| - Pull PD3 HIGH (Maintain Buzzer) | | - Pull PD3 LOW (Silence Buzzer) |
| - Increment Servo position | | - Snap Servo back to Bisectore |
| (Sweep 0° to 120° dynamically) | | (60° Rest Position) |
+------------------------------------+ +------------------------------------+
| |
+---------------------> [_delay_ms(20)] <----+
|
v
(Repeat Loop)
Independent of the flow chart above, if pin PD2 drops to 0V at any microsecond, the CPU stops execution instantly:
ISR(INT0_vect) {
stare_alerta = 1;
PORTD |= (1 << PD3); // FORCES BUZZER ON IMMEDIATELY
}
System verification was carried out systematically:
The infrared phototransistor module required hardware-software co-calibration to avoid false positives caused by laboratory overhead fluorescent lighting:
Directly access the official project demonstration video hosted on the university's cloud platform here:
🎬 Click Here to Watch: Fire Suppression System Demo
Link to the project repository https://github.com/PatriciaBratu/Fire-Detection-and-Suppression-System.git