# amaljohnreddy61/smart-exam-hall architecture

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

- Interactive diagram: https://gitdiagram.com/amaljohnreddy61/smart-exam-hall
- Repository: https://github.com/amaljohnreddy61/smart-exam-hall

## Overview

This LPC2148 firmware manages an exam-hall session. The principal workflow is: an administrator enters through a password check, configures a duration, starts the exam, and the firmware tracks remaining minutes until it records the end time and sounds an alert. The main loop also refreshes the clock, temperature and displays; hardware interrupts provide pause/edit requests. The README documents RTC persistence, LED thresholds and interrupt-driven display refresh, but unsampled implementation details limit some links.

Main entry points: [`main.c`](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/main.c) (Main loop and menu), [`exam.c`](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/exam.c) (Exam state and logs), [`rtc.c`](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/rtc.c) (Clock and date), [`interrupt.c`](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/interrupt.c) (Pause/edit interrupts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Application control"]
  node_admin["Main loop and menu<br/>[main.c]"]
  node_password["Password check<br/>[password.c]"]
end

subgraph group_exam["Exam lifecycle"]
  node_exam_state["Exam state and logs<br/>[exam.c]"]
end

subgraph group_io["Hardware interfaces"]
  node_rtc["Clock and date<br/>[rtc.c]"]
  node_temperature["LM35 sampling<br/>[adc.c]"]
  node_keypad["Keypad scan<br/>[keypad.c]"]
  node_lcd["LCD display<br/>[lcd.c]"]
  node_sevenseg["Countdown display<br/>[sevenseg.c]"]
  node_led["Status LEDs<br/>[led.c]"]
  node_buzzer["End alert<br/>[buzzer.c]"]
  node_buttons["Pause/edit interrupts<br/>[interrupt.c]"]
end

node_operator(("Hall administrator"))

node_operator -->|"uses menu"| node_admin
node_admin -->|"verifies password"| node_password
node_admin -->|"reads and edits"| node_rtc
node_admin -->|"samples temperature"| node_temperature
node_admin -->|"reads keys"| node_keypad
node_admin -->|"renders screens"| node_lcd
node_admin -->|"refreshes display"| node_sevenseg
node_admin -->|"initializes and processes"| node_exam_state
node_admin -->|"initializes"| node_buttons
node_admin -->|"initializes"| node_led
node_admin -->|"initializes"| node_buzzer
node_exam_state -->|"reads exam times"| node_rtc
node_exam_state -->|"updates countdown"| node_sevenseg
node_exam_state -->|"sets status"| node_led
node_exam_state -->|"sounds at end"| node_buzzer
node_exam_state -->|"renders logs"| node_lcd
node_rtc -->|"renders edit prompts"| node_lcd
node_rtc -->|"reads edit keys"| node_keypad
node_buttons -.->|"sets edit request"| node_admin
node_buttons -.->|"sets pause request"| node_exam_state

click node_admin "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/main.c"
click node_password "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/password.c"
click node_exam_state "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/exam.c"
click node_rtc "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/rtc.c"
click node_temperature "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/adc.c"
click node_keypad "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/keypad.c"
click node_lcd "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/lcd.c"
click node_sevenseg "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/sevenseg.c"
click node_led "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/led.c"
click node_buzzer "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/buzzer.c"
click node_buttons "https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/interrupt.c"

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_admin,node_password toneBlue
class node_exam_state toneAmber
class node_rtc,node_temperature,node_keypad,node_lcd,node_sevenseg,node_led,node_buzzer,node_buttons toneMint
class node_operator toneIndigo
```

## Components

### Application control

- [Main loop and menu](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/main.c): `main.c`
- [Password check](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/password.c): `password.c`

### Exam lifecycle

- [Exam state and logs](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/exam.c): `exam.c`

### Hardware interfaces

- [Clock and date](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/rtc.c): `rtc.c`
- [LM35 sampling](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/adc.c): `adc.c`
- [Keypad scan](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/keypad.c): `keypad.c`
- [LCD display](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/lcd.c): `lcd.c`
- [Countdown display](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/sevenseg.c): `sevenseg.c`
- [Status LEDs](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/led.c): `led.c`
- [End alert](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/buzzer.c): `buzzer.c`
- [Pause/edit interrupts](https://github.com/amaljohnreddy61/smart-exam-hall/blob/main/interrupt.c): `interrupt.c`

### Other components

- **Hall administrator**

## Connections

- Hall administrator → Main loop and menu: uses menu (evidence: `README.md`)
- Main loop and menu → Password check: verifies password (evidence: `main.c`)
- Main loop and menu → Clock and date: reads and edits (evidence: `main.c`)
- Main loop and menu → LM35 sampling: samples temperature (evidence: `main.c`)
- Main loop and menu → Keypad scan: reads keys (evidence: `main.c`)
- Main loop and menu → LCD display: renders screens (evidence: `main.c`)
- Main loop and menu → Countdown display: refreshes display (evidence: `main.c`)
- Main loop and menu → Exam state and logs: initializes and processes (evidence: `main.c`)
- Main loop and menu → Pause/edit interrupts: initializes (evidence: `main.c`)
- Main loop and menu → Status LEDs: initializes (evidence: `main.c`)
- Main loop and menu → End alert: initializes (evidence: `main.c`)
- Exam state and logs → Clock and date: reads exam times (evidence: `exam.c`)
- Exam state and logs → Countdown display: updates countdown (evidence: `exam.c`)
- Exam state and logs → Status LEDs: sets status (evidence: `exam.c`)
- Exam state and logs → End alert: sounds at end (evidence: `exam.c`)
- Exam state and logs → LCD display: renders logs (evidence: `exam.c`)
- Clock and date → LCD display: renders edit prompts (evidence: `rtc.c`)
- Clock and date → Keypad scan: reads edit keys (evidence: `rtc.c`)
- Pause/edit interrupts → Main loop and menu: sets edit request
- Pause/edit interrupts → Exam state and logs: sets pause request
