Design and Implementation of Reverse Vending Machine using SSD and Deep Learning Algorithms
Plastics are lightweight and durable materials, which can readily be molded into a variety of products. Consequently, the production of plastics has increased significantly over the last few decades. According to the latest research, we throw 2.5 million plastic bottles away every hour, each of whic
2025-06-28 16:26:25 - Adil Khan
Design and Implementation of Reverse Vending Machine using SSD and Deep Learning Algorithms
Project Area of Specialization Artificial IntelligenceProject SummaryPlastics are lightweight and durable materials, which can readily be molded into a variety of products. Consequently, the production of plastics has increased significantly over the last few decades. According to the latest research, we throw 2.5 million plastic bottles away every hour, each of which takes an average of 450 years to decompose, and only 9% of this is recycled by the top 6 companies. Every 1-liter bottle takes 250 mL of oil to create, which means 4 percent of world oil and gas production, a non-renewable resource is used as feedstock for plastics. Plastic reduction is thus intrinsically linked to the global climate change crisis we face. Pakistan generates approximately 49.6 million tons of solid waste a year, which has been increasing by more than 2.4 percent annually,9% of which is plastic waste. This includes Polyethylene terephthalate(PET) –Bottles and Polypropylene(PP)-Bottle caps. There are several methods used these days for waste collection among them curbside collection, drop-off recycling, and buy-back centers are the most effective but each one of them has its drawbacks. Our solution is a reverse vending machine a device that accepts used (empty) beverage containers and returns money to the user. Reverse vending combines all the advantages of the above-mentioned methods in a single package as it provides an automatic, location-centric, cheap, and economic incentive solution in a single package. Our solution to the waste collection problem is a reverse vending machine (RVM) with a real-time vision-based capability to identify, sort, and collect PET bottles, tin cans, and milk cartons through the reward-based system. The process starts with inserting the recyclable item into the RVM through a specially designed v-shaped conveyor, it is then analyzed through real-time vision-based machine learning algorithms, to identify its shape, material, and brand. Once the item is scanned and approved, it is then crushed and sorted into the proper storage space. Upon processing the item, the machine rewards people with incentives, in the form of e-cash in mobile wallets like JazzCash or coupons. The RVM is based on image processing to detect counterfeit products. This technology drastically reduces the cost of RVMs.Not only the size and shape are checked but the barcode is also scanned. The machine comes with a cross-platform mobile application for assisting users in monetary transactions and provided the location of the nearest vending machine. The Reverse Vending Machine can provide the maximum benefit if it is used by:
• Supermarkets, Shopping Malls, Hospitals
• Schools, Colleges, and Universities
• Restaurants and Hotels
• National and Provincial Government Offices
• Soft Drink manufacturers
• Waste management companies (LWMC, Albayrak)

Waste is being generated at an increasing rate around the world, hence came the need for waste management. Waste management is the process of managing waste from the time it is produced to its final disposal. Solid waste is the largest source of waste that is generated across the world and includes paper waste, glass and ceramics, plastic waste, and tins and metals. Plastics such as PET (PolyEthylene Terephthalate) bottles take thousands of years to decompose. Around 5.6 million Tonnes Per Annam (TPA) of plastic waste is generated in Pakistan, which is about 15,342 Tonnes Per Day (TPD). The increasing amount of waste being produced in these countries is a burden to the municipal authorities due to the lack of funds that is the result of high-cost management, This is a problem in Pakistan as well. The collection, transportation, and disposal of waste in the country are chaotic and unscientific. Waste is transported to the outskirts of cities and towns into overflowing landfills that are impossible to reclaim. This has negative environmental implications which are the cause of groundwater pollution and global warming. In the absence of a proper system of waste segregation, recycling is a task that is done by the informal sector with their outdated technology. Recycling is a very important waste management process, especially for those materials that do not decompose naturally like plastic. Waste generated in developing countries composes mostly of recyclable material while the waste generated in developed countries mostly comprises organic material. Rapid urbanization has overwhelmed the municipal authorities when it comes to efficient solid waste management. Plastic waste constitutes a considerable amount of solid waste; therefore, its disposal is the most important aspect of recycling waste. Recycling is considered one of the most environmentally sound methods of waste management. There are several techniques in place to separate Plastic Solid Waste (PSW), however, these require segregation of waste with human interaction and hence are still quite inefficient. The most recent technique in recycling is mechanical recycling, the most recent type of mechanical recycling machine is the reverse vending machine. RVM is an innovative idea that has been introduced for collecting recycling materials, particularly plastic and aluminum.
Project Implementation MethodOur Reverse Vending Machine consists of two parts, i.e., Mechanical and Electrical. Both are implemented in their ways. As far as the mechanical structure is concerned, a conveyer belt is used which will provide the basics for the bottles to be recycled inside the machine and to go through the various process, a barcode scanner and an image processing camera is installed using mechanical fittings on the conveyer belt, other than that, below the belt, 4-proximity sensors are used to detect the items and to stop them at various sections of the belt to be scanned and recognized with. Two MG996R servo motors are used at the start and end of the conveyor belt, the front one acts as a gate while the second one is used as a segregator to throw the bottles and tin cans in different bins. The Bar code scanner will usually scan the item’s barcode to recognize it easily in the database. If a bottle or tin can be used with no barcode, then the Image processing camera will recognize them based on its machine learning algorithms, the conveyer belt can move forward and backward depending on the feedback to return the item to the user if it’s not processed.

