Detecting Metal, Plastic and Glass

Hello, i'm trying to sort metal, plastic and glass for recycle purpose but using barcode scanner since i've watch some videos about it (Recyclebot.it) where it detect the material using barcode scanner together with arduino and Yum shield but i don't know how it works (the detection). Can someone explain including coding

You're going to stick a bar code on every piece of trash?

The video shows reading the UPC, there should be a large database to translate the bar code - think of how many barcodes there are in a supermarket and other stores. I doubt it is very practical.

bar codes or UPS are assigned from a single database. that is what supermarkets use and if you buy a bottle of water in Canada the bar code should be able to be read in the USA. Used in the United States, Canada, Europe, Australia, New Zealand, and other countries. you can look up any barcode that is in the correct format. there is another one for the EU because the EU has an extra digit on the front.

https://www.upc-search.org/

that said, most bar codes are in some place on the object and if you spin it, slowly, a barcode scanner should be able to see it.

separating metal from the rest should be easy enough.
then there is glass and plastic. glass is rigid, plastic is not. so that should also be something you can do with available motors and sensors.
color of objects does not reveal materials and with some plastics having multiple layers of different types of plastics, it would seem that the best you could get is that the bar code tells you.

the recyclebot does this in a clean, almost laboratory environment. should be easy enough to reproduce those results.

Ferrous metals = magnetic - maybe the easiest to separate
Plastics can be shredded, and often float... others may be blown by sorter.
Non ferrous metals will typically be opaque to infra red.
Fire or centrifuge can separate others.

The order is important to optimise separation.

try to watch this http://recyclebot.it/ , the designer use barcode scanner, arduino and yun shield to separate the waste, i wonder how did they do it

Ask the designer.