# satyasreepada1101/real-time-embedded-gas-monitoring architecture

> Architecture diagram of the GitHub repository satyasreepada1101/real-time-embedded-gas-monitoring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/satyasreepada1101/real-time-embedded-gas-monitoring
- Repository: https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring

## Overview

This repository is an Arduino-based kitchen gas-monitoring and ventilation controller. Its documented workflow reads environmental sensors and button input, evaluates automatic, manual, and emergency conditions, then controls ventilation and user alerts. The README describes these capabilities, but no source excerpt was available, so the sketch-level connections below reflect documented behavior rather than inspected calls; all software components point to the sole sketch file.

Main entry points: [`code/smart_chimney.ino`](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino) (Arduino Sketch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing &amp; Input"]
  node_dht22["DHT22 Sensor"]
  node_mq2["MQ-2 Sensor"]
  node_button["Override Button"]
  node_sensor_reading["Sensor Reading<br/>[smart_chimney.ino]"]
  node_button_handling["Button Debouncing<br/>[smart_chimney.ino]"]
end

subgraph group_control["Control Logic"]
  node_sketch["Arduino Sketch<br/>[smart_chimney.ino]"]
  node_gas_confirm["Gas Confirmation<br/>[smart_chimney.ino]"]
  node_mode_control["Mode Control<br/>[smart_chimney.ino]"]
  node_auto_speed["Automatic Speed<br/>[smart_chimney.ino]"]
  node_manual_speed["Manual Speed<br/>[smart_chimney.ino]"]
  node_safety_override["Safety Override<br/>[smart_chimney.ino]"]
end

subgraph group_response["Ventilation &amp; Alarm"]
  node_fan_control["Fan Control<br/>[smart_chimney.ino]"]
  node_fan_driver["L298N &amp; Fan"]
  node_buzzer_control["Buzzer Control<br/>[smart_chimney.ino]"]
  node_buzzer["Passive Buzzer"]
end

subgraph group_feedback["Display &amp; Alerts"]
  node_lcd_display["LCD Feedback<br/>[smart_chimney.ino]"]
  node_lcd["I2C LCD"]
  node_gsm_alert["GSM Alerting<br/>[smart_chimney.ino]"]
  node_sim800l["SIM800L Module"]
end

node_kitchen(("Kitchen Conditions"))
node_recipient(("Remote Recipient"))

node_kitchen -->|"provides conditions"| node_dht22
node_kitchen -->|"provides smoke"| node_mq2
node_dht22 -->|"temperature, humidity"| node_sensor_reading
node_mq2 -->|"gas reading"| node_sensor_reading
node_button -->|"button input"| node_button_handling
node_sketch -->|"reads sensors"| node_sensor_reading
node_sketch -->|"handles input"| node_button_handling
node_sketch -->|"confirms detection"| node_gas_confirm
node_sketch -->|"selects mode"| node_mode_control
node_mode_control -->|"automatic mode"| node_auto_speed
node_mode_control -->|"manual mode"| node_manual_speed
node_sketch -->|"applies safety"| node_safety_override
node_sensor_reading -->|"environment readings"| node_auto_speed
node_gas_confirm -->|"confirmed hazard"| node_safety_override
node_auto_speed -->|"requested speed"| node_fan_control
node_manual_speed -->|"selected speed"| node_fan_control
node_safety_override -->|"maximum speed"| node_fan_control
node_safety_override -->|"activates alarm"| node_buzzer_control
node_fan_control -->|"PWM control"| node_fan_driver
node_buzzer_control -->|"drives buzzer"| node_buzzer
node_sketch -->|"updates display"| node_lcd_display
node_lcd_display -->|"displays status"| node_lcd
node_sketch -->|"requests alerts"| node_gsm_alert
node_safety_override -->|"emergency alert"| node_gsm_alert
node_gsm_alert -->|"sends SMS, calls"| node_sim800l
node_sim800l -->|"delivers alerts"| node_recipient

click node_sketch "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_sensor_reading "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_button_handling "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_gas_confirm "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_mode_control "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_auto_speed "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_manual_speed "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_safety_override "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_fan_control "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_buzzer_control "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_lcd_display "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"
click node_gsm_alert "https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dht22,node_mq2,node_button,node_sensor_reading,node_button_handling toneBlue
class node_sketch,node_gas_confirm,node_mode_control,node_auto_speed,node_manual_speed,node_safety_override toneAmber
class node_fan_control,node_fan_driver,node_buzzer_control,node_buzzer toneMint
class node_lcd_display,node_lcd,node_gsm_alert,node_sim800l toneRose
class node_kitchen,node_recipient toneIndigo
```

## Components

### Sensing & Input

- **DHT22 Sensor**
- **MQ-2 Sensor**
- **Override Button**
- [Sensor Reading](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Button Debouncing](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`

### Control Logic

- [Arduino Sketch](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Gas Confirmation](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Mode Control](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Automatic Speed](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Manual Speed](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- [Safety Override](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`

### Ventilation & Alarm

- [Fan Control](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- **L298N & Fan**
- [Buzzer Control](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- **Passive Buzzer**

### Display & Alerts

- [LCD Feedback](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- **I2C LCD**
- [GSM Alerting](https://github.com/satyasreepada1101/real-time-embedded-gas-monitoring/blob/main/code/smart_chimney.ino): `code/smart_chimney.ino`
- **SIM800L Module**

### Other components

- **Kitchen Conditions**
- **Remote Recipient**

## Connections

- Kitchen Conditions → DHT22 Sensor: provides conditions
- Kitchen Conditions → MQ-2 Sensor: provides smoke
- DHT22 Sensor → Sensor Reading: temperature, humidity
- MQ-2 Sensor → Sensor Reading: gas reading
- Override Button → Button Debouncing: button input
- Arduino Sketch → Sensor Reading: reads sensors
- Arduino Sketch → Button Debouncing: handles input
- Arduino Sketch → Gas Confirmation: confirms detection
- Arduino Sketch → Mode Control: selects mode
- Mode Control → Automatic Speed: automatic mode
- Mode Control → Manual Speed: manual mode
- Arduino Sketch → Safety Override: applies safety
- Sensor Reading → Automatic Speed: environment readings
- Gas Confirmation → Safety Override: confirmed hazard
- Automatic Speed → Fan Control: requested speed
- Manual Speed → Fan Control: selected speed
- Safety Override → Fan Control: maximum speed
- Safety Override → Buzzer Control: activates alarm
- Fan Control → L298N & Fan: PWM control
- Buzzer Control → Passive Buzzer: drives buzzer
- Arduino Sketch → LCD Feedback: updates display
- LCD Feedback → I2C LCD: displays status
- Arduino Sketch → GSM Alerting: requests alerts
- Safety Override → GSM Alerting: emergency alert
- GSM Alerting → SIM800L Module: sends SMS, calls
- SIM800L Module → Remote Recipient: delivers alerts
