Automated Waste Segregator | Arduino Nano Kids Robotics Project

♻️ Automated Waste Segregator | Arduino Nano Kids Robotics Project | MakeMindz
♻️ Arduino Nano Eco-Robotics Project

Automated Waste
Segregator Robot

Build a smart dustbin that weighs and measures waste, then automatically sorts it into the right bin — wet, dry, or metal! ♻️🤖

NanoArduino Brain
Load CellWeight Sensor
~₹950Total Cost
3 hrsBuild Time
MediumDifficulty
The Big Idea

How Does an Automated Waste Segregator Work? 🤔

⚖️

The Load Cell is a Tiny Weighing Scale!

Just like the scale your mum uses in the kitchen, a load cell measures weight. When you drop trash onto it, tiny strain gauges inside bend ever so slightly — the HX711 amplifier converts that bend into a number Arduino can read. Heavy items (like metal cans) weigh differently than light items (like paper)!

📏

The Ultrasonic Sensor "Sees" Size and Shape

Bats use echolocation to "see" in the dark — they send out sound waves and listen for the echo bouncing back. Our ultrasonic sensor does the same thing! It measures how far away an object is, which helps estimate its size/bulkiness — a crushed can looks different to "echo" than a soft wet peel.

🚪

The Servo Motor is a Tiny Robot Arm Gatekeeper

Once Arduino decides which bin the waste belongs to, it tells a servo motor to rotate a sorting flap — like a railway track switch that decides which platform a train goes to! The flap tilts left, right, or stays straight to guide trash into the correct bin.

The Sorting Logic 🧮

🥬
WET WASTE
Heavier for its size, often soft/squishy (food scraps, peels)
weight > 80g
📦
DRY WASTE
Light weight, larger bulk (paper, plastic wrappers, cardboard)
weight ≤ 80g & size large
🥫
METAL WASTE
Light weight, but compact/dense for its size (cans, foil)
weight ≤ 80g & size small
🎓

Real recyclers use sensors too! Actual recycling plants use a mix of cameras, magnets, infrared, and weight sensors to sort tons of garbage every day. Our project uses the same basic principle — just on a much smaller, kid-friendly scale!

Shopping List

Parts You'll Need 🛒

All available at electronics shops or online stores like Robu.in, Robocraze, or Amazon. Ask a parent or teacher to help you buy them!

🎛️
Arduino Nano
× 1 — The brain
⚖️
Load Cell (1kg) + HX711 Module
× 1 set — Weighing sensor
📡
HC-SR04 Ultrasonic Sensor
× 1 — Size/distance detection
⚙️
SG90 Micro Servo Motor
× 1 — Sorting flap control
📺
16×2 LCD Display
× 1 — Shows sorting result
🔔
Buzzer (5V)
× 1 — Sort confirmation beep
🎚️
Potentiometer 10kΩ
× 1 — LCD contrast
🧱
Breadboard
× 1 — Wiring base
🌈
Jumper Wires
× 25 — Male-to-Male
📦
Cardboard Box (with 3 bins)
for the bin structure
🍽️
Small Platform / Tray
sits on load cell
💻
USB Mini Cable
× 1 — Programming Nano
💡

What is a Load Cell? It's a metal bar with tiny strain gauges glued onto it. When weight presses down, the bar bends a tiny amount — even less than a hair's width! The HX711 module amplifies this microscopic signal into something Arduino can understand as a clear weight number.

Phase 01

Building the Bin Structure 📦

1

Prepare a sturdy cardboard box

Use a medium-sized cardboard box (like a shoebox or shipping box) as the outer frame. Cut the top open so waste can be dropped in.

2

Create 3 internal compartments

Use cardboard dividers to split the inside into 3 sections side by side: Wet (left), Dry (middle), Metal (right). Label each clearly with markers or stickers.

3

Mount the weighing platform at the top

Attach a small flat tray (like a sturdy plastic lid) onto the load cell, and fix the load cell horizontally just below the drop opening. This is where waste lands first to be weighed.

4

