Introduction: EARTH SAVER: Autonomous Material Sorter

This Arduino project was part of an Association of Mechanical Engineers (ASME) contest to create an Autonomous Material Sorter. The sorter was to sort four glass bottles, four plastic bottles, four Tin cans, and four Aluminum cans. There were requirements such as size of the bottles and size of the machine. The machine had to be able to sort the bottles and cans automatically after being started and had to run off of a dry-cell rechargeable battery. The full machine requirements can be read in the PDF file 'ASME'.


About the video:
The problem in the competition was not the machine, it was the hopper.  Most of the time was spent building the machine and little time was devoted to the hopper. The hopper was the part that all 12 bottles/cans were poured into before the machine was turned on. The hopper was supposed to feed 1 bottle/can at a time to the machine. The hopper for this machine was just a slide.  The first bottle/can on the slide would rest on the edge of the conveyor and then the rest would stack up behind it.  When the bottles/cans were poured onto it, the weight of all the bottles/cans collapsed and many fell into the machine at once.  This is where you can hear the crowd let out a big "OOHHHH".  Nobody was allowed to touch anything once pouring began so there was nothing that could be done except start the machine.

I turned the machine on to see what the machine would do. There were still bottles/cans on the slide at this time so when the conveyor started, it rolled down the conveyor and fell on top of the others that had already fallen into the machine.  It wasn't Tin so it didn't pull the magnet up.  Since there were at least 3 or 4 bottles/cans between the plates in the second testing area, it didn't close the conductivity test, and, since there were bottles/cans stacked up in front of the ultrasonic sensor, the machine thought it was short, so it thought glass. The ramp underneath turned to the glass bin, but when the trap door tried to open, the weight of all the bottles/cans maxed out the motor and it didn't open far enough to allow the bottles to fall out.

The Arduino was set to leave the trap door open a few seconds to allow the bottle/can to fall out and slide down the ramp and then close back.  The ramp returned to its starting position and then the door closed.  The Arduino started the process over again, and started the conveyor.  This time when the next bottle/can fell off of the conveyor, there were so many bottles/cans between the plates, that motor couldn't put enough pressure to activate the switch behind the hinged plate so the motor just kept running.  At the end you can hear the motor running when it was decided to shut the machine off.

The machine actually worked like it should have based on the conditions the sensors were given.  The part that failed was the hopper which had nothing to do with the electronics of the machine.  Before the competition the machine was test by placing one bottle/can on the conveyor at a time and everything worked perfectly.

Attachments

Step 1: Collect Materials

Materials:
x2 Hinges
x3 Limit Switches
x4 DC Motors
Angled Aluminum
Conveyor Tracks
Electrical Wire
Gear Boxes for motors
PVC Pipe
Screws and Nuts
Threaded Rod
Ultrasonic Sensor
Arduino
Arduino Motor Shield
Other metal pieces and miscellaneous parts

Step 2: Identify Methods of Sorting

The first step is to find ways to identify each type of bottle and can.

Since the Tin can is the only container that is ferrous, a method to test if a material is magnetic will be developed.

Now that the Tin can now be identified, the Aluminum can is the only remaining material that will conduct electricity. A method to test for conductivity will be developed.

The remaining two materials can be sorted by measuring their lengths. In the contest rules, the size of each bottle/can to be sorted is given. The biggest glass bottle is smaller than the smallest plastic bottle. This leaves a gap between the two materials' lengths. A method to test the lengths of the bottles will be developed.


Magnetic Test: The method to identify the Tin can is to use a magnet switch. A magnet is placed onto a hinging metal bar that is resting on another piece of metal. When a tin can is past over the magnet, the magnet is attracted to the can, which pulls apart the metal pieces. The metal pieces act as a switch. When the magnet is attracted to the can, it opens the switch.

Conductivity Test: The method to identify the Aluminum can is to use a conductivity test. Two metal plates are placed on each side of the can. One of the plates will move and contact one side of the can and then push it into the other plate. The two plates will also act like a switch. When the Aluminum can comes into contact with both plates, the switch will close.

