Sustainability

E-Zero: AI & Gamification for E-Waste

A cutting-edge PWA that uses Computer Vision (TensorFlow.js) to value old electronics and rewards users for recycling.

Shubham
Shubham Kulkarni Full Stack Developer
Updated
E-Waste Circuit Board close-up

Let me paint you a picture. You've just upgraded to the latest iPhone. Your old phone — still functional, maybe with a cracked screen — goes into a drawer. It joins the graveyard of 3 other phones, 2 chargers, and a tablet your kid dropped in 2022. Sound familiar? You're not alone. Globally, we generate 62 million tonnes of e-waste every year. That's heavier than the Great Wall of China.

The scary part isn't the volume — it's that only 22.3% is formally recycled. The rest ends up in landfills, leaching lead, mercury, and cadmium into groundwater. During Smart India Hackathon 2023, our team built E-Zero — a full-stack platform that makes recycling as easy as ordering food online, and as rewarding as a video game.

62M Tonnes/Year Global
22% Properly Recycled
PWA Offline-First App

1. Why Does Current Recycling Fail?

Before writing a single line of code, we spent two weeks doing field research. We visited 3 kabadiwallas (informal recyclers) in Pune and interviewed 50 households. The pattern was crystal clear:

  • No Transparency: People have no idea what their old devices are worth. A kabadiwalla might offer ₹200 for a phone with ₹800 worth of recoverable gold and copper.
  • No Convenience: The nearest authorized e-waste center is often 15+ km away. Nobody drives 30 minutes to recycle a mouse.
  • No Incentive: There's zero motivation. You're literally paying (in time and fuel) to do the right thing.

The E-Zero Thesis

If we could solve all three problems — show value instantly (AI), bring the service to you (logistics), and make it fun (gamification) — we could fundamentally change recycling behavior. E-Zero isn't an app; it's a behavioral economics experiment wrapped in a PWA.

2. The User Journey

Every feature in E-Zero maps to a real friction point we identified in our research. Here's the complete user flow:

flowchart TD A[📱 Open E-Zero PWA] --> B[📸 Take Photo of Device] B --> C{AI Identifies Device} C -->|Detected| D[💰 Show Estimated Value] C -->|Unknown| E[Manual Entry Form] D --> F[🗺️ Find Nearest Drop-Off] E --> F F --> G{User Choice} G -->|Self Drop| H[Get Directions via Map] G -->|Book Pickup| I[Schedule Collection Agent] H --> J[✅ Confirm Drop + Scan QR] I --> J J --> K[🏆 Earn Eco-Points] K --> L[🎮 Check Leaderboard] K --> M[🎁 Redeem Rewards]
AI Identification

Upload a photo of your old phone, and TensorFlow.js identifies the model and estimates its scrap value instantly — all processed on-device. No server needed, no privacy concerns.

Smart Map

Real-time locator for the nearest e-waste drop-off bin using Leaflet.js and OpenStreetMap — fully open-source, and works offline with cached tiles.

3. Architecture Deep Dive

We chose a MERN Stack (MongoDB, Express, React, Node.js) architected as a Progressive Web App (PWA). The "why" is critical: our target users are in Tier-2 and Tier-3 Indian cities where 4G can be spotty. A PWA lets us ship a native-app experience that works offline, weighs under 2MB, and doesn't require a Play Store download.

graph TD subgraph Client ["📱 Client PWA"] UI[React UI] --> SW[Service Worker] UI --> TF[TensorFlow.js - On-Device AI] UI --> Map[Leaflet.js Map] SW --> Cache[(IndexedDB Cache)] end subgraph Server ["☁️ Backend"] API[Express.js API] --> Auth[JWT Auth Middleware] API --> Points[Points Engine] API --> Scheduler[Pickup Scheduler] end subgraph Data ["🗄️ Data Layer"] DB[(MongoDB Atlas)] S3[(AWS S3 - Images)] end UI -->|REST API| API API --> DB API --> S3 Scheduler -->|Notify| Agent[Collection Agent App]

Why PWA Over Native?

This was our most debated architectural decision. Here's what sealed it:

  • Install friction = 0: Users can "Add to Home Screen" directly from the browser. No Play Store gatekeeping.
  • Offline support: The Service Worker caches the AI model, map tiles, and recent data. Users can scan devices even without internet.
  • Single codebase: One React codebase runs everywhere — Android, iOS (via Safari), and Desktop.
  • Size: Our full app is 1.8MB. A comparable Flutter app would be 15MB+.
service-worker.js
const CACHE_NAME = 'ezero-v2';
const CRITICAL_ASSETS = [
    '/',
    '/index.html',
    '/static/js/bundle.js',
    '/model/mobilenet/model.json',  // AI model cached locally
    '/manifest.json'
];

