G14: Smart Food Freshness Monitor - shalan/CSCE4301-WiKi GitHub Wiki
Smart Food Freshness Monitor
| Name | GitHub |
|---|---|
| Amal Fouda | amalfouda |
| Omar Saleh | omaranwar1 |
Github Repo: https://github.com/amalfouda/Smart-Food-Freshness-Monitor.git
1. The Proposal
Food waste is a growing problem in Egyptian households, made worse by rising food prices and frequent power cuts that raise refrigerator temperatures without the owner noticing. The average family discards food simply because they had no way of knowing it was spoiling until it was already too late, by the time a human detects the smell, the food is gone. The Smart Food Freshness Monitor is an embedded system that detects food spoilage before it becomes visible or smellable. It continuously monitors the gases that spoiling food releases, ammonia, ethanol, and volatile organic compounds, alongside temperature and humidity, and computes a live freshness score from 0 to 100. When the score drops below a critical threshold, the system immediately alerts the user through a buzzer alarm, a colour-coded RGB LED, and an OLED display, while simultaneously updating a live web dashboard accessible on any phone. The system requires no internet connection, no subscription, and no dedicated app. It is entirely self-hosted on the ESP32 microcontroller and is designed to be placed inside or next to any food storage container.
Project Objectives & Scope:
- Read ammonia and VOC levels continuously using MQ-135 sensor
- Read ethanol and fermentation gases using MQ-3 sensor
- Read temperature and humidity using DHT22 sensor
- Compute a weighted freshness score (0–100) updated every 30 seconds
- Display live score, temperature, humidity, and freshness label on OLED
- Drive RGB LED: green above 70, yellow between 40–70, red below 40
- Sound buzzer alarm when score drops below 30 Serve a live Wi-Fi web dashboard showing score history on any phone browser
- Log all readings to SD card with NTP timestamps every 60 seconds
- Self-calibrate in clean air and store baseline to EEPROM
2. System Architecture
2.1 High-Level Block Diagram:

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 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:
A clear breakdown of who worked on what (professors usually require this to grade individual contributions).
7.2 Timeline:

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.