Build the sorting flap/chute

Cut a piece of stiff cardboard into a flap shape that can swing left-right-center. Attach it to the servo motor's rotating arm just below the weighing platform — gravity does the rest, guiding waste down the correct side!

5

Mount the ultrasonic sensor above the platform

Fix the HC-SR04 sensor facing straight down, just above the weighing tray, so it can measure how tall/bulky the waste item is as it sits there.

6

Place Arduino and LCD on the outside

Mount the Arduino Nano, breadboard, and LCD display on the outer wall of the box where they're visible and protected from falling waste.

Keep it dry! This is a model/demo project — use only clean, dry test items (empty plastic bottles, paper balls, empty cans) rather than actual wet food waste, to protect the electronics from moisture.

Phase 02

Circuit Diagram & Wiring

Safety first! Always unplug Arduino from USB before changing any wires. Be gentle with the load cell wires — they're thin and can snap if pulled too hard!

ARDUINO NANO D2(DT) D3(SCK) D4(Trig) D5(Echo) D9(Servo) D8(Buzzer) D7(RS) D6(EN) D10(D4) D11(D5) D12(D6) D13(D7) 5V GND LOAD CELL RED BLK WHT GRN HX711 Amplifier VCC GND DT SCK HC-SR04 VCC TRIG ECHO GND SG90 SERVO VCC GND SIG 16×2 LCD DISPLAY Sorting: METAL Wt: 42g Sz: small BUZZER WIRE LEGEND Power 5V GND HX711 DT HX711 SCK Echo/Trig Servo Signal LCD Data Buzzer

Complete Wiring Table

#FromToWirePurpose
1Load Cell RedHX711 E+REDLoad cell excitation +
2Load Cell BlackHX711 E−BLACKLoad cell excitation −
3Load Cell WhiteHX711 A−WHITESignal negative
4Load Cell GreenHX711 A+GREENSignal positive
5HX711 VCCArduino 5VYELLOWPower HX711
6HX711 GNDArduino GNDBLACKGround HX711
7HX711 DTArduino Pin D2PURPLEWeight data signal
8HX711 SCKArduino Pin D3BLUEClock signal
9HC-SR04 VCCArduino 5VYELLOWPower ultrasonic sensor
10HC-SR04 TrigArduino Pin D4ORANGESend sound pulse
11HC-SR04 EchoArduino Pin D5YELLOWReceive echo
12HC-SR04 GNDArduino GNDBLACKGround sensor
13Servo SignalArduino Pin D9BLUEFlap rotation control
14Servo VCCArduino 5VORANGEPower servo
15Servo GNDArduino GNDBLACKGround servo
16LCD RS, EN, D4-D7Arduino D7,D6,D10-D13GREENLCD control & data
17LCD VSS, RW, KArduino GNDBLACKGround pins
18LCD VDD, AArduino 5VYELLOWPower pins
19Buzzer (+)Arduino Pin D8REDSort confirmation beep
20Buzzer (−)Arduino GNDBLACKGround buzzer
💡

Arduino Nano has fewer pins than Uno! If you run out of digital pins, you can reuse A0-A6 as digital pins too (e.g. A0 works just like D14). The code below already accounts for this!

Phase 03

The Arduino Code 💻

📦

Libraries needed: Install "HX711" (by bogde) and "Servo" and "LiquidCrystal" via Arduino IDE → Tools → Manage Libraries. Servo and LiquidCrystal usually come built-in!

Arduino C++ — Waste Segregator
// =============================================================
// ♻️ AUTOMATED WASTE SEGREGATOR — Arduino Nano
//    MakeMindz | Kids Eco-Robotics Project
//    Load cell weighs waste + ultrasonic measures size →
//    Servo flap sorts into Wet / Dry / Metal bins!
// =============================================================

#include <HX711.h>
#include <Servo.h>
#include <LiquidCrystal.h>

// ── PIN DEFINITIONS ──────────────────────────────────────
const int HX711_DT  = 2;
const int HX711_SCK = 3;
const int TRIG_PIN  = 4;
const int ECHO_PIN  = 5;
const int SERVO_PIN = 9;
const int BUZZER_PIN= 8;

