Smart Dustbin

It opens by itself.
And it tells the city
when it is full.

Three ultrasonic sensors, one servo motor and an Arduino UNO. One sensor watches the front and lifts the lid before you touch it. Two more sit inside and measure the waste from opposite corners, so an uneven pile of rubbish never fools the reading.

See the live city map Open the admin console

Live city status

Every bin reports its fill level. Anything above 90% is flagged for immediate collection.

Bins deployed
-
across 10 zones
Normal
-
below 75% full
Near full
-
75% to 89%
Needs collection
-
90% and above
Average fill
-
city wide

All bins

updating...
BinLocationZoneType Fill levelStatusLast seen

Try the firmware yourself

This is not a video or a mock-up. It is the same state machine that runs on the ESP32 — same thresholds, same timings, same sensor-fusion rule — ported to JavaScript and running in your browser right now. Move a slider and the lid reacts exactly as the real bin would.

Lid state
CLOSED
Bin status
OK
Fused fill
0%
A / B spread
0%
Sensors live
2 / 2
Green LED
ON
Red LED
OFF
Buzzer
SILENT
Lid opens
0

Serial Monitor (115200 baud)

Press β€œUneven pile”. Sensor A reads 90% and sensor B reads 10% — a bag dropped on one side. A bin with a single sensor mounted where A is would declare itself full and send a collection van to a half-empty bin. The fused reading is 50%, and the firmware raises an UNEVEN LOAD flag instead. That is the reason there are two sensors inside.

How it works

Eight steps, from a hand approaching the bin to a van being dispatched.

1. Hand approaches→ 2. Ultrasonic sensor→ 3. Microcontroller→ 4. Servo motor→ 5. Lid opens→ 6. Level sensor→ 7. Full-bin alert→ 8. LED / buzzer / dashboard

Touchless lid

An HC-SR04 sensor measures the distance to whatever is in front of the bin many times a second. Under 25 cm, the microcontroller drives a servo to 90° and the lid lifts. Nobody touches a dirty surface.

Two sensors inside

Rubbish is never flat. One sensor over a peak would shout "full" while the bin is half empty. Two sensors on opposite diagonals are averaged, so a 15 cm gap in a 30 cm bin really does mean half full — and a big disagreement between them flags a load piled to one side.

Alerts that mean something

Green under 75%. Amber blink from 75%. Solid red plus a short beep at 90%, and the bin appears in red on the city map so a van is routed to it before rubbish ends up on the pavement.

Where this is used

The same design scales from a single classroom bin to a municipal fleet.

Hospitals

Touchless disposal cuts a contamination path in wards and corridors. Full-bin alerts keep clinical waste from overflowing.

Airports and stations

Very high footfall, very uneven filling. Level data tells cleaning staff which of 400 bins actually needs attention right now.

Malls and offices

Fewer pointless inspection rounds. Housekeeping is dispatched by data instead of by a fixed timetable.

Smart cities

Collection routes are planned from live fill levels, which cuts fuel, vehicle hours and missed pickups.

Campuses

A cheap, visible sustainability project that students can maintain and extend themselves.

Industrial sites

Segregated waste streams are monitored separately, which supports compliance reporting and audits.

Technology

Hardware

ControllerArduino UNO (ATmega328P) or ESP32
Sensors3 × HC-SR04 — 1 hand, 2 in-bin
ActuatorSG90 servo motor, PWM controlled
IndicatorsGreen LED, red LED, active buzzer
Display16×2 I2C LCD (optional)
Power5 V / 2 A supply or 4×AA pack

Firmware

LanguageEmbedded C / C++ (Arduino)
ArchitectureNon-blocking cooperative scheduler
Lid control4-state machine with safety re-open
FilteringMedian-of-3, then dual-sensor fusion
TelemetryHuman + JSON lines over UART
SimulationWokwi, Tinkercad, browser twin

About this project

Smart Dustbin - Industry Oriented Embedded System is an academic project that covers the full path from a sensor pulse to a city dashboard: GPIO, PWM, ultrasonic timing, threshold logic, state machines, calibration, testing and a management console. Everything runs in simulation, so no hardware is required to reproduce the results.