College of Industrial Technology

Embedded Systems II

Final Project Documentation

Distributed Multi-Node IoT Monitoring and Control System with Central Gateway
Duration: 4 Weeks Total Points: 100
02

What You Will Build

Your team will design, build, and deploy a complete IoT system consisting of:

+-------------------------------------------------------------+
|                                                             |
|  4 SENSOR NODES (ESP32)                                     |
|  Each node:                                                 |
|  - Reads sensors from its location                          |
|  - Sends data to the central server                         |
|  - Receives and executes commands                           |
|  - Can be updated over-the-air                              |
|                                                             |
|  1 CENTRAL SERVER (ESP32)                                   |
|  - Receives data from all 4 nodes                           |
|  - Stores data in local storage                             |
|  - Hosts a web dashboard                                    |
|  - Sends commands to nodes                                  |
|  - Provides OTA updates                                     |
|                                                             |
+-------------------------------------------------------------+
03

System Architecture

+----------+  +----------+  +----------+  +----------+
|  NODE 1  |  |  NODE 2  |  |  NODE 3  |  |  NODE 4  |
| (Client) |  | (Client) |  | (Client) |  | (Client) |
+----+-----+  +----+-----+  +----+-----+  +----+-----+
     |             |             |             |
     +-------------+-------------+-------------+
                   |
             WiFi + HTTP
                   |
                   v
          +------------------+
          |   SERVER ESP32   |
          |   (HTTP Server)  |
          |                  |
          |  - REST API      |
          |  - Dashboard     |
          |  - LittleFS      |
          |  - NTP Sync      |
          |  - OTA Hosting   |
          +--------+---------+
                   |
                   | WiFi
                   v
          +------------------+
          |  Phone / Laptop  |
          |    (Browser)     |
          +------------------+
04

Course Modules Integrated

Course ModuleApplication in Project
ESP32 Basics5 ESP32 boards used
ADCLight, gas, and current sensors
PWMBuzzer tones and fan speed
InterruptsMotion detection and button presses
TimersPeriodic sensor reads
Wi-FiAll nodes connect to network
REST APIsNodes use HTTP POST and GET
IoT ArchitectureComplete sensor-to-dashboard flow
Local StoragePreferences and LittleFS
HMI / DashboardWeb interface on server
OTA UpdatesFirmware updates for all nodes
NTPAccurate timestamps
Device ConfigurationEach node has a configuration portal
05

Learning Objectives

By completing this project, you will be able to:

  1. Design a multi-device IoT system architecture
  2. Implement client-server communication using REST APIs
  3. Integrate multiple sensors and actuators on a single device
  4. Store data persistently using Preferences and LittleFS
  5. Build a functional web dashboard for monitoring
  6. Deploy firmware updates over-the-air to multiple devices
  7. Synchronize time across distributed devices using NTP
  8. Manage device configuration without recompilation
  9. Handle network failures with offline buffering
  10. Document and present a complete engineering project
06

Select Your Project Theme

Your team must select one of the following themes. All four nodes must relate to the selected theme.

Theme A

Smart Building Monitoring System

Entrance, Classroom, Equipment Room, Storage Room

Theme B

Smart Agriculture Monitoring System

Field Zone A, Field Zone B, Greenhouse, Water Tank

Theme C

Campus Safety System

Hallway, Laboratory, Parking Area, Entrance Gate

07

Theme A: Smart Building Monitoring System

Node 1 - Entrance / Lobby

  • Temperature and Humidity (DHT22)
  • Motion detection (PIR sensor)
  • Door status (Reed switch)
  • Output: LED indicator

Node 2 - Classroom / Office

  • Temperature and Humidity (DHT22)
  • Light level (LDR sensor)
  • Motion detection (PIR sensor)
  • Output: Buzzer alert

Node 3 - Equipment Room

  • Temperature (LM35 analog sensor)
  • Current consumption (ACS712)
  • Relay-controlled exhaust fan
  • Output: OLED display

