Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.
Wet/Dry Waste Segregator: the finished build
UnoStudent projects

Automatic wet and dry waste segregator model (Arduino Uno + moisture plate + servo)

Drop waste on the flap — it tips into the wet or dry bin by itself and keeps count.

Difficulty
Medium
Build time
4 h
Parts cost
₹1,275 · $15
Verified — core avr 1.8.8, Servo 1.3.0, 3 Nov 2026Compile-only

Community draft — report a mistake

Parts list

PartQtyApprox.Buy
Arduino Uno R3 (CH340 clone)1₹450Buy Arduino Uno R3 (CH340 clone)
IR obstacle sensor module (FC-51)1₹40Buy IR obstacle sensor module (FC-51)
Rain sensor module (plate + LM393 board)1₹60Buy Rain sensor module (plate + LM393 board)
SG90 micro servo (MG90S metal-gear for a heavier flap)1₹110Buy SG90 micro servo (MG90S metal-gear for a heavier flap)
16x2 LCD with I2C backpack (PCF8574)1₹180Buy 16x2 LCD with I2C backpack (PCF8574)
470 µF / 16 V capacitor1₹5Buy 470 µF / 16 V capacitor
Two small dustbins (green = wet, blue = dry), sunboard for the flap1₹200Buy Two small dustbins (green = wet, blue = dry), sunboard for the flap
Jumper wires + 5 V 2 A adapter1₹230Buy Jumper wires + 5 V 2 A adapter
Total₹1,275

Affiliate disclosure: “Buy” links may earn FlashReady a small commission at no extra cost to you. Prices are indicative.

Wiring

Arduino Uno R3Only the pins used are shown · 5 V logicIR obstacle avoidance sensor (FC-51)Rain sensor (FC-37 / YL-83)SG90 micro servo (9 g)16×2 LCD + I2C backpack5VGNDA0A4A5D2D7D9VCCGNDOUTVCCGNDDO (not connected)AOSIGVCCGNDGNDVCCSDASCL
Every connection
Arduino Uno R3Part · pinWireNotes
D2IR obstacle avoidance sensor (FC-51) · OUTgreenLOW when an item lands on the flap
5VIR obstacle avoidance sensor (FC-51) · VCCred
GNDIR obstacle avoidance sensor (FC-51) · GNDblack
D7Rain sensor (FC-37 / YL-83) · VCCorangePowered from a pin only while measuring (about 10 mA) — stops the plate corroding
A0Rain sensor (FC-37 / YL-83) · AOpurpleLower = wetter. DO is not used
GNDRain sensor (FC-37 / YL-83) · GNDblack
D9SG90 micro servo (9 g) · SIGorange
5VSG90 micro servo (9 g) · VCCred470 µF capacitor across the servo’s 5V/GND
GNDSG90 micro servo (9 g) · GNDblack
A416×2 LCD + I2C backpack · SDAblue
A516×2 LCD + I2C backpack · SCLyellow
5V16×2 LCD + I2C backpack · VCCred
GND16×2 LCD + I2C backpack · GNDblack

Board quirks: The rain-sensor plate is fixed on top of the flap. Wet waste lying on it connects the comb tracks and pulls AO down; dry paper or plastic doesn’t. It only detects moisture — not what the material is — so a wet paper cup counts as wet. The plate is powered from D7 for about 150 ms per item. Kept powered all the time, the DC current eats the tracks away within weeks, especially with salty food waste. Calibrate WET_BELOW: watch the Serial Monitor while you put a dry paper ball and then a wet tea-bag on the plate, and set the threshold halfway between the two readings. Wipe the plate after wet items. A film of water left behind makes the next dry item read wet.

Code

wet-dry-waste-segregator.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// Wet / dry waste segregator model — Arduino Uno + IR sensor + rain (moisture) plate + SG90 + 16x2 I2C LCD.
// Drop an item on the flap. The IR sensor notices it, the Uno powers the moisture plate for a
// moment and reads it: wet waste (peels, tea leaves, food) conducts and pulls AO down, dry waste
// (paper, plastic, wrappers) doesn't. The servo tips the flap towards the WET or DRY bin and the
// LCD keeps count.
// IR OUT → D2 (LOW = item). Rain module VCC ← D7 (powered only while measuring), AO → A0.
// SG90 signal → D9. LCD on I2C (SDA A4, SCL A5, address 0x27).
#include <Wire.h>
#include <Servo.h>
#include <LiquidCrystal_I2C.h>

constexpr uint8_t IR_PIN = 2, PLATE_POWER = 7, SERVO_PIN = 9, PLATE_AO = A0;
constexpr uint8_t FLAP_LEVEL = 90, FLAP_WET = 150, FLAP_DRY = 30;  // servo angles — tune to your flap
constexpr int WET_BELOW = 700;  // AO reading (0–1023) below this = wet; a dry plate reads ~1000

Servo flap;
LiquidCrystal_I2C lcd(0x27, 16, 2);
unsigned int wetCount = 0, dryCount = 0;

bool itemPresent() { return digitalRead(IR_PIN) == LOW; }

// Power the plate only while reading: DC across it all the time corrodes the tracks within weeks.
int readPlate() {
  digitalWrite(PLATE_POWER, HIGH);
  delay(100);
  long sum = 0;
  for (uint8_t i = 0; i < 10; i++) {
    sum += analogRead(PLATE_AO);
    delay(5);
  }
  digitalWrite(PLATE_POWER, LOW);
  return sum / 10;
}

