# hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system architecture

> Architecture diagram of the GitHub repository hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system
- Repository: https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system

## Overview

This is LPC2129 embedded firmware for building access control and security monitoring. Its main loop waits for PIR motion, authenticates by RFID and then keypad fallback, operates the door servo, and records successful-entry timestamps. The README also describes EEPROM event storage, RTC, LCD, UART, keypad, and PIR capabilities. The shown entry log writes timestamp fields to EEPROM; source excerpts do not show EEPROM reads or an RFID-specific driver, so those relationships are limited to what the main loop and README establish.

Main entry points: [`main.c`](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/main.c) (Access controller), [`delay.c`](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/delay.c) (Peripheral initialization), [`i2c_driver.c`](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/i2c_driver.c) (I2C bus driver), [`keypad_driver.c`](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/keypad_driver.c) (Keypad scanning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access workflow"]
  node_main["Access controller<br/>[main.c]"]
  node_door["Door servo<br/>[servo_driver.c]"]
end

subgraph group_sensing["Inputs and authentication"]
  node_motion["PIR motion input<br/>[main.c]"]
  node_rfid["RFID reader input"]
  node_keypad["Keypad scanning<br/>[keypad_driver.c]"]
end

subgraph group_time_storage["Time and event storage"]
  node_rtc["RTC timekeeping<br/>[rtc_driver.c]"]
  node_eeprom[("Event log storage<br/>[eeprom.c]")]
end

subgraph group_interfaces["Device interfaces"]
  node_i2c["I2C bus driver<br/>[i2c_driver.c]"]
  node_lcd["LCD status display<br/>[lcd_4bit_driver.c]"]
  node_uart["UART communication<br/>[uart0_driver.c]"]
  node_init["Peripheral initialization<br/>[delay.c]"]
  node_delays["Timer delays<br/>[delay.c]"]
  node_contracts["Firmware declarations<br/>[header.h]"]
end

node_resident(("Building user"))
node_security_devices["Security hardware"]

node_resident -->|"triggers"| node_motion
node_main -->|"checks"| node_motion
node_main -->|"reads tag"| node_rfid
node_main -->|"reads fallback"| node_keypad
node_main -->|"controls"| node_door
node_main -->|"gets timestamp"| node_rtc
node_main -->|"logs entry"| node_eeprom
node_main -->|"displays status"| node_lcd
node_main -->|"reports status"| node_uart
node_init -->|"initializes"| node_uart
node_init -->|"initializes"| node_i2c
node_init -->|"initializes"| node_lcd
node_init -->|"initializes"| node_door
node_init -->|"initializes"| node_keypad
node_init -->|"sets clock"| node_rtc
node_rtc -->|"reads and writes"| node_i2c
node_eeprom -->|"writes timestamp"| node_i2c
node_keypad -->|"debounces with"| node_delays
node_lcd -->|"waits using"| node_delays
node_i2c -->|"reports errors"| node_uart
node_security_devices -.->|"provides tag input"| node_rfid
node_contracts -.->|"declares interfaces"| node_main

click node_main "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/main.c"
click node_motion "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/main.c"
click node_keypad "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/keypad_driver.c"
click node_door "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/servo_driver.c"
click node_rtc "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/rtc_driver.c"
click node_eeprom "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/eeprom.c"
click node_i2c "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/i2c_driver.c"
click node_lcd "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/lcd_4bit_driver.c"
click node_uart "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/uart0_driver.c"
click node_init "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/delay.c"
click node_delays "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/delay.c"
click node_contracts "https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/header.h"

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_main,node_door,node_resident toneBlue
class node_motion,node_rfid,node_keypad toneAmber
class node_rtc,node_eeprom toneMint
class node_i2c,node_lcd,node_uart,node_init,node_delays,node_contracts toneRose
class node_security_devices toneIndigo
```

## Components

### Access workflow

- [Access controller](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/main.c): `main.c`
- [Door servo](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/servo_driver.c): `servo_driver.c`

### Inputs and authentication

- [PIR motion input](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/main.c): `main.c`
- **RFID reader input**
- [Keypad scanning](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/keypad_driver.c): `keypad_driver.c`

### Time and event storage

- [RTC timekeeping](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/rtc_driver.c): `rtc_driver.c`
- [Event log storage](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/eeprom.c): `eeprom.c`

### Device interfaces

- [I2C bus driver](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/i2c_driver.c): `i2c_driver.c`
- [LCD status display](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/lcd_4bit_driver.c): `lcd_4bit_driver.c`
- [UART communication](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/uart0_driver.c): `uart0_driver.c`
- [Peripheral initialization](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/delay.c): `delay.c`
- [Timer delays](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/delay.c): `delay.c`
- [Firmware declarations](https://github.com/hanumanthreddykamanuru/smart-building-security-access-control-and-iot-monitoring-system/blob/main/header.h): `header.h`

### Other components

- **Building user**
- **Security hardware**

## Connections

- Building user → PIR motion input: triggers (evidence: `README.md`)
- Access controller → PIR motion input: checks (evidence: `main.c`)
- Access controller → RFID reader input: reads tag (evidence: `main.c`)
- Access controller → Keypad scanning: reads fallback (evidence: `main.c`)
- Access controller → Door servo: controls (evidence: `main.c`)
- Access controller → RTC timekeeping: gets timestamp (evidence: `main.c`)
- Access controller → Event log storage: logs entry (evidence: `main.c`)
- Access controller → LCD status display: displays status (evidence: `main.c`)
- Access controller → UART communication: reports status (evidence: `main.c`)
- Peripheral initialization → UART communication: initializes (evidence: `delay.c`)
- Peripheral initialization → I2C bus driver: initializes (evidence: `delay.c`)
- Peripheral initialization → LCD status display: initializes (evidence: `delay.c`)
- Peripheral initialization → Door servo: initializes (evidence: `delay.c`)
- Peripheral initialization → Keypad scanning: initializes (evidence: `delay.c`)
- Peripheral initialization → RTC timekeeping: sets clock (evidence: `delay.c`)
- RTC timekeeping → I2C bus driver: reads and writes (evidence: `rtc_driver.c`)
- Event log storage → I2C bus driver: writes timestamp (evidence: `eeprom.c`)
- Keypad scanning → Timer delays: debounces with (evidence: `keypad_driver.c`)
- LCD status display → Timer delays: waits using (evidence: `lcd_4bit_driver.c`)
- I2C bus driver → UART communication: reports errors (evidence: `i2c_driver.c`)
- Security hardware → RFID reader input: provides tag input (evidence: `README.md`)
- Firmware declarations → Access controller: declares interfaces (evidence: `header.h`)