Node 4 - Storage / Utility Room

  • Temperature and Humidity (DHT22)
  • Gas leak detection (MQ2 sensor)
  • Water leak detection (analog sensor)
  • Output: Buzzer and LED alert
08

Theme B: Smart Agriculture Monitoring System

Node 1 - Field Zone A

  • Soil moisture sensor
  • Temperature (LM35)
  • Light intensity (LDR)
  • Output: Relay-controlled water pump

Node 2 - Field Zone B

  • Soil moisture sensor
  • Humidity (DHT22)
  • Rain detection
  • Output: Buzzer alert for dry conditions

Node 3 - Greenhouse

  • Temperature and Humidity (DHT22)
  • Light level (LDR)
  • Output: Relay for exhaust fan and grow light

Node 4 - Water Tank

  • Water level (ultrasonic sensor)
  • Water quality (analog TDS sensor)
  • Output: LED status indicators
09

Theme C: Campus Safety System

Node 1 - Hallway

  • Motion detection (PIR)
  • Sound level (analog sound sensor)
  • Emergency button (with interrupt)
  • Output: Buzzer and LED alarm

Node 2 - Laboratory

  • Gas sensor (MQ2)
  • Temperature (LM35)
  • Fire/smoke sensor (analog)
  • Output: Buzzer alarm and relay (gas valve)

Node 3 - Parking Area

  • Light level (LDR)
  • Motion detection
  • Output: Relay for automatic lights

Node 4 - Entrance Gate

  • Door status (reed switch)
  • Motion detection
  • Vibration sensor
  • Output: Buzzer and LED indicator
10

Server ESP32 Requirements

FeatureDescriptionPoints
Wi-Fi ConnectionStation mode with auto-reconnect3
HTTP ServerHandles all API endpoints5
REST APIProper GET/POST with JSON5
LittleFSStores HTML files and logs4
NTP SyncTimestamp all data3
Web DashboardServes real-time dashboard5
Command DistributionSends commands to nodes4
Data LoggingSaves all node readings4
OTA HostingProvides firmware files3
Version ReportingReports firmware version2
Configuration PortalWeb-based configuration3
Error HandlingHandles missing nodes3
Total44
11

Node ESP32 Requirements

FeatureDescriptionPoints
Wi-Fi ConnectionStation mode with auto-reconnect2
Sensor ReadingTimer-based periodic reads2
Data ReportingHTTP POST to server3
Command HandlingHTTP GET from server2
Local StorageBuffer if offline2
PreferencesStore configuration1
Configuration PortalWeb-based setup2
OTA CapableCan receive updates2
Local OutputLED, buzzer, relay, or display1
Error HandlingReconnects, buffers, retries1
Total per Node18
12

Dashboard Requirements

FeatureDescriptionPoints
All 4 Nodes VisibleCards showing each node status3
Real-Time UpdatesAuto-refresh (maximum 5 seconds)3
Data VisualizationCharts showing trends3
Node StatusOnline/offline indicator2
Alert DisplayShows when thresholds are exceeded2
Control ButtonsButtons to send commands3
Historical DataView past readings2
Responsive DesignWorks on phone and desktop2
Total20
13

Project Deliverables

Working Prototype (60% of grade)

Documentation (25% of grade)

Presentation (15% of grade)

14

Four-Week Timeline

Week 1

Planning and Server Foundation

Team formation, theme selection, server basic setup, dashboard skeleton

Week 2

Node Development and Integration

Build all four nodes, test reporting, test commands, integrate

Week 3

Dashboard and Advanced Features

Complete dashboard, OTA, offline buffering, version management

Week 4

Testing, Documentation, Presentation

Final integration testing, documentation, live demo preparation

Time Management Advisory

Weeks 1 and 2 will be the most demanding. Week 3 focuses on refinement. Week 4 is reserved for polishing and presentation. Do not fall behind during the first two weeks.

15

Week 1: Planning and Server Foundation

Deliverables

Milestone Check (End of Week 1)
  • Server responding to HTTP requests
  • Time from NTP visible on Serial Monitor
  • Basic dashboard loading successfully
