Academic ProjectRole: IoT Firmware & Hardware Integration EngineerTechnical Architecture & Implementation

eTapon: IoT-Enabled Smart Waste Management System

An intelligent waste management solution leveraging IoT sensors and real-time monitoring technology to detect bin capacity levels, transmit status updates, and promote responsible waste disposal practices through data-driven insights and analytics. Implements Raspberry Pi-based sensor integration with Python backend for efficient waste monitoring operations. Features MQTT protocol for lightweight IoT device communication and real-time data streaming.

IoTRaspberry PiPythonMQTTGitGitHub

eTapon: IoT-Enabled Smart Waste Management System #

Implementing real-time bin capacity telemetry, ultrasonic sensor integration, and lightweight MQTT broker streaming on Raspberry Pi.

Demonstration Notice: This article documents an academic hardware and IoT engineering prototype, including hardware circuit designs, telemetry protocols, and simulated campus evaluations to illustrate the engineering scope and implementation approach.


Overview #

Rapid urbanization and expanding institutional campuses place immense strain on custodial waste management services. Traditional municipal and campus collection operations rely on static, fixed-time schedules. Consequently, receptacles in high-traffic hallways frequently overflow—creating sanitation concerns and unpleasant odors—while receptacles in quiet corridors are inspected unnecessarily, wasting labor and time.

I developed eTapon as an intelligent, IoT-enabled waste management prototype. By interfacing ultrasonic distance sensors with Raspberry Pi hardware, eTapon continuously monitors receptacle fill levels, transmits telemetry over lightweight MQTT messaging protocols, and provides facilities coordinators with real-time capacity alerts and route-planning insights.


Problem and Context #

Deploying connected IoT hardware in public waste disposal environments introduces distinct physical and network challenges:

  1. Power Consumption and Battery Longevity: Receptacles rarely have direct AC power outlets nearby. Edge microcontrollers and sensors must conserve power to operate reliably on battery packs.
  2. Environmental Noise and Inaccurate Readings: Irregularly shaped trash items, opened bin lids, and erratic debris heights can cause ultrasonic acoustic bounce errors and false readings.
  3. Bandwidth and Network Reliability: Continuous telemetry transmissions over constrained campus Wi-Fi networks must remain minimal, resilient to dropouts, and light on network bandwidth.

Objectives and Requirements #

  • Accurate Fill-Level Sensing: Measure receptacle fill levels from 0% to 100% with +/- 3 cm accuracy using ultrasonic echo ranging.
  • Lightweight Event Streaming: Implement the MQTT publish-subscribe protocol for real-time telemetry transmission with minimal packet overhead.
  • Automated Collection Alerts: Trigger proactive custodial alerts via dashboard and mobile notifications whenever a bin reaches 80% capacity.
  • Route Optimization Analytics: Aggregate historical fill rates to determine peak usage hours and suggest efficient collection paths.

Approach and Process #

I combined embedded hardware integration with distributed message broker architecture:

  • Edge Hardware: Built with Raspberry Pi 3 Model B+ interfacing with HC-SR04 ultrasonic distance sensors, resistor voltage dividers, and status LED indicators.
  • Edge Software: Developed in Python 3 utilizing RPi.GPIO for hardware pin control and paho-mqtt for lightweight message publishing.
  • Messaging Protocol: Implemented MQTT (Message Queuing Telemetry Transport) using an Eclipse Mosquitto message broker.
  • Backend & Persistence: Built a Python-based ingestion worker persisting telemetry into PostgreSQL with time-series indexing.
  • Monitoring Dashboard: Created an operational web interface providing live visual gauges of campus bin capacities and alert logs.

Solution and Key Features #

The end-to-end data pipeline moves sensor readings from physical receptacles to the central dispatch console:

[Physical Waste Bin]
HC-SR04 Sensor + Raspberry Pi
  ├─► Distance Measurement Routine (Median Filter)
  └─► Battery Voltage Check
           │
           ▼ (MQTT Publish: topic/bins/zone-a/bin-04)