// LCD pins: RS, EN, D4, D5, D6, D7
LiquidCrystal lcd(7, 6, 10, 11, 12, 13);
HX711 scale;
Servo sortServo;

// ── SETTINGS — Tune these after calibration! ─────────────
const float CALIBRATION_FACTOR = -420.0; // See calibration section!
const float WEIGHT_THRESHOLD   = 80.0;   // grams — wet vs dry/metal
const float SIZE_THRESHOLD_CM  = 6.0;    // cm — large vs small
const int   FLAP_WET   = 30;   // Servo angle for WET bin
const int   FLAP_DRY   = 90;   // Servo angle for DRY bin (center)
const int   FLAP_METAL = 150;  // Servo angle for METAL bin

// =============================================================
//  SETUP
// =============================================================
void setup() {
  Serial.begin(9600);
  Serial.println("♻️  Waste Segregator Starting...");

  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);

  sortServo.attach(SERVO_PIN);
  sortServo.write(FLAP_DRY); // Start centered

  scale.begin(HX711_DT, HX711_SCK);
  scale.set_scale(CALIBRATION_FACTOR);
  scale.tare(); // Reset to 0 with empty platform

  lcd.begin(16, 2);
  lcd.print("Waste Segregator");
  lcd.setCursor(0, 1);
  lcd.print("Ready to sort!");
  delay(1500);

  Serial.println("✅ Ready! Drop an item to sort.");
}

// =============================================================
//  LOOP
// =============================================================
void loop() {
  float weight = scale.get_units(5); // Average of 5 readings
  if (weight < 0) weight = 0;

  // ── STEP 1: Wait until something is placed (weight detected) ──
  if (weight > 5.0) { // 5g minimum to avoid noise
    delay(800); // Let it settle
    weight = scale.get_units(10); // Re-read more accurately

    // ── STEP 2: Measure size with ultrasonic sensor ─────────────
    float distance = measureDistance();
    float height   = 15.0 - distance; // Sensor mounted 15cm above tray

    Serial.print("⚖️  Weight: "); Serial.print(weight); Serial.println(" g");
    Serial.print("📏 Height: "); Serial.print(height);  Serial.println(" cm");

    // ── STEP 3: Decide the category ──────────────────────────────
    String category = classifyWaste(weight, height);
    Serial.print("🗑️  Category: "); Serial.println(category);

    // ── STEP 4: Move flap + show on LCD + beep ───────────────────
    sortInto(category);
    showResult(category, weight, height);
    tone(BUZZER_PIN, 1500, 200);

    delay(2500); // Let item fall through & show result
    sortServo.write(FLAP_DRY); // Reset flap to center
    scale.tare();             // Re-zero for next item

    lcd.clear();
    lcd.print("Ready to sort!");
  }
}

// =============================================================
//  HELPER FUNCTIONS
// =============================================================
float measureDistance() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  long duration = pulseIn(ECHO_PIN, HIGH);
  float cm = duration * 0.0343 / 2;
  return cm;
}

String classifyWaste(float weight, float height) {
  if (weight > WEIGHT_THRESHOLD) {
    return "WET";   // Heavy = likely wet/organic waste
  } else if (height > SIZE_THRESHOLD_CM) {
    return "DRY";   // Light + bulky = paper/plastic
  } else {
    return "METAL"; // Light + compact = can/foil
  }
}

void sortInto(String category) {
  if (category == "WET") {
    sortServo.write(FLAP_WET);
  } else if (category == "DRY") {
    sortServo.write(FLAP_DRY);
  } else {
    sortServo.write(FLAP_METAL);
  }
}

void showResult(String category, float weight, float height) {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Sorting: ");
  lcd.print(category);
  lcd.setCursor(0, 1);
  lcd.print("Wt:");
  lcd.print((int)weight);
  lcd.print("g Sz:");
  lcd.print((int)height);
  lcd.print("cm");
}
Brain Breakdown

