# shadow-leaked/bca-6th-sem architecture

> Architecture diagram of the GitHub repository shadow-leaked/bca-6th-sem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shadow-leaked/bca-6th-sem
- Repository: https://github.com/shadow-leaked/bca-6th-sem

## Overview

##### Project Type and Purpose
- This is an educational IoT hardware-software lab series built around Arduino UNO-compatible boards.
- Each folder (01_led_blinking through 08_bluetooth_relay) is a standalone “module” combining firmware, sensors, actuators, and (in later labs) wireless interfaces.
- Purpose: teach students sensor interfacing, actuators, displays, communication (Bluetooth), and home-automation concepts.

##### File Structure
- Top-level: README.md, LICENSE, plus a directory “iot_practical.”
- Inside iot_practical: eight numbered subfolders, each containing one .ino sketch file and a readme.md.
- No backend or frontend code—firmware only. No CI/CD or deployment scripts beyond uploading sketches.
- Common configuration: pin assignments, library includes.

##### Main Components
a. Hardware Layer
– Microcontroller Unit (MCU): Arduino UNO / Nano / Mega / UNO R4.
– Power Supply: USB or external 5 V.
– Sensors & Inputs: LED (output), Push Button, LDR, LM35/DHT22, MQ135, HC-05 Bluetooth RX/TX, Relay.
– Actuators & Displays: LED, 16×2 LCD, Relay contacts.
b. Firmware Layer
– Sketch (.ino) running in Arduino loop().
– PinMode configuration, digitalRead/digitalWrite, analogRead, library calls (LiquidCrystal, DHT, SoftwareSerial).
c. Communication & UI Layer
– Bluetooth HC-05 ↔ Smartphone App (“Serial Bluetooth Terminal”).
– LCD display for local feedback.
d. Optional External System
– Mobile App (Android) as remote control/UI.

##### Relationships & Data Flows
- Sensor → MCU: analogRead/digitalRead → firmware logic.
- MCU → Actuator/Display: digitalWrite or library APIs → LED blink or LCD text or relay ON/OFF.
- MCU ↔ Bluetooth module: UART (TX/RX) ↔ mobile app.
- Power bus feeding all hardware modules.

##### Architectural Patterns & Principles
- Layered separation: Hardware vs Firmware vs User Interface.
- Common firmware loop handling events in each practical.
- Reusable pin-configuration block; modular code per sensor/actuator.
- For Bluetooth modules: decouple serial comm logic from display/actuator logic.

