Skip to content

G6 : Smart Home Control System

Mostafa Gaafar edited this page May 3, 2026 · 24 revisions

Project Title: Smart Home Control System

Name GitHub
Mostafa Gaafar 900214463
Omar Saqr 900223343
Farida Bey 900212071

Github Repo: https://github.com/mostafa21314/Guest-Comfort-Management-System

Table of Contents

  1. The Proposal
  2. System Architecture
  3. Hardware Design
  4. Software Implementation
  5. Testing, Validation & Debugging
  6. Results & Demonstration
  7. Project Management
  8. Appendices & References

1. The Proposal

Abstract / Elevator Pitch:

Walking into a poorly lit, stuffy, cold, or hot room is a common experience, especially if we forgot to open the windows or adjust the thermostat. Adjusting lights, temperature, and air quality manually is inconvenient and slow to take effect. Despite the rise of smart homes, most solutions either require constant manual control or are overly complex and expensive for everyday needs. No unified system handles presence awareness, automated control, and energy savings together.

We propose a Presence-Aware Home Control System that automatically manages the ambience of a space based on occupancy and environmental conditions, with remote control for effects that take time. As soon as someone enters, the system welcomes them, turns on the lights, and activates the air atomizer. When the space is vacated, the system automatically powers down all actuators to conserve energy. Users can also remotely pre-configure the environment(especially temperature) before arrival via a WiFi-connected mobile interface.

Project Objectives & Scope

Minimum Viable Product (MVP)

  • Detect human presence using sensors
  • Automatically turn on lights when someone enters
  • Play a welcome message/music through a speaker
  • Activate an air freshener system upon entry
  • Count the number of people entering and leaving the room
  • Automatically turn off lights, speaker, and air freshener when the room is empty
  • Remote control via Wi-Fi to allow users to set the environment before arriving
  • Mobile app interface for user-friendly control

Functional Requirements

# Requirement Description
FR-1 Presence Detection Detect guest entry/exit and maintain an accurate room occupancy count
FR-2 Automated Lighting Turn on LED/Desk Lamp when occupied and dim; turn off when empty
FR-3 Climate Control(stretch goal) Activate AC remotely and report temperature readings from DHT22
FR-4 Air Quality Control Activate air atomizer based on occupancy or user command; deactivate when room is empty
FR-5 Audio Feedback Play welcome sound or music on first entry
FR-6 Remote Control Allow user to send manual override commands and receive live status updates via WiFi/MQTT
FR-7 Auto Shutdown Power down all actuators automatically when room is unoccupied

Stretch Goals:

  • Start an AC using the remote control feature
  • Multi-room extension by replicating the sensor/actuator setup across more than one room simultaneously

2. System Architecture

2.1 High-Level Block Diagram:

Blank diagram-8

2.2 System Visualization:

smart_home_room_clean

2.3 Subsystem Breakdown

Entrance/Exit Detection and Occupancy Counting

This subsystem detects people entering or leaving the room and maintains an accurate count of occupants. It consists of:

  • Two IR transmitter–receiver pairs configured as beam-break sensors, mounted on the door frame, one on the exterior side and one on the interior side. The order in which the beams are broken determines the direction of movement (entry vs. exit).
  • A PIR (passive infrared) motion sensor used to validate detections and filter out false triggers, such as pets passing through or accidental beam interruptions.
  • An occupancy counter that increments on confirmed entries and decrements on confirmed exits, maintaining a real-time count of people inside the room.

3. Hardware Design

Component Selection

Sourcing will be through RAM Electronics and the CSCE department primarily.