16

Week 2: Node Development and Integration

Deliverables

Milestone Check (End of Week 2)
  • All four nodes showing data on server
  • Each node has working configuration portal
  • Command sent from server executes on node
17

Week 3: Dashboard and Advanced Features

Deliverables

Milestone Check (End of Week 3)
  • Dashboard shows all four nodes
  • Controls work from browser
  • Data updates every five seconds
  • Disconnect server - nodes buffer data
  • Reconnect server - buffered data syncs
  • OTA update pushes successfully
18

Week 4: Testing, Documentation, and Presentation

Deliverables

Milestone Check (End of Week 4)
  • Working prototype demonstrated
  • All documentation submitted
  • Presentation delivered
  • Question and answer session handled
19

Team Roles and Responsibilities

Role 1 - Server Developer

  • Write all server ESP32 code
  • Implement REST API endpoints
  • Handle data reception from nodes
  • Store data to LittleFS
  • Integrate NTP
  • Test API with Postman

Role 2 - Dashboard Developer

  • Create HTML, CSS, and JavaScript files
  • Design user interface
  • Implement real-time updates
  • Create data visualizations
  • Upload files to LittleFS

Role 3 - Node Developer A

  • Build Nodes 1 and 2
  • Wire sensors and outputs
  • Write node firmware
  • Test data reporting

Role 4 - Node Developer B

  • Build Nodes 3 and 4
  • Wire sensors and outputs
  • Write node firmware
  • Test command handling
20

Server API Endpoints

EndpointMethodPurpose
/GETDashboard page
/api/dataPOSTReceive node data
/api/dataGETQuery stored data
/api/commands/node1GETNode 1 fetches commands
/api/commands/node2GETNode 2 fetches commands
/api/commands/node3GETNode 3 fetches commands
/api/commands/node4GETNode 4 fetches commands
/api/commands/setPOSTBrowser sends command
/api/nodesGETAll nodes status
/api/statusGETServer status
/api/historyGETHistorical data
/api/versionGETFirmware version
/updatePOSTOTA firmware upload
21

Data Format (JSON)

Node sends to server:

{
  "node_id": "NODE_01",
  "node_name": "Entrance",
  "timestamp": "2026-01-15T14:30:45",
  "temperature": 28.5,
  "humidity": 65,
  "motion": true,
  "rssi": -65
}

Server responds to node:

{
  "ack": true,
  "server_time": "2026-01-15T14:30:45",
  "command": "led_on"
}
22

File Structure for Each ESP32

Server ESP32:

ServerProject/
|-- ServerProject.ino
+-- data/
    |-- index.html
    |-- style.css
    +-- script.js

Node ESP32:

NodeProject/
|-- NodeProject.ino
+-- data/
    +-- config.html
Note

The data/ folder must be uploaded separately to LittleFS using the ESP32 LittleFS Data Upload tool in Arduino IDE.

23

Minimum Components

QtyComponent
5ESP32 DevKit V1
3DHT22 Temperature/Humidity
1LM35 Temperature Sensor
2PIR Motion Sensor
1Reed Switch
2LDR with 10k Resistor
1MQ2 Gas Sensor
1Water Leak Sensor
QtyComponent
1ACS712 Current Sensor
2Relay Module (Single Channel)
3Active Buzzer
1OLED Display SSD1306
10LEDs with Resistors
2Large Breadboard
3Jumper Wire Sets
1Push Buttons (pack)
24

Overall Breakdown

ComponentWeightDue Date
Project Proposal5%Week 1
Milestone 1: Server Basic10%End of Week 1
Milestone 2: All Nodes15%End of Week 2
Milestone 3: Dashboard and Features15%End of Week 3
Final Demonstration25%Week 4
Documentation20%Week 4
Code Quality10%Week 4
TOTAL100%
25

Detailed Rubric for Final Demonstration