##### Final Checklist
- All major components (MCU, power, sensors, actuators, communication).
- Annotations for pin assignments or library names if more detail is required.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Platform
    subgraph "Core Platform"
        PSU["Power Supply"]:::hardware
        Arduino["Arduino UNO (MCU)"]:::hardware
        PSU -->|"5V Power"| Arduino
    end

    %% Lab 1 – LED Blinking
    subgraph "Lab 1 – LED Blinking"
        LED1["LED"]:::hardware
        Sketch1["01_led_blinking.ino"]:::firmware
        Doc1["readme.md"]:::data
        LED1 -->|digitalWrite| Sketch1
        Sketch1 -->|runs on| Arduino
        Sketch1 -.-> Doc1
    end

    %% Lab 2 – LED with Push-Button
    subgraph "Lab 2 – LED with Push-Button"
        Button2["Push Button"]:::hardware
        LED2["LED"]:::hardware
        Sketch2["02_led_switch.ino"]:::firmware
        Doc2["readme.md"]:::data
        Button2 -->|digitalRead| Sketch2
        Sketch2 -->|digitalWrite| LED2
        Sketch2 -->|runs on| Arduino
        Sketch2 -.-> Doc2
    end

    %% Lab 3 – LDR Light Sensor
    subgraph "Lab 3 – LDR Light Sensor"
        LDR3["LDR Sensor"]:::hardware
        Sketch3["03_ldr.ino"]:::firmware
        Doc3["readme.md"]:::data
        LDR3 -->|analogRead| Sketch3
        Sketch3 -->|runs on| Arduino
        Sketch3 -.-> Doc3
    end

    %% Lab 4 – DHT22 Sensor
    subgraph "Lab 4 – DHT22 Sensor"
        DHT4["DHT22 Sensor"]:::hardware
        Sketch4["04_dht22.ino"]:::firmware
        Doc4["readme.md"]:::data
        DHT4 -->|library call| Sketch4
        Sketch4 -->|runs on| Arduino
        Sketch4 -.-> Doc4
    end

    %% Lab 5 – 16×2 LCD Display
    subgraph "Lab 5 – 16×2 LCD Display"
        LCD5["16×2 LCD"]:::hardware
        Sketch5["05_lcd_display.ino"]:::firmware
        Doc5["readme.md"]:::data
        Sketch5 -->|LiquidCrystal| LCD5
        Sketch5 -->|runs on| Arduino
        Sketch5 -.-> Doc5
    end

    %% Lab 6 – MQ-135 + LCD
    subgraph "Lab 6 – MQ-135 + LCD"
        MQ6["MQ-135 Sensor"]:::hardware
        LCD6["16×2 LCD"]:::hardware
        Sketch6["06_mq135_lcd.ino"]:::firmware
        Doc6["readme.md"]:::data
        MQ6 -->|analogRead| Sketch6
        Sketch6 -->|LiquidCrystal| LCD6
        Sketch6 -->|runs on| Arduino
        Sketch6 -.-> Doc6
    end

    %% Lab 7 – HC-05 Bluetooth + LCD
    subgraph "Lab 7 – Bluetooth + LCD"
        HC7["HC-05 Module"]:::hardware
        LCD7["16×2 LCD"]:::hardware
        Sketch7["07_bluetooth_lcd.ino"]:::firmware
        Doc7["readme.md"]:::data
        HC7 <-->|"UART"| Sketch7
        Sketch7 -->|LiquidCrystal| LCD7
        Sketch7 -->|runs on| Arduino
        Sketch7 -.-> Doc7
    end

    %% Lab 8 – Bluetooth + Relay
    subgraph "Lab 8 – Bluetooth + Relay"
        HC8["HC-05 Module"]:::hardware
        Relay8["Relay"]:::hardware
        Sketch8["08_bluetooth_relay.ino"]:::firmware
        Doc8["readme.md"]:::data
        HC8 <-->|"UART"| Sketch8
        Sketch8 -->|digitalWrite| Relay8
        Sketch8 -->|runs on| Arduino
        Sketch8 -.-> Doc8
    end

    %% Mobile App
    MobileApp["Smartphone App"]:::ui
    HC7 <-->|"Bluetooth"| MobileApp
    HC8 <-->|"Bluetooth"| MobileApp

    %% Click Events
    click Sketch1 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/01_led_blinking/01_led_blinking.ino"
    click Doc1 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/01_led_blinking/readme.md"
    click Sketch2 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/02_led_switch/02_led_switch.ino"
    click Doc2 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/02_led_switch/readme.md"
    click Sketch3 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/03_ldr/03_ldr.ino"
    click Doc3 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/03_ldr/readme.md"
    click Sketch4 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/04_dht22/04_dht22.ino"
    click Doc4 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/04_dht22/readme.md"
    click Sketch5 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/05_lcd_display/05_lcd_display.ino"
    click Doc5 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/05_lcd_display/readme.md"
    click Sketch6 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/06_mq135_lcd/06_mq135_lcd.ino"
    click Doc6 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/06_mq135_lcd/readme.md"
    click Sketch7 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/07_bluetooth_lcd/07_bluetooth_lcd.ino"
    click Doc7 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/07_bluetooth_lcd/readme.md"
    click Sketch8 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/08_bluetooth_relay/08_bluetooth_relay.ino"
    click Doc8 "https://github.com/shadow-leaked/bca-6th-sem/blob/main/iot_practical/08_bluetooth_relay/readme.md"
    click README.md "https://github.com/shadow-leaked/bca-6th-sem/blob/main/README.md"
    click Core Platform "iot_practical/"

    %% Styles
    classDef hardware fill:#f2f2f2,stroke:#333,stroke-width:1px;
    classDef firmware fill:#d4edda,stroke:#2e7d32,stroke-width:1px;
    classDef data fill:#cfe2ff,stroke:#084298,stroke-width:1px,stroke-dasharray: 4 2;
    classDef ui fill:#ffe5b4,stroke:#b35900,stroke-width:1px;
```
