AI-Powered Smart Waste Sorting
SnapSort leverages Google's Gemini AI to revolutionize waste management. By instantly analyzing items via webcam, it automatically directs an Arduino-controlled platform to sort waste into the correct category—Trash, Recycling (Paper), or Recycling (Plastic/Glass/Metal)—while tracking your environmental impact in real-time.
- AI Recognition: Utilizes Gemini Flash for rapid, accurate waste identification.
- Live Dashboard: Monitors real-time sorting stats and carbon footprint reduction (kg CO2e).
- Hardware Integration: Seamlessly communicates with Arduino to physically actuate sorting servos.
- Demo Mode: Fully functional without hardware (Analysis only).
- Computer Vision: Captures and processes images directly from a connected webcam.
Follow these steps to set up the SnapSort development environment.
- Node.js (v18+)
- Arduino IDE (Optional - for hardware control)
- A webcam connected to your PC
- Gemini API Key
The backend handles image processing, AI communication, and hardware control.
-
Install Dependencies
npm install
-
Configure Environment Create a
.envfile in the root directory:cp .env.example .env
Open
.envand configure your API key:API_KEY=your_actual_api_key_here SERIAL_PORT=COM6 # Adjust based on your Arduino port
-
Start the Server
npx ts-node server.ts
The server works on
http://localhost:3000.
The frontend provides the user interface and stats dashboard.
-
Navigate to Dashboard
cd dashboard -
Install Dependencies
npm install
-
Run Development Server
npm run dev
Open your browser to
http://localhost:5173.
- Ensure
server.tsis running. (If no Arduino is detected, the system enters Demo Mode). - Open the Dashboard.
- Place an item in front of the camera.
- The system will analyze the image and categorize it. (In Demo Mode, it simulates the sort).
- Watch your carbon savings grow on the dashboard!
- Backend: Node.js, Express, TypeScript
- AI: Google Gemini (Flash Model)
- Frontend: React, Vite
- Hardware: Arduino, SerialPort, Servos
This project is licensed under the MIT License.
