Smart dustbin with fill level and route report
Municipal bins overflow while trucks visit half-empty ones on a fixed schedule. Bins that report how full they are let the truck visit only those that need it, in line with Swachh Bharat goals.
- Parts
- ₹1,375
- Build
- 8 weeks
- Board
- ESP32
- Objectives
- 5
Block diagram
- Ultrasonic sensor in the lidMeasures how full the bin is
- IR sensorOpens the lid when a hand comes near
- ESP32Reports the fill level
- ServoLifts the lid
- Cloud dashboardStores readings, plots trends and sends alerts+
Objectives
- To measure the fill level in percent.
- To open the lid hands-free and close it after three seconds.
- To report fill level to a dashboard.
- To plan a collection order from the reported levels of several bins.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
Parts and specifications
- ESP32 DevKit V1Dual-core 240 MHz, 520 KB SRAM, Wi-Fi + Bluetooth, 3.3 V logic, 12-bit ADC (use ADC1 pins when Wi-Fi is on)₹450Buy
- HC-SR04 ultrasonic sensor2 cm to 4 m, 15° beam, 40 kHz, 10 µs trigger, echo pulse 58 µs per cm, 5 V₹80Buy
- IR obstacle sensor moduleReflective IR pair with LM393, 2 to 30 cm set by trimmer, digital out, sunlight can false-trigger₹40Buy
- MG996R metal gear servo9.4 kg·cm at 4.8 V, 0 to 180°, stall up to 2.5 A so give it its own 5 to 6 V supply₹350Buy
- Dustbin with hinged lid₹250
- 1 kΩ and 2 kΩ resistors (echo divider)₹5
- 5 V 2 A USB adapter and wires₹200
Total about ₹1,375 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Bin depth 40 cm, sensor 2 cm below the lid. Fill % = (40 − (d − 2)) / 40 × 100. d = 12 cm gives 75%.
Vout = 5 × 2 / (1 + 2) = 3.33 V, safe for the ESP32 input.
With fill levels from several bins, visit only bins above 70%, ordered by nearest-next from the depot, and compare distance with a fixed route.
Pin map
| Signal | Pin or connection |
|---|---|
| HC-SR04 TRIG | GPIO 5 |
| HC-SR04 ECHO | GPIO 18 through 1 kΩ / 2 kΩ divider (5 V → 3.3 V) |
| IR sensor OUT | GPIO 27 |
| Servo signal | GPIO 13 (servo on 5 V, common ground) |
Firmware outline
- When the IR sensor sees a hand, open the lid to 90°, wait 3 s after it leaves, close.
- Measure fill only with the lid closed, as a median of 5.
- Every 10 minutes post bin ID and fill % to the dashboard.
- Flag 'Full' above 85% on an LED.
Test plan
| Test | Expected result |
|---|---|
| Empty, half and full bin | Fill within ±5% |
| Hand near the lid | Opens within 0.5 s |
| Paper vs crumpled bags | Note how uneven waste affects the reading |
| Five bins with set levels | Route skips nearly empty bins |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Datasheets and sources to cite
- HC-SR04 user guide
- Swachh Bharat Mission (Urban) solid waste guidelines
- Solid Waste Management Rules 2016
About this project
How much does the smart dustbin with fill level and route report project cost?
About ₹1,375 for the parts in the base list: ESP32 DevKit V1, HC-SR04 ultrasonic sensor, IR obstacle sensor module, MG996R metal gear servo, Dustbin with hinged lid, 1 kΩ and 2 kΩ resistors (echo divider), 5 V 2 A USB adapter and wires.
How long does it take?
About 6 weeks for the base project, built on an ESP32. Each upgrade adds time.
Which branches is it suitable for?
Electronics and Communication, Computer Science / IT (IoT, AI), Diploma (any electronics branch), as a mini project.
Which pins and design calculations does it use?
HC-SR04 TRIG on GPIO 5; HC-SR04 ECHO on GPIO 18 through 1 kΩ / 2 kΩ divider (5 V → 3.3 V); IR sensor OUT on GPIO 27. Worked calculations on this page: fill level, echo divider, route order.
How do I test it?
Empty, half and full bin: Fill within ±5%. Hand near the lid: Opens within 0.5 s. Paper vs crumpled bags: Note how uneven waste affects the reading. Five bins with set levels: Route skips nearly empty bins.
What are the objectives?
To measure the fill level in percent. To open the lid hands-free and close it after three seconds. To report fill level to a dashboard. To plan a collection order from the reported levels of several bins.