void showCounts(const __FlashStringHelper* last, int value) {
  lcd.clear();
  lcd.print(F("Wet:"));
  lcd.print(wetCount);
  lcd.print(F("  Dry:"));
  lcd.print(dryCount);
  lcd.setCursor(0, 1);
  lcd.print(last);
  if (value >= 0) {
    lcd.print(F(" ("));
    lcd.print(value);
    lcd.print(F(")"));
  }
}

void setup() {
  pinMode(IR_PIN, INPUT_PULLUP);
  pinMode(PLATE_POWER, OUTPUT);
  Serial.begin(115200);
  Serial.println(F("Waste segregator ready — drop an item on the flap"));
  Serial.println(F("item,plate_reading,result,wet_total,dry_total"));
  lcd.init();
  lcd.backlight();
  flap.attach(SERVO_PIN);
  flap.write(FLAP_LEVEL);
  showCounts(F("Drop waste here"), -1);
}

void loop() {
  if (!itemPresent()) return;

  lcd.setCursor(0, 1);
  lcd.print(F("Checking...     "));
  delay(1000);  // let the item settle on the plate
  int value = readPlate();
  bool wet = value < WET_BELOW;
  if (wet) wetCount++;
  else dryCount++;
  Serial.print(wetCount + dryCount);
  Serial.print(',');
  Serial.print(value);
  Serial.print(',');
  Serial.print(wet ? F("WET") : F("DRY"));
  Serial.print(',');
  Serial.print(wetCount);
  Serial.print(',');
  Serial.println(dryCount);
  showCounts(wet ? F("Last: WET") : F("Last: DRY"), value);

  // Tip the flap, give the item time to slide off, then level it again.
  flap.write(wet ? FLAP_WET : FLAP_DRY);
  delay(1500);
  flap.write(FLAP_LEVEL);
  delay(800);

  // Wait until the IR sensor no longer sees anything, so one item is counted once.
  unsigned long since = millis();
  while (itemPresent()) {
    if (millis() - since > 5000) {
      Serial.println(F("Item stuck on the flap — remove it"));
      lcd.setCursor(0, 1);
      lcd.print(F("Remove item!    "));
      since = millis();
    }
    delay(20);
  }
}

Compiled for uno on avr 1.8.8 with Servo 1.3.0 · 3 Nov 2026

How it works

Segregating waste at source into wet (biodegradable) and dry (recyclable) is a rule in most Indian cities under the Solid Waste Management Rules, and a favourite Swachh Bharat theme at school exhibitions. This model does the sorting by itself.

How it works

  1. Item detected. An FC-51 IR sensor looking across the flap pulls D2 LOW when something lands on it.
  2. Moisture test. After a 1-second pause (so the item settles), the Uno switches D7 HIGH to power the rain-sensor module, waits 100 ms, averages 10 readings of its analog output on A0, then switches it off again. The plate is two interleaved copper combs: anything wet bridges them, current flows, and the reading drops. A dry plate reads about 1000; wet vegetable peels read a few hundred.
  3. Decision and sorting. Below WET_BELOW (700) it is wet. The SG90 servo on D9 tips the flap to 150° (wet bin) or 30° (dry bin), holds for 1.5 s while the item slides off, and comes back level.
  4. Counting. The LCD shows the wet and dry totals and the last reading; the Serial Monitor logs every item. The sketch then waits until the IR sensor is clear, so an item is never counted twice.

What to show at the exhibition

Keep a small tray of test items: a banana peel, wet tea leaves, a paper ball, a plastic wrapper, a dry leaf. Let visitors drop them one at a time and watch the counts. Then show a limitation honestly — a wet paper cup goes to “wet”. Explaining why (it only senses moisture) and how a real plant adds metal and optical sensors scores better than pretending it is perfect.

Questions the examiner may ask

  • How does the rain sensor work? The plate forms one arm of a voltage divider with a resistor on the module. Water lowers the plate’s resistance, so the output voltage falls. The LM393 comparator gives DO; AO is the raw voltage.
  • Why power the plate from a GPIO pin? DC current through a wet plate causes electrolysis and corrosion. Powering it for a fraction of a second per item makes it last much longer. The module draws only about 10 mA, well within a pin’s 20 mA.
  • Why wait for the IR sensor to clear? Otherwise an item stuck on the flap would be counted again on every loop.
  • What does a real segregation plant use? Trommel screens, air blowers for light plastics, magnets and eddy-current separators for metals, and near-infrared cameras to identify plastic types.

Cost in India

About ₹1,250 with the Uno, adapter and two small bins. The electronics alone (sensors, servo, LCD) cost under ₹400.

Troubleshooting

Everything is sorted as dry

The item doesn’t touch the tracks, or the plate isn’t powered. Check D7 goes to the module’s VCC, and that AO (not DO) goes to A0. Press a wet finger on the plate — the reading should fall below 500.

Everything is sorted as wet

The plate is still wet or dirty, or WET_BELOW is too high. Dry it and check the reading with nothing on it is above 900.

The flap tips before I drop anything

The IR sensor sees the flap or the wall. Turn its pot to shorten the range and aim it across the flap, not down at it.

The Uno restarts when the flap moves

The servo draws a current spike. Fit the 470 µF capacitor and use a 2 A adapter instead of laptop USB.

Upgrades

  • Add an inductive proximity sensor (LJ12A3) and a third bin for metal waste.
  • Add an HC-SR04 inside each bin and show “bin full” on the LCD.
  • Send the daily wet/dry count to a phone with an ESP32 version for a society or school canteen.

↑↓ to move · Enter to open