Skip to the content
PCBKitNew board
2 layers65 × 45 mmSmartbin hat, the printed circuit board in 3D

a sorting head that drops into a normal trash can and puts recyclables in the right side by itself

Size
65 × 45 mm
Copper layers
2
Thickness
1.6 mm
Parts
34
Nets
26
Pads
136
Tracks, vias
585, 99
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
27 Aug 2026
Updated
2 Nov 2026

Overview

Smartbin hat is an open-source printed circuit board by DagaVedant, from the DagaVedant/SmartBin repository on GitHub. It is a 2-layer board of 65 × 45 mm with 34 parts on 26 nets, routed with 585 tracks and 99 vias.

It is built around the HX711, MCP3208-BI/P and M2.5, with the AO3400A and BC847 among its other parts. Its parts include 10 resistors, 8 capacitors, 8 connectors, 2 ICs and 2 transistors.

Main components

5

README

README.md

smartbin

a sorting head that drops into a normal trash can and puts recyclables in the right side by itself.

View PCB on KiCanvas

demo video: https://www.youtube.com/shorts/8E3T3RMJy3o

the pan on its mount, holding an item

pi zero w, hat, camera and servo

what it does

you drop something on the pan. the load cell feels the weight change, the camera photographs the item, and a small neural net running on a pi zero w decides what it is. a servo tilts the pan and the item slides into the recycling side or the trash side. if the net is not sure, it goes to trash.

why

  • public recycling bins get contaminated really easily
  • if enough non-recyclable stuff ends up in one, the facility can reject the whole load, so all of it goes to landfill anyway
  • basically every recycling project i've seen is an app that tells you which bin to use
  • i wanted the bin to just do it, so the person doesn't have to care

how it works

text
item lands on the pan
   -> load cell reading rises above the threshold and settles
   -> camera captures a frame
   -> numpy cnn returns one of 7 classes plus a confidence
   -> the weight nudges the result (a 600 g "paper" is unlikely)
   -> jurisdiction file maps the class to recycle or trash
   -> below the confidence threshold it goes to trash
   -> "no_object" means a false trigger, so the pan stays level
   -> servo tilts, item slides, pan returns level, scale re-zeroes
   -> event written to sqlite, served as json by a small api
classbin
rigid_plastic, metal, glass, cardboard_paperrecycle
soft_plastic_foam, ewaste_hazard, no_objecttrash

the mapping lives in firmware/config/jurisdiction.yaml, so a different county's rules are a config change.

hardware

partnotes
raspberry pi zero warmv6, 512 mb, no accelerator
camera module 3imx708, autofocus
mg90s servogpio12, hardware pwm
hx711 + 5 kg bar load celldata gpio5, clock gpio6
custom hat pcbin PCB/

the full parts list with prices is BOM.csv.

the board

65 x 45 mm, 2 layers, pi zero hat footprint. fully routed, ground plane poured, drc clean.

board

blockparts
load cell front endhx711, pass transistor, feedback divider, 4 caps
battery sensemcp3208 12-bit spi adc, divider, filter
servo railisolated supply, 470 uf bulk, star ground through one 0r link
led ring and break-beamfootprints are on the board but not used in the current build
  • the hx711 runs at 3.3 v, not 5 v, so the gpio can read it without level shifting
  • the two grounds meet at exactly one point, so a stalling servo cannot brown out the pi
  • the servo is on gpio12 because that pin is a hardware pwm channel

source files are in PCB/: .kicad_pro, .kicad_sch, .kicad_pcb, schematic.pdf, and gerbers.zip.

the mechanics

assembly

the classifier

the pi zero w has no tflite or onnx wheels, so the classifier runs in plain numpy from a single .npz file (firmware/smartbin/nn.py and firmware/smartbin/graphnet.py). accuracy matters more than speed here, so the model is the mobilenetv3large at 224 px with batch norm folded into the convolutions and the weights stored as fp16. the numpy version gives the same answers as keras, within 0.011 in probability.

to make it faster, i removed the hidden channels with the smallest weights and then trained the smaller network against the full model (ml/prune.py). the model on the bin removes 60 percent of them and runs at 160 px, which cuts the compute from 214m to 69m multiply-adds. a gentler version that removes 50 percent and keeps 224 px is also in the repo.

text
python ml/cache.py --manifest <manifest.csv> --root <dataset root>   decode crops once at 224 px
python ml/export_teacher.py --teacher <teacher.weights.h5>           write firmware/models/smartbin-teacher.npz
python ml/prune.py --ratio 0.6 --size 160 --epochs 20 --out firmware/models/smartbin-fast.npz
python ml/distill.py --teacher <teacher.weights.h5>                  optional, train the small student instead

results on the held-out splits (accuracy):

splitfull mobilenetv3largepruned, 224 pxpruned, 160 px (on the bin)small student
val92.2%85.9%85.1%71.3%
test, same sources91.5%84.0%81.2%69.4%
external test, new sources65.4%62.8%63.0%51.9%

the model on the bin is 3.0 mb and takes about 17 ms per image in numpy on a laptop. i have not timed it on the zero w yet, and i expect roughly 2 to 3 seconds per image there. all of the models are in firmware/models/ and can be selected in firmware/config/device.yaml.

running it on the pi

install the python packages from apt, because a zero w has no wheels for them:

text
sudo apt install git python3-venv python3-numpy python3-pil python3-yaml python3-lgpio \
  python3-picamera2 python3-fastapi python3-uvicorn python3-pydantic python3-pydantic-core
git clone https://github.com/DagaVedant/SmartBin.git ~/SmartBin
python3 -m venv --system-site-packages ~/SmartBin/.venv

the servo uses the pi's hardware pwm, so add this to /boot/firmware/config.txt and reboot:

text
dtoverlay=pwm,pin=12,func=4

then calibrate, once each. the servo needs root because /sys/class/pwm is root-only.

text
cd ~/SmartBin/firmware
sudo ~/SmartBin/.venv/bin/python -m smartbin.calibrate servo
~/SmartBin/.venv/bin/python -m smartbin.calibrate scale --grams 47

the scale step asks you to empty the pan, then place a known mass (47 g here) on it, and stores the result in firmware/config/scale_cal.json.

run it:

text
sudo ~/SmartBin/.venv/bin/python -m smartbin

or install it as a service:

text
sudo cp ~/SmartBin/firmware/smartbin.service /etc/systemd/system/
sudo systemctl enable --now smartbin

Parts

34
QtyValueFootprintReferences
6100nFCapacitor_SMD:C_0805_2012MetricC1, C2, C3, C5, C6, C8
4M2.5MountingHole:MountingHole_2.7mm_M2.5H1, H2, H3, H4
2100kResistor_SMD:R_0805_2012MetricR3, R7
10RResistor_SMD:R_1206_3216MetricR10
1100RResistor_SMD:R_0805_2012MetricR6
110kResistor_SMD:R_0805_2012MetricR8
110uFCapacitor_SMD:C_0805_2012MetricC4
111kResistor_SMD:R_0805_2012MetricR2
112kResistor_SMD:R_0805_2012MetricR1
1150RResistor_SMD:R_0805_2012MetricR9
1220RResistor_SMD:R_0805_2012MetricR5
122kResistor_SMD:R_0805_2012MetricR4
1470uFCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC7
1AO3400APackage_TO_SOT_SMD:SOT-23Q2
1BC847Package_TO_SOT_SMD:SOT-23Q1
1Battery senseConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ6
1Beam RXConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8
1Beam TXConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ9
1HX711Package_SO:SOP-16_4.4x10.4mm_P1.27mmU1
1LED ringConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ7
1Load cellConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1MCP3208Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU2
1Pi GPIOConnector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_VerticalJ1
1ServoConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ5
1Servo supplyConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ4

Questions

How big is the Smartbin hat PCB?

It measures 65 × 45 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Smartbin hat use?

34 parts, built around the HX711, MCP3208-BI/P, M2.5 and AO3400A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Smartbin hat KiCad files?

From the DagaVedant/SmartBin repository on GitHub, at the commit this page was made from: the board is PCB/smartbin-hat.kicad_pcb and its schematic PCB/smartbin-hat.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smartbin hat design in my own project?

Its repository states no licence, so its author keeps all rights: ask DagaVedant before reusing the design.

Similar boards

  • 2 layers150 × 100 mmSatelliteController2.0, the printed circuit board in 3D

    SatelliteController2.0

    tokai-student-rocket-project/Gen6-GSE-Elec

    第6世代自動GSE電装系

    228 parts2MIT
  • 4 layers99.9 × 123 mmUEFI rev3, the printed circuit board in 3D

    UEFI rev3

    Churrosoft/kibot_test

    export KICAD63DMODELDIR="/usr/share/kicad/3dmodels/" export KICAD6FOOTPRINTDIR="/usr/share/kicad/footprints/" export KICAD6SYMBOLDIR="/usr/share/kicad/symbols/" export KICAD6TEMPLATEDIR="/usr/share/kicad/template/"

    260 parts
  • 4 layers250 × 145 mmKARCA v2, the printed circuit board in 3D

    KARCA v2

    rice-eclipse/kARCA_v2

    Schematics and Board files for the Titan II/Proxima Hybrid Engine Control System

    323 parts
  • 2 layers102 × 37 mmCoffee grams, the printed circuit board in 3D

    Coffee grams

    enochchau/coffee_grams

    46 parts
  • 2 layers40 × 65 mmWifi voltmeter, the printed circuit board in 3D

    Wifi voltmeter

    makerspacelt/wifi-voltmeter

    Dev NOTE: before commit, run ./kibot.sh to regenerate documentation, bom, gerbers and other assets.

    60 parts2CERN-OHL-S-2.0
  • 4 layers70 × 45 mmMini dyno, the printed circuit board in 3D

    Mini dyno

    EhlOps/mini-dyno

    The mini dyno (dynamometer) is a tool created to measure the torque and power output of an engine or motor. The mechanical portion of the dyno functions as a water brake.

    58 partsCERN-OHL-P-2.0
  • 4 layers99 × 60 mmGrip strength meter, the printed circuit board in 3D

    Grip strength meter

    houseofbigseals/grip_strength_meter_pcb

    schematic and pcb for custom esp32 grip strength meter project

    123 parts
  • 4 layers100 × 53 mmPressure sensor interface, the printed circuit board in 3D

    Pressure sensor interface

    JackToaster/pressure-sensor-interface

    8x pressure sensor and 8x solenoid valve USB interface

    194 parts