As for the electrical part, A PCB is designed that will gather the components including the L298N motor drivers for the conveyer belt motors and the proximity sensors, and further connects them to the Microcontroller STM32F407 which keeps all the sequence of the mechanism and provides instructions for the conveyor belt and the sensors to act accordingly to the user response. It also controls the gate and segregator movements and the light. A thermal printer is also installed, which is used to provide the receipt to the user for how many items he processed. It also includes a QR code that he can scan on his phone. For the computing part, A CPU is installed and the image processing camera, barcode scanner, and the microcontroller STM32F407 are attached to it. The CPU will initially launch the machine by connecting the image-processing files and executing them each time a user starts the mechanism with his item. A touch LCD is installed to provide a smooth interface for the user to control how many items he wants to process. Each time a user presses the screen, the Ad running on the screen will stop and the machine will start. All the machine structure is held closed inside a metallic body frame that provides protection and support to the inside structure and gives a friendly appearance to the users.

The reverse vending machine that we have designed works on basically the idea of reducing the waste of plastic and paper by digitalizing the recycling process as we enter this new era of innovation. We have achieved digitalization using Computer vision mobile applications. A very few of the vast benefits of recycling are written below:
Conserving Natural Resources:
As we saw above, the recycling process reduces our usage of natural resources and allows us to conserve them for future purposes. The digitalizing process reduces paper waste and trees are conserved. When plastic bottles are not recycled, they end up spending years in landfills. Due to limited space in landfills and harsh conditions, it’s almost impossible for plastic, among other materials, to biodegrade.
Protecting ecosystem and wildlife:
As recycling reduces the need to grow or harvest new raw materials from the earth which reduces the damage done to the world and its resources, for example, fewer forests cut down, rivers diverted, wildlife harmed or displaced, and less pollution of soil, water, and air. Currently, a dangerous amount of plastic is ending up in our oceans. It is a very serious threat for all those creatures that call the ocean their home.
Cutting climate-changing emissions:
Because recycling means you need to use less energy on sourcing and processing the new raw materials, it produces lower carbon emissions. It also keeps potentially harmful gasses releasing wastes out of the inhabited areas. Reducing carbon dioxide and other greenhouse gases being emitted into the atmosphere is vital for stopping disastrous climate changes.
Cheaper than waste collection and disposal:
The more you recycle, and the less you put in the bin, the more money is saved, which is good for households, businesses, and local public services. The collection system of the machine is simple it collects the recycled products in a bin that can be emptied and collected by only one person also so this reduces the labor force for the collecting and recycling process that saves a lot of money.
Energy-saving:
Since making new plastic bottles from recycled ones costs much less energy than creating a new bottle from scratch so you can help save energy by recycling. Recycling uses less than two-thirds less energy than regular manufacturing. This helps reduce the amount
Technical Details of Final DeliverableImage Processing
To detect counterfeit recycling items, the RVM must recognize the products based on their shape using vision-based algorithms. A MobileNet Single-Shot Multibox Detection (SSD) algorithm will be used to perform object detection. To extract the feature map, image classification model training will be implemented using a deep learning framework that is Caffe

SSD with the Caffe framework can detect multiple objects in a single shot. We also apply a check to the confidence (i.e., probability/percentage match) associated with each detection. If the confidence is high enough (i.e., above the threshold), then we’ll display the prediction in the form of probability as well as draw the prediction on the image with text and a colored bounding box. Delta Encoding (Delta Compression) greatly reduces data redundancy by only processing bytes as differences (deltas) between sequential frames/shots, hence reducing the variance (range) of the values, enabling a lower bit usage for the same data.

Mobile Application
The flutter-based cross-platform mobile application will be developed for consumers to find their nearest RVM and view its operational status in real-time (open, almost full, temporarily unavailable). The user will be registered through an email account, which will be verified b AUTH authentication method.
It will enable paperless refunds through digital vouchers. The users will be able to receive, manage and redeem vouchers in their digital e-wallet app, so they never have to worry about losing a printed voucher again.
Hardware
The Embedded system of RVM will be implemented as a state machine having a non-blocking firmware on a high-speed ARM processor i.e., STM32F407. The V-shaped conveyor belt mechanism will be controlled through an H-bridge module i.e., L298N. To perceive the occurrence of any object on the RVM will be done through an infrared proximity sensor that is E3F-DS30C4. Watchdog timers will be implemented to cater to any firmware anomalies and to make the system self-reliant. A printed circuit board will also be developed for reliable connection of all hardware components including H-bridge, proximity sensors, ultrasonic sensors, etc.

| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 80000 | |||
| 7 inch ips touch screen | Equipment | 1 | 8000 | 8000 |
| Power supply | Equipment | 1 | 2000 | 2000 |
| Conveyor system | Equipment | 1 | 30000 | 30000 |
| Infrared Proximity sensor | Equipment | 5 | 850 | 4250 |
| PK-930HA FHD 1080P AF Webcam | Equipment | 1 | 5000 | 5000 |
| Z-6170 Barcode scanner | Equipment | 1 | 8000 | 8000 |
| CH340G USB To TTL(Serial) Converter | Equipment | 1 | 350 | 350 |
| PCB | Equipment | 1 | 5300 | 5300 |
| L298N Motor driver | Equipment | 2 | 300 | 600 |
| MG996R Servo Motor | Equipment | 2 | 650 | 1300 |
| STM32f407 | Equipment | 1 | 5200 | 5200 |
| Travel | Miscellaneous | 1 | 2000 | 2000 |
| Paper work | Miscellaneous | 1 | 1000 | 1000 |
| Transportation | Miscellaneous | 1 | 4000 | 4000 |
| Printing | Miscellaneous | 1 | 1000 | 1000 |
| Overhead | Miscellaneous | 1 | 2000 | 2000 |