# starom00n/smart_soc architecture

> Architecture diagram of the GitHub repository starom00n/smart_soc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/starom00n/smart_soc
- Repository: https://github.com/starom00n/smart_soc

## Overview

Smart SOC is an ESP32 server-room security controller. RFID access and session handling, hazard detection, and temperature-based fan control turn sensor readings and dashboard commands into physical responses and remote alerts. The README documents the system behavior and hardware links, but no source excerpt was provided; firmware responsibilities therefore share the sole implementation path, and the diagram reflects documented relationships only.

Main entry points: [`smart_soc.ino`](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino) (ESP32 Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Room Sensing"]
  node_rfid_reader["RFID Reader"]
  node_pir_sensor["PIR Sensor"]
  node_mq2_sensor["MQ-2 Sensor"]
  node_dht11_sensor["DHT11 Sensor"]
end

subgraph group_security["Security Logic"]
  node_firmware["ESP32 Controller<br/>[smart_soc.ino]"]
  node_access_control["RFID Access<br/>[smart_soc.ino]"]
  node_motion_detection["Motion Detection<br/>[smart_soc.ino]"]
  node_smoke_detection["Smoke Detection<br/>[smart_soc.ino]"]
  node_fire_detection["Fire Detection<br/>[smart_soc.ino]"]
  node_fan_control["Fan Control<br/>[smart_soc.ino]"]
  node_alarm_control["Alarm Control<br/>[smart_soc.ino]"]
end

subgraph group_responses["Local Responses"]
  node_door_relay["Door Lock Relay"]
  node_fan_relay["Fan Relay"]
  node_leds_buzzer["LEDs and Buzzer"]
  node_oled["OLED Display"]
end

subgraph group_remote["Remote Monitoring"]
  node_blynk["Blynk Cloud"]
  node_line_api["LINE Messaging API"]
end

node_operator(("Remote Operator"))

node_rfid_reader -->|"reads cards"| node_access_control
node_pir_sensor -->|"signals motion"| node_motion_detection
node_mq2_sensor -->|"reports gas level"| node_smoke_detection
node_dht11_sensor -->|"reports temperature"| node_fire_detection
node_dht11_sensor -->|"reports temperature"| node_fan_control
node_access_control -->|"unlocks or locks"| node_door_relay
node_motion_detection -->|"triggers alarm"| node_alarm_control
node_smoke_detection -->|"triggers alarm"| node_alarm_control
node_fire_detection -->|"triggers alarm"| node_alarm_control
node_alarm_control -->|"drives alarm"| node_leds_buzzer
node_fan_control -->|"controls fan"| node_fan_relay
node_firmware -->|"updates display"| node_oled
node_operator -->|"uses dashboard"| node_blynk
node_blynk -->|"sends controls"| node_firmware
node_firmware -->|"sends telemetry"| node_blynk
node_firmware -->|"sends alerts"| node_line_api

click node_firmware "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_access_control "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_motion_detection "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_smoke_detection "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_fire_detection "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_fan_control "https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino"
click node_alarm_control "https://github.com/starom00n/smart_soc/blob/main/smart_soc.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_rfid_reader,node_pir_sensor,node_mq2_sensor,node_dht11_sensor toneBlue
class node_firmware,node_access_control,node_motion_detection,node_smoke_detection,node_fire_detection,node_fan_control,node_alarm_control toneAmber
class node_door_relay,node_fan_relay,node_leds_buzzer,node_oled toneMint
class node_blynk,node_line_api toneRose
class node_operator toneIndigo
```

## Components

### Room Sensing

- **RFID Reader**
- **PIR Sensor**
- **MQ-2 Sensor**
- **DHT11 Sensor**

### Security Logic

- [ESP32 Controller](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [RFID Access](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [Motion Detection](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [Smoke Detection](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [Fire Detection](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [Fan Control](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`
- [Alarm Control](https://github.com/starom00n/smart_soc/blob/main/smart_soc.ino): `smart_soc.ino`

### Local Responses

- **Door Lock Relay**
- **Fan Relay**
- **LEDs and Buzzer**
- **OLED Display**

### Remote Monitoring

- **Blynk Cloud**
- **LINE Messaging API**

### Other components

- **Remote Operator**

## Connections

- RFID Reader → RFID Access: reads cards (evidence: `README.md`)
- PIR Sensor → Motion Detection: signals motion (evidence: `README.md`)
- MQ-2 Sensor → Smoke Detection: reports gas level (evidence: `README.md`)
- DHT11 Sensor → Fire Detection: reports temperature (evidence: `README.md`)
- DHT11 Sensor → Fan Control: reports temperature (evidence: `README.md`)
- RFID Access → Door Lock Relay: unlocks or locks (evidence: `README.md`)
- Motion Detection → Alarm Control: triggers alarm (evidence: `README.md`)
- Smoke Detection → Alarm Control: triggers alarm (evidence: `README.md`)
- Fire Detection → Alarm Control: triggers alarm (evidence: `README.md`)
- Alarm Control → LEDs and Buzzer: drives alarm (evidence: `README.md`)
- Fan Control → Fan Relay: controls fan (evidence: `README.md`)
- ESP32 Controller → OLED Display: updates display (evidence: `README.md`)
- Remote Operator → Blynk Cloud: uses dashboard (evidence: `README.md`)
- Blynk Cloud → ESP32 Controller: sends controls (evidence: `README.md`)
- ESP32 Controller → Blynk Cloud: sends telemetry (evidence: `README.md`)
- ESP32 Controller → LINE Messaging API: sends alerts (evidence: `README.md`)