// Cache-first strategy for the AI model (it never changes)
self.addEventListener('fetch', (event) => {
    if (event.request.url.includes('/model/')) {
        event.respondWith(
            caches.match(event.request).then(cached => 
                cached || fetch(event.request).then(response => {
                    const cache = await caches.open(CACHE_NAME);
                    cache.put(event.request, response.clone());
                    return response;
                })
            )
        );
    }
});

4. The AI Valuation Engine

This is where the magic happens. When a user photographs their device, we run MobileNet v2 directly in the browser using TensorFlow.js. The model identifies the device category (phone, laptop, tablet, peripheral) and we cross-reference it against a pricing database.

Why on-device? Two reasons: Privacy (images never leave the user's phone) and Speed (no network round-trip means results in under 500ms, even on a budget Android phone).

identification.js
import * as tf from '@tensorflow/tfjs';
import * as mobilenet from '@tensorflow-models/mobilenet';

// Pricing database (simplified)
const SCRAP_VALUES = {
    'cellular telephone': { min: 150, max: 800, unit: 'INR' },
    'laptop':             { min: 500, max: 2500, unit: 'INR' },
    'mouse':              { min: 20,  max: 50,   unit: 'INR' },
    'monitor':            { min: 200, max: 1200, unit: 'INR' },
    'keyboard':           { min: 30,  max: 80,   unit: 'INR' },
};

async function classifyAndValue(imgElement) {
    const model = await mobilenet.load({ version: 2, alpha: 1.0 });
    const predictions = await model.classify(imgElement, 5);
    
    // Find the best match in our pricing DB
    for (const pred of predictions) {
        const category = Object.keys(SCRAP_VALUES).find(key => 
            pred.className.toLowerCase().includes(key)
        );
        
        if (category && pred.probability > 0.3) {
            const price = SCRAP_VALUES[category];
            return {
                device: pred.className,
                confidence: (pred.probability * 100).toFixed(1) + '%',
                estimatedValue: `₹${price.min} - ₹${price.max}`,
                category: category
            };
        }
    }
    
    return { device: 'Unknown', confidence: '0%', estimatedValue: 'Manual Review', category: null };
}
Smartphone being recycled

5. Gamification: Making Recycling Addictive

The hardest problem in sustainability isn't technology — it's behavior change. We borrowed heavily from mobile gaming psychology to design a rewards system that triggers dopamine hits at the right moments.

The Eco-Points Economy

Every kilogram of e-waste recycled earns the user "Eco-Points". But we didn't just stop at a simple points counter — we built an entire economy around it:

Reward Tiers
TierPoints RequiredBadgePerks
🌱 Seedling0 - 99Green StarterBasic profile
🌿 Sprout100 - 499Eco WarriorPartner store 5% discount
🌳 Tree500 - 1999Green Champion10% discount + Priority Pickup
🏔️ Mountain2000+Eco Legend NFT15% discount + Free Pickup + Featured Profile
  • Leaderboards: Neighborhood-level competition. "Kothrud's Greenest Citizen" — because people care about status in their community.
  • Streak Bonuses: Recycle 3 items in 30 days? 2x points. This borrows from Duolingo's streak mechanic which has proven to drive 40% higher retention.
  • NFT Badges: Unique digital collectibles for milestones (e.g., "100kg Recycled"). These are minted on Polygon (gas-free) and displayed on the user's profile.
  • Redemption: Points can be exchanged for coupons at partner electronics stores like Croma and Reliance Digital.

6. Impact & What We Learned

During our 4-week pilot in Pune with 120 beta users, the results exceeded every expectation:

340kg E-Waste Collected
78% Return Users (Week 2)
4.6★ User Rating

The biggest surprise? The leaderboard was the #1 driver of engagement, not the discounts. People shared their "Eco Warrior" badges on Instagram stories voluntarily. Social proof turned out to be more powerful than monetary incentives.

Key Lessons Learned

  • On-device AI is a superpower: Users were genuinely shocked when the phone identified their device in under a second. "It feels like magic" — that reaction is worth a thousand features.
  • Offline-first isn't optional: 23% of our scan sessions happened when the user had no internet. Without PWA caching, we'd have lost those interactions.
  • Gamification > Guilt: Nobody wants to be lectured about the environment. Make it fun, and behavior follows.

7. What's Next: Smart City Integration

E-Zero started as a hackathon project, but the vision is much bigger. We're in early talks with the Pune Municipal Corporation to integrate E-Zero with their existing waste management infrastructure:

  • IoT-enabled Smart Bins: E-waste bins with fill-level sensors that auto-dispatch collection trucks when full.
  • Aadhaar-linked Rewards: Tying Eco-Points to government incentive programs for verified recycling.
  • B2B Dashboard: Giving recycling centers real-time demand forecasting so they can optimize their operations.

The technology exists. What we need now is policy support and partnerships. If you're working in this space, let's connect.