The machine uses a Raspberry Pi to recognise and sort trash accurately and efficiently. The project: the camera takes a picture of the trash and using image processing as well as machine learning, it will identify the piece of trash. The display will show the output as well as the confidence level of the sorting. Along with that, the LED’s will light up to give another visual of what trash was identified as. Next, the first motor will start moving to the location above its associated bin. The second motor will turn the cardboard, depositing the trash.
Watch the video: https://youtu.be/6Be5FhDPoCI
With the rapidly worsening state of our climate, discovering that only 9% of plastic is accurately sorted alarmed our team members. We are striving to create a machine that precisely and efficiently sorts through trash. With the help of a Raspberry Pi camera and machine learning, our machine will distinguish between trash, paper, and plastic, transport the garbage to its correct bin, and dispose of it properly. Our goal is to make the University of Waterloo a cleaner, more eco-friendly community while also being efficient for our busy students to use.
We began our research by identifying the key issues with our trash and recycling systems. This helped us pinpoint which items of trash were commonly sorted incorrectly and which types of trash we needed bins for. Knowing more about this drastic issue, we researched the software and hardware components that were key elements in transforming this idea into a reality. We discovered that we would need machine learning, and soon after found Lobe.AI that could help us do so. Lobe.AI has been an invaluable tool in helping us integrate machine learning to our project. This lets us train a machine learning model online and easily integrate it into our own Python code. Once we trained the image classification model for several hours, we were able to achieve 94% accuracy and export it to our Raspberry Pi. Additionally, we learned how to set up a Raspberry Pi with no prior experience by referring to various YouTube videos. This was difficult, as expected, but in the end, we were able to also connect the computer to internet through a personal hotspot.
For this project, we used both software and hardware components. In the software components, we have 3 aspects. First, the machine learning portion is the collection of 2500 different types of images such as cardboard, glass, metal, paper, plastic, and trash. To run the machine learning aspect, we used the terminal. We also had image processing which sorts the images that were taken into appropriate categories. Next, for the hardware components, we had the Raspberry Pi, SD Card, USB-C Power Supply, the Camera Board, driver chip, bridge, and the Raspberry Pi Kit which included breadboard, pushbuttons (to activate the sorter and camera), 220 Ohm resistors, and jumper wires (to connect to pushbutton and 2 motors). The implementation occurs as a recurring chain of events. First, the camera takes a picture of the trash and using image processing as well as machine learning, it will identify the piece of trash. The display will show the output as well as the confidence level of the sorting. Along with that, the LED’s will light up to give another visual of what trash was identified as. Next, the NEMA17 motor will start moving to the location above its associated bin. The second motor will turn the cardboard, depositing the trash. We choose to use NEMA17 motors over DRV8825 due to the initial cost and ease of set up.
One of the first tradeoffs that we made was connecting the Raspberry Pi to Wi-Fi. To access the Edurom Wi-Fi, there were several steps we needed to follow. There were several compilations with the connection and the steps. Unfortunately, we were not able to get it to work, but we used a hotspot instead and that was able to fix the problem. The other major trade-off included leaving the Raspberry Pi in one position as the trash was being deposited. Our initial idea was to have the Raspberry Pi attached to the platform which deposited the trash. Since there are a lot of wires involved with the Raspberry Pi, it was quite fragile and moving/shifting them caused lots of trouble since it would cause the entire system to malfunction. We had to be very cautious when moving pieces of the machine, as otherwise it would have taken lots of time to determine which wire was misplaced/malfunctioning. Lastly, we were having technical difficulties programming the motors. Originally, our plan was to have 3 motors, but our raspberry pi could only control 2 motors. We had to change our original plans about how many bins we were going to have. We also had some challenges figuring out how to give control to one motor and a time and unsynchronized the motors movements with the help on a special ENABLE pin in the motor board. In our final model, we have 3 bins that work with the two motors.