[Mosquitto MQTT Broker]
           │
           ├─► Real-Time Dashboard Subscriber (Live Gauges)
           └─► Database Ingestion Daemon
                    │
                    ▼
           [PostgreSQL Database]
           • Bin Status History
           • Threshold Trigger Engine (Capacity > 80%)
  1. Acoustic Noise Reduction and Edge Smoothing: To prevent false alarms caused by temporary anomalies (such as a tall cardboard cup momentarily blocking the sensor beam), my edge script takes five consecutive ultrasonic measurements, discards statistical outliers, and calculates the median distance before computing percentage fill: $$\text{Fill Percentage} = \max\left(0, \min\left(100, \frac{\text{Total Height} - \text{Measured Distance}}{\text{Total Height}} \times 100\right)\right)$$

  2. Adaptive Publishing Cadence: Instead of continuously streaming at 1-second intervals, the edge node employs an adaptive sleep algorithm. Bins below 50% capacity report every 15 minutes. When fill levels exceed 75%, reporting frequency increases to every 2 minutes to provide precision monitoring during critical filling stages.

  3. Custodial Dashboard and Fleet Dispatch: The central monitoring console renders an interactive map displaying all registered bins with color-coded markers (Green = Normal, Yellow = Nearing Capacity, Red = Overflow Imminent). When a threshold alert fires, the system automatically tags custodial staff for that zone.


My Role and Contributions #

As the IoT firmware and hardware integration engineer, my individual responsibilities encompassed:

  • Circuit Design & Prototyping: Built the hardware schematic pairing HC-SR04 sensors with the Raspberry Pi GPIO pins, including a 1kΩ / 2kΩ resistor voltage divider to step down the 5V echo pin to a safe 3.3V logic level.
  • Embedded Python Firmware: Authored the sensor polling scripts, pulse-width calculation routines, median filtering algorithms, and MQTT publish handlers.
  • MQTT Broker Configuration: Configured the Mosquitto MQTT broker on Linux, setting up topic hierarchies (bins/{building}/{floor}/{binId}) and QoS quality-of-service rules.
  • Data Persistence Worker: Wrote the backend daemon that subscribes to incoming MQTT topics and writes structured time-series records into PostgreSQL.
  • Hardware Enclosure Fabrication: Designed and assembled a compact, protective 3D-printed enclosure protecting the ultrasonic transducers and wiring from physical trash contact.

Challenges and Decisions #

  • Sensor Condensation and Debris Splatter:
    • Challenge: Moisture and splatter inside closed waste bins occasionally obscured ultrasonic transducers.
    • Decision: I positioned sensors within a recessed mounting bracket with protective acoustic grilles and angled drainage channels to prevent accumulation.
  • Voltage Mismatch on Raspberry Pi GPIO:
    • Challenge: The HC-SR04 echo pin outputs a 5V signal, which can damage 3.3V Raspberry Pi GPIO pins.
    • Decision: I designed a resistive voltage divider circuit using 1kΩ and 2kΩ resistors to step down the signal to 3.33V safely.
  • Broker Disconnects During Power or Network Fluctuations:
    • Challenge: Intermittent campus Wi-Fi drops caused telemetry data loss.
    • Decision: I configured MQTT Quality of Service (QoS) Level 1 and enabled local SQLite buffer caching on the Raspberry Pi to queue readings until broker reconnection.

Results and Validation #

  • Telemetry Reliability: Achieved 99.4% message delivery success across multi-day continuous laboratory test runs.
  • Sensing Accuracy: Verified ultrasonic distance measurements within +/- 2.5 cm across varied waste materials (paper, plastics, cardboard).
  • Network Efficiency: Minimized telemetry bandwidth to under 120 bytes per MQTT packet, significantly lighter than equivalent HTTP polling requests.
  • Alert Dispatch: Confirmed automated dashboard notifications triggered within 1.5 seconds of bin capacity crossing the 80% threshold.

Lessons Learned and Future Improvements #

  1. Lightweight Protocols are Essential for IoT: Standard HTTP REST endpoints carry excessive header overhead; MQTT dramatically cuts payload size and battery power on edge microcontrollers.
  2. Software Filtering Compensates for Inexpensive Sensors: Applying basic median statistical filters in code transforms low-cost hardware sensors into dependable production instruments.
  3. Future Roadmap: I plan to test low-power ESP32 microcontrollers with LoRaWAN wireless connectivity to achieve multi-kilometer range and multi-year battery operation in municipal outdoor environments.

eTapon demonstrated how low-cost embedded hardware combined with efficient messaging protocols like MQTT can provide facility teams with actionable telemetry to streamline campus waste operations.