G4: Smart Delivery Box Lock & Monitoring System - shalan/CSCE4301-WiKi GitHub Wiki

Project Title:

Name GitHub
Ahmed Abdelkader Ahmed-Fawzy14
Ahmed Abdeen AhmedAbdeen7
Malek Ahmed malekrouk

Github Repo: https://github.com/Ahmed-Fawzy14/Smart-Delivery-Lock-Box-Monitoring-System

1. The Proposal

Abstract / Elevator Pitch:

The increasing reliance on online shopping has made package delivery a routine part of daily life. However, unattended deliveries are often vulnerable to theft and can be inconvenient for homeowners who are not present or who are busy to receive them. This creates a need for a real-time, convenient, and secure solution that allows homeowners to monitor and manage deliveries remotely.

This project proposes a Smart Delivery Lock and Door Monitoring System that detects the presence of a person using a motion sensor and captures timestamped images of visitors. These images are transmitted over Wi-Fi to a mobile application, allowing the homeowner to view activity at their door in real time. When a delivery is made, the homeowner can remotely control access to a secure delivery box through the application.

The system also includes a keypad-based PIN mechanism as a local access backup, ensuring functionality even without the mobile app. This system integrates motion sensing, WiFi communication, and servo actuation to achieve a solution that enhances both the security and convenience of home package deliveries.

Project Objectives & Scope:

Minimum Viable Product (MVP)

  • Detect the presence of a person using a PIR motion sensor
  • Capture image(s) upon motion detection using an ESP32-CAM
  • Transmit captured image(s) to the user over Wi-Fi
  • Allow the user to view images through a mobile application
  • Enable the user to remotely open and close the delivery box
  • Provide local access via a keypad and secure PIN
  • Verify entered PIN before unlocking the box
  • Automatically relock the box after a predefined time
  • Indicate lock status using LED (red = locked, green = unlocked)
  • Provide audible feedback using a buzzer when the box is open

Stretch Goals

  • Capture multiple images or image bursts for improved visibility
  • Maintain a timestamped log of delivery events and access attempts
  • Implement cooldown logic to prevent repeated motion-triggered captures
  • Display lock status and system feedback within the mobile application
  • Add basic security features such as limiting incorrect PIN attempts
  • Improve enclosure design and physical robustness of the lock box and the locking mechanism

Real Life Examples:

Generic Amazon Example

Generic Amazon Example

Link to Product: https://www.amazon.com/Package-Delivery-Prevention-Solution-Bluetooth/dp/B09SH5WM95

i-ParcelBox

i-ParcelBox

Link to Product: https://www.iparcelbox.com/product/iparcelbox-large/

2. System Architecture

2.1 High-Level Block Diagram:

High level block diagram

2.2 Flowchart:

Flowchart

Subsystem Breakdown:

A brief text description of how the major modules (e.g., motor control, user interface, wireless communication) interact.

3. Hardware Design

Component Selection:

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 Functional Requirements:

  1. The system shall be able to detect the presence of a person at the door using a PIR motion sensor peripheral connected to the ESP32-CAM.
  2. The ESP32-CAM shall capture one or more images when motion is detected.
  3. The ESP32-CAM shall transmit captured images to the user over Wi-Fi.
  4. The system shall be able to timestamp captured images using an RTC peripheral interfaced with the STM32.
  5. The user shall be able to view captured images through a mobile application.
  6. The user shall be able to send a control signal over Wi-Fi to the ESP32-CAM to open or close the delivery box.
  7. The ESP32-CAM shall communicate with the STM32 over UART to transmit lock and unlock commands.
  8. The STM32 shall control one or more servo motors to open and close the delivery box.
  9. The STM32 shall automatically relock the delivery box after a predefined time interval.
  10. The STM32 shall control a buzzer peripheral that activates while the delivery box is in the unlocked state.
  11. The STM32 shall control an LED peripheral that indicates system status, where:
  • green indicates the box is unlocked
  • red indicates the box is locked
  1. The user shall be able to set a PIN through the mobile application via the ESP32-CAM.
  2. The STM32 shall interface with a keypad peripheral to receive user PIN input.
  3. The STM32 shall verify the entered PIN and unlock the delivery box only if the PIN is correct.
  4. The system shall be able to maintain a timestamped record of captured images and delivery box access events on the mobile application.
  5. The system shall be able to indicate the current lock status (locked/unlocked) to the user via the mobile application through the ESP32-CAM.

4.2 Software Architecture:

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

4.3 Flowcharts & State Machines:

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

4.4 Key Algorithms:

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

4.5 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:

A clear breakdown of who worked on what (professors usually require this to grade individual contributions).

7.2 Timeline:

Date Milestone Deliverable / Task Duration Progress
Mon, Mar 30, 2026 Project Kick-off Project handout issued. Start forming teams and brainstorming ideas. 1 day Completed
Tue, Apr 14, 2026 Milestone 1: Team Formation Team formation deadline. 1 day Completed
Wed, Apr 15, 2026 Milestone 2: Proposal Presentation In-class proposal presentation. 1 day In Progress
Mon, Apr 20, 2026 Checkpoint A: Wiki/Page Setup Team project page on the course wiki must be created and populated with the approved proposal. 5 days In Progress
Wed, Apr 29, 2026 Milestone 3: Progress Presentation & Demo In-class progress presentation and live demo of at least one major subsystem. 9 days Not Started
Wed, May 6, 2026 Checkpoint B: Integration Update Wiki update showing integration status, testing evidence, and remaining issues. 7 days Not Started
Wed, May 13, 2026 Milestone 4: Final Demo & Presentation Final in-class presentation, live demo, final code, and completed wiki page due. 7 days Not Started

8. Appendices & References

8.1 Source Code Repository:

Link to your GitHub/GitLab repo.

8.2 References:

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