How the Code Works — Step by Step 🧠

1

Waiting for Waste

The loop constantly checks the load cell's weight reading. Once something heavier than 5 grams is detected (to avoid false triggers from vibration), it knows an item has been dropped in!

2

Double-Checking the Weight

We wait 800ms for the item to settle, then take a more accurate reading averaged over 10 samples using scale.get_units(10). This smooths out any wobbling.

3

Measuring Height with Ultrasonic

The measureDistance() function sends a sound pulse and times the echo. Since the sensor is mounted 15cm above the tray, we subtract: height = 15 − distance, giving us how tall the item is.

4

The Classification Logic

classifyWaste() checks weight first: heavy items → WET. For light items, it checks height: tall/bulky → DRY, short/compact → METAL. Simple if-else rules, just like a flowchart!

5

Moving the Sorting Flap

sortInto() rotates the servo to one of three angles (30°, 90°, or 150°) — tilting the flap left, center, or right so gravity guides the item into the correct bin below.

6

Resetting for the Next Item

After 2.5 seconds (enough time for the item to fall through), the flap returns to center and scale.tare() re-zeros the load cell, making it ready for the next piece of waste!

Serial Monitor Output 📺

♻️ Waste Segregator Starting...
✅ Ready! Drop an item to sort.
─────────────────────────────────────
⚖️ Weight: 95.40 g
📏 Height: 4.20 cm
🗑️ Category: WET
─────────────────────────────────────
⚖️ Weight: 12.10 g
📏 Height: 8.50 cm
🗑️ Category: DRY
─────────────────────────────────────
⚖️ Weight: 18.60 g
📏 Height: 3.10 cm
🗑️ Category: METAL
Phase 04

Calibrating the Load Cell ⚖️

Don't skip this! Every load cell behaves slightly differently. The CALIBRATION_FACTOR in our code is just a starting guess — you MUST calibrate it with a known weight for accurate results!

1

Upload a simple calibration sketch

Use the HX711 library's example sketch (File → Examples → HX711 → CalibrationSketch), or temporarily set CALIBRATION_FACTOR = 1.0 and read raw values via Serial Monitor.

2

Tare with nothing on the platform

Make sure the tray is empty, then call scale.tare(). This sets the "zero" baseline.

3

Place a known weight (e.g. a 100g coin packet or kitchen scale-verified object)

Read the raw value shown in Serial Monitor. Divide that raw value by your known weight in grams: Calibration Factor = raw_reading ÷ known_weight.

4

Update the code with your factor

Plug your calculated number into CALIBRATION_FACTOR in the main code (it's often a negative number depending on wiring orientation — that's normal!).

5

Verify with a second known weight

Test with a different known weight to confirm accuracy. If readings are off by a lot, repeat the calibration — small errors (±2-3g) are totally fine for this project!

Go Time!

Testing Your Waste Segregator 🧪

✅ Pre-Test Checklist

☑️ Load cell calibrated
☑️ LCD shows "Ready to sort!"
☑️ Servo moves freely
☑️ Bins are empty & labeled
☑️ Ultrasonic sensor unobstructed
☑️ Serial Monitor open
1

Test with a wet item (e.g. a piece of fruit peel)

Drop it gently on the platform. Watch Serial Monitor and LCD — should classify as WET, flap tilts left, item falls into the wet bin.

2

Test with dry waste (e.g. a crumpled paper ball)

Should read low weight + larger height → classified DRY, flap stays centered, falls into the dry bin.

3

Test with metal (e.g. an empty soda can or bottle cap)

Should read low weight + small height → classified METAL, flap tilts right, falls into the metal bin.

4

Repeat and check accuracy

Try each item type a few times. Adjust WEIGHT_THRESHOLD and SIZE_THRESHOLD_CM if sorting seems consistently wrong for your specific test items.

Correctly Sorted
Item landed in the matching bin. Buzzer confirms with a beep.
Misclassified Item
Adjust thresholds in code, or item is an edge case (e.g. a heavy dry book).
Fix It