Length Test: The method to differentiate between the glass and plastic bottles is to use a length test. The two metal plates used in the conductivity test can be used in this test. When they touch each end of the glass or plastic bottle, the conductivity switch will be open, but the distance between the two plates is the length of the bottle. An ultrasonic sensor can be used to measure the distance between the two plates. If the length is within the smaller bottle size range, it is glass. If it is within the larger range, it is plastic.

Step 3: Build Machine Frame and First Testing Area

A frame is built to the dimensions outlined in the contest rules. The frame can be constructed using angled Aluminum. Using the top few inches of the frame, a conveyor will be used to supply the bottle/can to the machine. A motor is set up to turn a PVC pipe. Two rubber tracks are stretched between the turning PVC pipe and another smaller, free-rotating PVC pipe. The magnet test is placed in between the two rubber tracks. Two wires are wired to the magnet switch to supply the electricity. It is important that both sides of the magnet switch are insulated from each other and from the rest of the frame.

As the bottle/can moves along the conveyor it will fall of the end. A limit switch is attached at the end of the conveyor to signal to the Arduino when the bottle/can falls off the conveyor. This will also signal the Arduino to stop the conveyor.

Step 4: Build Second Testing Area

Under the first testing area and about six inches from the bottom of the frame will be the second testing area. When the bottle falls off of the conveyor, it will fall in this area. To create a moving plate for the conductivity test, a motor is attached to a threaded rod. A hole is drilled through the moving plate and a nut is attached around the hole. The plate will have constraints on each side to prevent it from rotating, so when the motor turns the rod, it will move the plate in and out. When the bottle/can falls off of the conveyor and hits the limit switch beneath the conveyor the conveyor is stopped and the motor to move the plate is started.

Another plate is attached on the other side of the frame, opposite of the moving plate. This plate is attached with hinges at the top of the plate. A limit switch is placed behind this plate. When the bottle/can is pushed into this plate, it will pivot and push the switch, signaling the Arduino that the bottle is touching both plates and to stop the motor. A wire is attached to each plate to create the conductivity switch. An ultrasonic sensor is also attached to the pivoting plate. It will send a signal that will bounce off of the other plate, measuring the length of the bottle/can between the plates.

When these tests are completed, the moving plate will be moved back out to its original position. Another limit switch is placed at this position to signal when the plate has returned and to stop the motor. At this point the Arduino will know if the bottle/can is glass, plastic, Aluminum, or Tin.

Step 5: Sorting Ramp

Underneath the second testing area, a ramp is built to sort the bottle/can. Each side of the machine represents one of the bottles/cans and a bin is placed on each side to collect each bottle/can. When the Arduino identifies what material the bottle/can is, the ramp will rotate to the side that represents that material. A motor is attached to the bottom of the ramp to turn it. The Arduino will run the motor for a given number of seconds to turn it to the right spot. Since this method isn't very accurate, the ramp will eventually begin to stop at places it should not. To prevent this from happening, the ramp will have a starting position that it will return to after each time a bottle/can is sorted. A stopper will be placed in this spot so when the ramp returns it will always start in the same position.

To get the bottle/can to the ramp, the bottom plate (blue plate) in the second testing area is actually a trap door. When the ramp is in the correct position, a motor will rotate the trap door out of the way, causing the bottle/can to fall down and hit the ramp, diverting it to the correct side of the machine and into its bin.

When the bottle falls into its bin, the trap door closes, the ramp returns to the starting position, and the machine starts over by running the conveyor.

Step 6: Wiring and Programing

At this point, everything is in place to sort each material. Wire all sensors, motors, and wires into the Arduino. Attach the battery to the Arduino with an On/Off switch in line.  Then send the sketch to the Arduino and begin sorting. The attached Arduino sketch was not the final sketch used in the competition, but was an earlier version of the final version.

Microcontroller Contest

Participated in the
Microcontroller Contest