Component Image Category Purpose
IR Beam Break IR Beam Break Sensor Detect entry/exit direction, count occupants
PIR Sensor PIR Sensor Sensor Supplementary presence detection
DHT22 DHT22 Sensor Monitor ambient temperature and humidity
Photo Resistor LDR LDR Sensor Measure ambient brightness
ESP32 ESP32 Processing Run all logic, FreeRTOS tasks, WiFi/MQTT
STM32 (if needed) STM32 Processing Secondary MCU for distributed control
Power Adapter 61k8+ns-LSL _AC_UF894,1000_QL80_ Power 12V supply for ESP32 and logic
Relay Module Relay Module Actuator Switch lights and mist maker
TSOP382 IR Receiver TSOP382 Actuator Receive IR signals
TSAL6200 IR Emitter TSAL6200 Actuator Send IR commands to AC unit
Ultrasonic Atomizer Ultrasonic Atomizer Actuator Scent and humidity control
DFPlayer Mini DFPlayer Mini Actuator Welcome/goodbye audio playback via MicroSD
Power Strip Power Strip Actuator Relay-switched lighting load

Schematics & Wiring:

Circuit diagrams, pinout tables, and breadboard layouts.

Bill of Materials (BOM):

A table listing component names, part numbers, quantities, costs, and links to datasheets.

Power Budget:

Calculations ensuring your power supply can handle the peak current draw of all components combined.

4. Software Implementation

4.1 Software Architecture:

Description of the firmware design (e.g., Bare-metal Superloop, Interrupt-driven, or RTOS).

4.2 Flowcharts & State Machines:

Visual diagrams mapping out the core logic, state transitions, and interrupt service routines (ISRs).

4.3 Key Algorithms:

Explanations of any complex logic used (e.g., PID control loops, digital filtering, sensor fusion).

4.4 Development Environment:

Compilers, IDEs, and toolchains used (e.g., Keil, PlatformIO, STM32CubeIDE).

5. Testing, Validation & Debugging

5.1 Unit Testing:

How individual hardware components and software functions were tested in isolation.

5.2 Integration Testing:

How the system was tested as a whole.

5.3 Challenges & Solutions:

A log of major bugs, hardware failures, or design flaws you encountered, and the engineering steps you took to solve them.

6. Results & Demonstration

6.1 Final Prototype:

High-quality photos of the completed build.

6.2 Video Demonstration:

A link to a short video showing the system working in real-time under various conditions.

6.3 Performance Metrics:

Data showing how well the project met its initial objectives (e.g., "Response time was measured at 12ms, well within our 50ms goal").

7. Project Management

7.1 Division of Labor:

Name Contribution
Mostafa Gaafar Project Proposal, Sensors and Actuators needed, Timeline
Omar Saqr System Architecture, Timeline
Farida Bey System Architcture, Project Proposal

7.2 Timeline:

Milestones

April 14 — Milestone 1 (Team Formation)

  • Formed team of three: Mostafa Gaafar, Omar Mokhtar, and Farida Bey
  • Decided on project idea: Presence-Aware Guest Comfort Management System
  • Submitted team formation through the wiki page

April 15 — Milestone 2 (Proposal Presentation)

  • Delivered in-class proposal presentation
  • Prepared hardware/software block diagram
  • Refined proposal according to comments and feedback

April 20 — Checkpoint A

  • Finalize problem statement & proposed solution
  • Prepare component list and confirm sourcing
  • Define functional and non-functional requirements

April 29 — Milestone 3

  • Implement guest presence detection (IR beams)
  • Implement ultrasonic mist maker control
  • Implement LED lighting control via relay
  • Implement DFPlayer speaker for greeting
  • Implement temperature regulation using DHT22 and AC IR emitter

May 6 — Checkpoint B

  • Add humidity sensing to regulate mist output
  • Implement temperature regulation using DHT22 and AC IR emitter
  • Implement people counter with entry/exit logic
  • Report integration status; run scenario tests & power check

May 13 — Milestone 4

  • Add WiFi remote control; allow pre-arrival environment adjustment
  • Finalize mobile app interface and complete wiki & final presentation

8. Appendices & References

8.1 Source Code Repository:

Github Repo: https://github.com/mostafa21314/Guest-Comfort-Management-System

8.2 Proposal Presentation:

Embedded Project Proposal SP26.pdf

8.3 References:

Links to datasheets, tutorials, academic papers, and course materials used during development.

Clone this wiki locally