Troubleshooting Guide 🔧

❓ Weight always reads 0 or negative

Check the 4 load cell wires (Red/Black/White/Green) are correctly connected to HX711's E+/E−/A−/A+. Make sure scale.tare() runs with an empty platform at startup.

❓ Weight readings are very unstable/jumpy

Make sure the load cell is mounted firmly on a flat, sturdy surface — wobbling causes noise. Increase the averaging sample count in get_units(n) from 10 to 15-20 for smoother readings.

❓ Ultrasonic gives wrong distance / always 0

Check Trig and Echo aren't swapped. Make sure nothing is blocking the sensor's view straight down. HC-SR04 needs at least 2cm of clearance to read properly.

❓ Servo jitters or doesn't move to the right angle

Servos can draw a lot of current — power it from a separate 5V supply if your Arduino Nano resets randomly. Check the signal wire is on a PWM-capable pin (D9 works well).

❓ Same item sorted differently each time

Items placed off-center on the tray can give inconsistent height readings. Mark a "drop zone" circle on the tray directly under the ultrasonic sensor to guide consistent placement.

❓ LCD shows nothing or garbled text

Adjust the potentiometer on LCD V0 pin for contrast. Double-check all 6 LCD pins match the code's LiquidCrystal() pin order: RS, EN, D4, D5, D6, D7.

Level Up!

Make It Even Smarter! 🚀

📷
Add a Camera + AI
Use an ESP32-CAM with a simple image classifier to recognize waste type visually, not just by weight/size!
🧲
Metal Detector Sensor
Add an inductive proximity sensor to reliably detect metal cans instead of relying only on size.
📊
Bin-Full Tracker
Add an ultrasonic sensor inside each bin to track how full it is and alert when it needs emptying.
📱
WiFi Dashboard
Swap Arduino for ESP32 and log every sorted item's type and weight to a phone app over WiFi.
💧
Moisture Sensor
Add a capacitive moisture sensor to directly detect "wetness" instead of estimating from weight alone.
🏫
School-Wide Recycling Drive
Build several units and track total recyclables collected across your whole school for a sustainability project!
Q & A

Frequently Asked Questions ❓

💬Why does weight matter for sorting waste?
Wet/organic waste (food scraps, peels) tends to be denser and heavier relative to its size because of water content. Dry waste like paper and plastic is much lighter for the same size. It's not a perfect rule, but it's a great beginner approximation!
💬Can this actually replace human waste sorting?
Not quite — this is a simplified educational model! Real recycling facilities use much more sophisticated sensors (cameras, near-infrared spectroscopy, eddy-current separators) to sort thousands of kilograms accurately. But the core idea — using sensors to make sorting decisions — is exactly the same.
💬What if I drop two items together?
The system is designed for one item at a time — like a vending machine! Dropping multiple items together will confuse the weight and size readings. This is a great discussion point about real-world engineering limitations.
💬Why use an Arduino Nano instead of Uno?
The Nano is smaller and cheaper, making it perfect for compact projects like this one where space inside the bin structure is limited. It has the same processing power as an Uno, just fewer physical pins and a smaller footprint!
💬Can younger kids build this project?
This is an intermediate-level project due to the load cell calibration step. Kids aged 11+ can handle the wiring and coding with adult help on calibration math. The bin-building and testing phases are great for any age group to participate in!
💬How accurate is this sorting system really?
With good calibration, it correctly sorts obvious test items (cans, paper balls, fruit peels) most of the time. Edge cases — like a heavy dry item or a very light wet item — can confuse it, which is a great opportunity to discuss how real engineers handle uncertainty in sensor data!
#WasteSegregator #ArduinoNano #LoadCell #HX711 #RecyclingRobot #KidsMaker #MakeMindz #STEM #EcoRobotics #UltrasonicSensor #ServoMotor #ScienceFair
♻️

Made with ❤️ by MakeMindz — Teaching Electronics, One Project at a Time!

Share your build with #MakeMindz and inspire other young makers!

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course