

Smartbin hat
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
5HX711
SOP-16-40℃~+85℃ 1.4mA 10Hz、80Hz 1MHz~20MHz、11.0592MHz 2 2.6V~5.5V 20mV、40mV、80mV 24 Built-in External、Built-in SPI Support Yes SOP-16 Analog to Digital Converters (ADC) ROHSAvia SemiconAnalog To Digital Converters (ADC)MCP3208-BI/P
PDIP-16-40℃~+85℃ 0.5LSB 100kHz 12 1LSB 1MHz、2MHz 2.7V~5.5V 500nA 8 External External Multiplexers、Bipolar input Not supported SAR SPI Yes PDIP-16 Analog to Digital Converters (ADC) ROHSMicrochip TechnologyAnalog To Digital Converters (ADC)M2.5
-0.45mm 2.5mm 2mm 5mm DIN934 Hex M2.5X0.45 Nickel plated Silver white - Hexagonal nutsShuntianHex NutAO3400A
SOT-23-55℃~+150℃ 1 N-channel 1.45V 1.4W 30V 48mΩ@2.5V 5.7A 50pF 630pF 75pF 7nC@10V N-Channel SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETsBC847
SOT-231 NPN 100MHz 100mA 100nA 110 200mW 45V 500mV 6V NPN SOT-23 Bipolar (BJT) ROHSShikuesBipolar (BJT)
README
README.mdsmartbin
a sorting head that drops into a normal trash can and puts recyclables in the right side by itself.
demo video: https://www.youtube.com/shorts/8E3T3RMJy3o


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
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| class | bin |
|---|---|
| rigid_plastic, metal, glass, cardboard_paper | recycle |
| soft_plastic_foam, ewaste_hazard, no_object | trash |
the mapping lives in firmware/config/jurisdiction.yaml, so a different county's rules are a config change.
hardware
| part | notes |
|---|---|
| raspberry pi zero w | armv6, 512 mb, no accelerator |
| camera module 3 | imx708, autofocus |
| mg90s servo | gpio12, hardware pwm |
| hx711 + 5 kg bar load cell | data gpio5, clock gpio6 |
| custom hat pcb | in 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.

| block | parts |
|---|---|
| load cell front end | hx711, pass transistor, feedback divider, 4 caps |
| battery sense | mcp3208 12-bit spi adc, divider, filter |
| servo rail | isolated supply, 470 uf bulk, star ground through one 0r link |
| led ring and break-beam | footprints 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

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.
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 insteadresults on the held-out splits (accuracy):
| split | full mobilenetv3large | pruned, 224 px | pruned, 160 px (on the bin) | small student |
|---|---|---|---|---|
| val | 92.2% | 85.9% | 85.1% | 71.3% |
| test, same sources | 91.5% | 84.0% | 81.2% | 69.4% |
| external test, new sources | 65.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:
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/.venvthe servo uses the pi's hardware pwm, so add this to /boot/firmware/config.txt and reboot:
dtoverlay=pwm,pin=12,func=4then calibrate, once each. the servo needs root because /sys/class/pwm is root-only.
cd ~/SmartBin/firmware
sudo ~/SmartBin/.venv/bin/python -m smartbin.calibrate servo
~/SmartBin/.venv/bin/python -m smartbin.calibrate scale --grams 47the 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:
sudo ~/SmartBin/.venv/bin/python -m smartbinor install it as a service:
sudo cp ~/SmartBin/firmware/smartbin.service /etc/systemd/system/
sudo systemctl enable --now smartbinParts
34| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 100nF | Capacitor_SMD:C_0805_2012Metric | C1, C2, C3, C5, C6, C8 |
| 4 | M2.5 | MountingHole:MountingHole_2.7mm_M2.5 | H1, H2, H3, H4 |
| 2 | 100k | Resistor_SMD:R_0805_2012Metric | R3, R7 |
| 1 | 0R | Resistor_SMD:R_1206_3216Metric | R10 |
| 1 | 100R | Resistor_SMD:R_0805_2012Metric | R6 |
| 1 | 10k | Resistor_SMD:R_0805_2012Metric | R8 |
| 1 | 10uF | Capacitor_SMD:C_0805_2012Metric | C4 |
| 1 | 11k | Resistor_SMD:R_0805_2012Metric | R2 |
| 1 | 12k | Resistor_SMD:R_0805_2012Metric | R1 |
| 1 | 150R | Resistor_SMD:R_0805_2012Metric | R9 |
| 1 | 220R | Resistor_SMD:R_0805_2012Metric | R5 |
| 1 | 22k | Resistor_SMD:R_0805_2012Metric | R4 |
| 1 | 470uF | Capacitor_THT:CP_Radial_D8.0mm_P3.50mm | C7 |
| 1 | AO3400A | Package_TO_SOT_SMD:SOT-23 | Q2 |
| 1 | BC847 | Package_TO_SOT_SMD:SOT-23 | Q1 |
| 1 | Battery sense | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J6 |
| 1 | Beam RX | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J8 |
| 1 | Beam TX | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J9 |
| 1 | HX711 | Package_SO:SOP-16_4.4x10.4mm_P1.27mm | U1 |
| 1 | LED ring | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J7 |
| 1 | Load cell | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J3 |
| 1 | MCP3208 | Package_SO:SOIC-16_3.9x9.9mm_P1.27mm | U2 |
| 1 | Pi GPIO | Connector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_Vertical | J1 |
| 1 | Servo | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J5 |
| 1 | Servo supply | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J4 |
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 mm

- 4 layers99.9 × 123 mm

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 mm

KARCA v2
rice-eclipse/kARCA_v2
Schematics and Board files for the Titan II/Proxima Hybrid Engine Control System
323 parts - 2 layers102 × 37 mm

- 2 layers40 × 65 mm

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 mm

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 mm

Grip strength meter
houseofbigseals/grip_strength_meter_pcb
schematic and pcb for custom esp32 grip strength meter project
123 parts - 4 layers100 × 53 mm

Pressure sensor interface
JackToaster/pressure-sensor-interface
8x pressure sensor and 8x solenoid valve USB interface
194 parts