Skip to content
← All posts

Writing

The AI was the easy part: building an edge waste-sorter that actually moves the trash

Lessons from SWCS — an offline Jetson + YOLO + MobileNetV3 recycling station where 61 ms of inference hid behind 3.3 seconds of mechanics.

Date
Read
2 min
Tags
  • Edge AI
  • Computer Vision
  • Jetson
  • YOLO
  • Robotics

For my final-year project I built SWCS (Smart Waste Classification System) — a small, offline recycling station that doesn't just recognise trash on a screen, but physically sorts it. It runs entirely on the edge: no cloud, no network, made for places like office pantries, labs and school recycling points where nobody's watching the bin.

image.png

The honest takeaway after months of work: the machine learning was the easy part.

Loads from youtube-nocookie.com (YouTube) only when you press play.Watch on YouTube

What it does

Drop an item in. An infrared sensor catches it and stops the conveyor. Cameras grab a frame, YOLOv8 finds the object and crops it, MobileNetV3 classifies the material (paper, plastic, metal, glass, cardboard), and a small Decision Engine fuses the probabilities and applies a confidence gate. If — and only if — the prediction is confident enough, a servo flap swings to route the item; otherwise it stays on the default path and nothing risky happens. A Jetson Orin Nano does the thinking; two Arduinos handle the belt and the servo, talking over USB-serial JSON.

The numbers

On a 120-cycle labelled run (60 metal, 60 non-metal):

  • Offline classifier accuracy: 93.59%
  • End-to-end routing accuracy: 90.8%
  • Recognition time: ~61 ms
  • Full sort cycle: ~3.29 s

Look at those last two again.

Where the time actually goes

Inference: 61 milliseconds. The whole cycle: 3,288 milliseconds. The model was ~2% of the latency. The other 98% was mechanical — servo actuation (~2.7 s) and conveyor recovery. Every instinct says "optimise the model"; the data said "optimise the machine."

The bug that taught me the most

Early on, the sorting flap jittered — it wouldn't hold its commanded angle, so even a perfect classification could fail. The cause wasn't code: the high-torque servo drew more current than the Arduino's logic rail could supply, so the voltage and signal ground sagged. The fix was embarrassingly physical — an independent 5 V supply with a shared ground — and the jitter vanished. Closed-loop accuracy, it turns out, depends on power integrity and grounding as much as on network weights.

What's next

Extend physical routing from the metal test path to all five materials, cut the mechanical latency, and run it for days to see what drifts — cameras, serial links, belt alignment, servo wear. The recognition is ready; the system is where the next gains are.

If you're building anything that turns a model's output into a real-world action: budget your engineering time for the actuator, not the inference.

Written by

Li Yanpei (Lucian)

Self-Taught Full-Stack Software Engineer

View CVContact
ShareLinkedIn(opens in a new tab)

© 2026 lucian-dev.com

Built with Next.js · Set in GeistBuild 5ea771d (opens in a new tab)