CriteriaPointsDescription
All four nodes reading sensors5Every node shows data
Server dashboard functional5All nodes visible
Command and control working5Browser controls nodes
OTA updates demonstrated3Live OTA update
NTP timestamps accurate2Correct timestamps
Offline buffering demonstrated3Disconnect and recover
Configuration portal working2Can change Wi-Fi via web
TOTAL25
26

What to Submit

  1. GitHub Repository
    • All source code
    • README.md with setup instructions
    • Commit history showing individual contributions
  2. Documentation (PDF)
    • Project proposal, architecture diagram, circuit diagrams
    • API documentation, user manual, testing results
  3. Video Demonstration (5-10 minutes)
    • System overview, all features demonstrated
    • Explanation of each node, dashboard tour
  4. Live Presentation
    • Working prototype, team presentation, Q and A session
27

Getting Started

Step 1 - Form Your Team

  • Select a team leader
  • Assign preliminary roles
  • Exchange contact information
  • Create a group chat

Step 2 - Select Your Theme

  • Review the three themes carefully
  • Consider available components
  • Submit your choice to the instructor

Step 3 - Development Environment

  • Install Arduino IDE 2.x
  • Install ESP32 board package
  • Install LittleFS upload tool
  • Install required libraries
  • Test upload to ESP32

Step 4 - GitHub Repository

  • One repository per group
  • Add all team members as collaborators
  • Create branches per member
28

Guidelines for Success

Recommended Practices
  • Test each component separately before integration
  • Use the Serial Monitor constantly for debugging
  • Commit code to GitHub frequently
  • Document as you go rather than at the end
  • Ask for help early when stuck
  • Back up your code regularly
Practices to Avoid
  • Waiting until the last week to begin
  • Working alone without communicating
  • Ignoring error messages
  • Applying 5V directly on ESP32 GPIO pins
  • Forgetting to connect all grounds
  • Skipping documentation
Common Mistakes to Avoid
  1. Not testing components individually first
  2. Not handling Wi-Fi disconnection
  3. Hardcoding credentials in source code
  4. Using delay() in the main loop
  5. Not implementing error handling
  6. Waiting until the last week to integrate
29

Frequently Asked Questions

Q: Can we use a different microcontroller?
A: No. The course is specifically about ESP32. All projects must use ESP32.

Q: Can we use a cloud server instead of a local server ESP32?
A: No. One of the required features is a local server ESP32. This demonstrates device-to-device communication.

Q: Can we use Bluetooth instead of Wi-Fi?
A: No. Wi-Fi is required. You may add Bluetooth as an enhancement.

Q: What if a component breaks?
A: Report immediately to your instructor. Have backup components if possible.

Q: Can we use libraries not taught in class?
A: Yes, if you understand what they do and can explain them. Document all libraries used.

Q: Is four weeks enough time?
A: Yes, if you start immediately. Week 1 is critical. Do not delay ordering components.

30

Simplified Scope Option

If your team finds the four-week timeline too tight, here is a simplified scope that still meets the minimum requirements:

Required Elements
  • One Server ESP32 with dashboard
  • Four nodes with at least one sensor each
  • Wi-Fi and HTTP communication
  • Basic configuration portal
  • NTP timestamps
  • LittleFS for logs
Elements that May Be Simplified or Omitted
  • OTA updates (may be demonstrated on one node only)
  • Offline buffering (only buffer ten readings)
  • Detailed dashboard charts (a simple table is acceptable)
  • Multiple sensors per node (one sensor is sufficient)
Result
  • Still earns 70-80 points
  • Much more achievable in four weeks
  • Advanced features may be added in Week 4 if time permits
31

Recommended References

Documentation and Tutorials

Sample Code Repositories

Code References from Previous Modules

32

Acknowledgment Form

By submitting this project, we confirm the following:

GROUP NUMBER: ______

MEMBER SIGNATURES:

1. ____________________________ Date: __________

2. ____________________________ Date: __________

3. ____________________________ Date: __________

4. ____________________________ Date: __________

TEAM LEADER: ___________________

Thank You

Start early. Communicate often. Document everything.

Embedded Systems II
College of Industrial Technology