If you have ever lived with lazy people, odds are you have experienced a situation like this… the trash is full but nobody has taken it out. The next person that discovers the full trash can, feels that it isn't their responsibility to take it out so they find a way to push the trash down and get their waste inside. This continues until the trash can overflows and you finally decide to take it out. But at this point getting the bag out of the can becomes a struggle. The bag rips, and it becomes way more of an ordeal than if it had been taken out the first time. To respond to this problem our group, "The Trashcan Boys" has decided to create an internet of things device to encourage people to take out the garbage.
In the initial stages of our project we knew that we would have to use some kind of proximity sensor to detect how close the garbage can was to being full. We then decided to include both an audio and visual cue to inform people that the trash can is full. For the proximity sensor we decided to use an ultrasonic sensor. An ultrasonic sensor is useful in this case as it will pick up objects in a general area rather than only objects directly in front of the sensor. For the visual cue that would trigger when the trash was full, we decided on an LED as it would be very easy to implement and effective. For the audio trigger we used an active buzzer that would buzz continually until the trash can is emptied. This will be the driving factor in 'encouraging' people to empty the trash can, as the buzzer is quite irritating.
Our IOT system works through a system with three particle argons that allow us to monitor the trash levels on two different trash cans. Two of the particle argons utilize the aforementioned ultrasonic sensor to detect whether or not their respective trash can is full. This is done by implementing the code entitled "Trash Can Sensor Code 1", shown below on this page and wiring the system as shown below.
The particle argon is of course plugged into a power source and the breadboard is powered and grounded using the ground (GND) and USB Power (VUSB) pins. The ultrasonic sensor is then powered and grounded, then wired such that the 'TRIG' pin connects to pin D4 on the argon and 'ECHO' is connected to pin D5 as specified in lines 7 and 8 of the code. Then to produce the audible trigger when the can is full, a buzzer is connected. Of course this is also powered and grounded with the 'S' pin connected to pin D2 on the argon as specified in line 10 of the code. The led to identify a full trash can in this case is just the on-board LED, D7. This is the only difference in the setup between the two trash detecting devices as the second one running off of "Trash Can Sensor Code 2" uses an LED connected to pin A5 as seen in line 10 of this code. The entire process is outlined in the gallery of images below.
Now that these devices are set up, the detecting process can be explained. These devices use the ultrasonic sensor to detect if trash is within a range which will change with each trash can depending on where the device is placed. In this case the range is 15 cm. If trash is sensed within this range the particle will then publish an event to a private cloud. In this case the event is called "too_high". This event is then subscribed to by the particle we called "headquarters" which runs off of the "Headquarters Code". A picture of the headquarters device can be seen below.
When this device receives the signal that a trash can is too full an LED illuminates, in this case either the on-board LED identifying Trash Can 1 is full or an LED wired through pin A2 if Trash Can 2 is full. This can be seen in the if statements included in "Headquarters Code". Also seen in the aforementioned if statements are the commands telling the headquarters device to publish an event named "full". This event is subscribed to by the trash detecting devices at which point the buzzer is triggered, which can be seen in lines 45-47 of "Trash Can Sensor Code 1" or "Trash Can Sensor 2". These signals will continue to be triggered until the trash is emptied at which point the sensing devices will publish "all_clear". This event is subscribed to by the headquarters device which causes the LED to be turned off and an event called "clean" to be published (lines 24-26, and 36-38 of "Headquarters Code"). This "clean" event is subscribed to by the trash detecting devices which causes the buzzer and LED to turn off (lines 49-51 of "Trash Can Sensor Code 1" or "Trash Can Sensor Code 2").
The gallery below shows the setup we used for the implementation of the project. There is also a video posted below to show the whole thing in action. We also have the live data from one of the devices here. The live data was gathered using a Webhook with a custom made IFTTT applet that connects the Particle device to a Google Sheet. There is a graph showing the number of times the trash was too high on the days the device was active in the gallery below.
Overall, this device has proven to be very useful once implemented into my trash can. My roommates now are very quick to take the trash out as the buzzer sound is only tolerable for a short period of time. We hope you all implement this project at home and have the same phenomenal results our group did.