book collections email follower instructable user
F34ZKM2J48PVY5O.MEDIUM.jpg
FHCKCFMJ48PVZ00.LARGE.jpg
Presentation7.jpg

Nobody likes emptying the trashcan at home, especially when it's too full. Here is a device that indicates the level of the trash in the bin alerting everyone , with the use of a simple mobile app. This small home improvement has lead to a more efficient system.

Follow on to see how this simple device could make your home smarter, with basic skills in electronics, programming and hardware! Do check out the video to better appreciate the project.

If you like what we made, you might like our instrcutables which tackles this system on a larger scale, the bins of the city. Click here to see how we made it.

Do support us by voting for us in the contests, thanks!

Step 1: COMPONENTS IN OUR SYSTEM

The basic Model works like so...

To start with you will first have to enter the height of the dustbin. This will help us generate the percentage of trash in the trashcan. We then have two criterias which needs to be satisfied to show that the particular bin needs to be emptied :

  1. The amount of trash, in other words let's say if your bin is half full you don't really need to empty it. Our thresh, or maximum amount that we permit of trash, is 75% of the bin. (You could alter the thresh according to your preference.)
  2. If supposing a particular trashcan fills up 20% and then for a week doesn't change, it comes into our second criteria, time. With time even the little amount will start rotting leading to a smelly surrounding. To avoid that our tolerance level is 2 days, so if a trashcan is less than 75% but it is two days old it then will also need to be emptied.

With these criterias in mind let's understand the technical part:

  • An ultrasonic sensor (A.K.A a distance sensor) will be placed on the interior side of the lid, the one facing the solid waste. As trash increases, the distance between the ultrasonic and the trash decreases.
  • This live data will be sent to our micro-controller.Our micro- controller then processes the data and through the help of WiFi sends it to an app.
  • What the app does it visually represents the amount of trash in the bin with a small animation.

This process will indicate all the bins which require attention, leading the user to take the most effective steps.

SayedAli25618 days ago
Can I use esp32 module instead of Arduino 101 .
Because esp32 has also has BLE.
And can you tell me how to edit the code when we use esp32 for this project.
BilalP21 year ago

I am a bit confused. I'm adding two photos from your project page and have encircled the parts I am confused about. Can you tell me what they are and if I need them to make this project?

2.jpg1.jpg
Technovation (author)  BilalP210 months ago
That is an mkr1000 microcontroller which lets you use wifi instead of ble, you can do without it

Arduino: 1.8.5 (Windows 8), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Praveen Patel\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154 -warnings=none -build-cache C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_cache_566194 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Praveen Patel\Downloads\smart_trash_program\smart_trash_program.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Praveen Patel\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154 -warnings=none -build-cache C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_cache_566194 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Praveen Patel\Downloads\smart_trash_program\smart_trash_program.ino

Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

Build options changed, rebuilding all

Detecting libraries used...

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154\sketch\smart_trash_program.ino.cpp" -o "nul"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Praveen Patel\Documents\Arduino\libraries\arduino_353722\src" "C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154\sketch\smart_trash_program.ino.cpp" -o "nul"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Praveen Patel\Documents\Arduino\libraries\arduino_353722\src" "C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154\sketch\smart_trash_program.ino.cpp" -o "C:\Users\PRAVEE~1\AppData\Local\Temp\arduino_build_133154\preproc\ctags_target_for_gcc_minus_e.cpp"

In file included from C:\Users\Praveen Patel\Downloads\smart_trash_program\smart_trash_program.ino:12:0:

C:\Users\Praveen Patel\Documents\Arduino\libraries\arduino_353722\src/BlynkSimpleCurieBLE.h:25:22: fatal error: CurieBLE.h: No such file or directory

#include <CurieBLE.h>

^

compilation terminated.

Using library arduino_353722 at version 0.4.10 in folder: C:\Users\Praveen Patel\Documents\Arduino\libraries\arduino_353722

exit status 1

Error compiling for board Arduino/Genuino Uno.

Technovation (author)  Praveen KumarA21 year ago

Did you manage compilling your code?

JanryG1 year ago
very nice project,,can you send your complete code Im using genuino 101..but this is my first time to make this project...
Technovation (author)  JanryG1 year ago

Sure you will find the complete code in the instructables!

If I using Grove Distance Sensor, so what type of ultrasonic should i use in the library?
Technovation (author)  MuhammadH3341 year ago

It's the same library, Arduino's ultrasonic built in library.

ezfad1 year ago

#define Blynk_PRINT Serial

#include <BlynkSimpleSerialBLE.h>

#include <SoftwareSerial.h>

#include <Ultrasonic.h>

SoftwareSerial SwSerial (10, 11) ; // RX , TX

// You should get Auth Token in the Blynk App.

// Go to the Project Settings (nut icon).

char auth [] = "05cb041df2754c74bd58f43b47cda2e4" ;

SoftwareSerial SerialBLE (10 ,11) ; // RX , TX

//BLEPeripheral blePeripheral();

WidgetLED green(V1);

WidgetLED orange(V2);

WidgetLED red(V3);

Ultrasonic ultrasonic(8,9);

int distance = 0;

int thresh [3] = {20,12,4};

void setup()

{

// Debug console

Serial.begin(9600);

SerialBLE.begin(9600);

Blynk.begin(SerialBLE , auth);

Serial.begin(9600);

delay(1000);

blePeripheral.setLocalName("garbage");

blePeripheral.setDeviceName("garbage");

blePeripheral.setAppearance(384);

Blynk.begin(blePeripheral, auth);

blePeripheral.begin();

Serial.println("Waiting for connections...");

}

void loop()

{

Blynk.run();

distance = ultrasonic.distanceRead();

Serial.print(distance);

Blynk.run();

if(distance<=thresh[0]&&distance>=thresh[1]&&distance>=thresh[2])

{

green.on();

//Serial.println(1); //debugging sake

}

else if(distance<=thresh[0]&&distance<=thresh[1]&&distance>=thresh[2])

{

green.on();

orange.on();

//Serial.println(2);

}

else if(distance<=thresh[0]&&distance<=thresh[1]&&distance<=thresh[2])

{

green.on();

orange.on();

red.on();

//Serial.println(3);

}

else

{

green.off();

orange.off();

red.off();

//Serial.println(0);

}

delay(100);

// You can inject your own code or combine it with other sketches.

// Check other examples on how to communicate with Blynk. Remember

// to avoid delay() function !

}

the error is :

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Acer\Desktop\UMS\FYP\Coding\Blynk\sketch_feb23a\sketch_feb23a.ino: In function 'void setup()':

sketch_feb23a:37: error: 'blePeripheral' was not declared in this scope

blePeripheral.setLocalName("garbage");

^

exit status 1

'blePeripheral' was not declared in this scope

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

can you help me ?

ezfad1 year ago

Hye , i change certain item because its very hard to find in my area . .okay , i use arduino uno , bluetooth module hc05 to connect to the blynk apps , ultrasonic sensor hc-sr04 , buzzer . i found the coding in blynk browser . the part of coding sensor i copy in my sketch ,but why still error . .

this is the error messages :

sketch_feb23a:37: error: 'blePeripheral' was not declared in this scope

blePeripheral.setLocalName("garbage");

^

exit status 1

'blePeripheral' was not declared in this scope

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

Mark 422 years ago

Would a clear plastic bin accomplish the same thing?

Technovation (author)  Mark 422 years ago
Not really, our whole concept is to know how much trash is in the dustbin from anywhere in the house. Like a smart home, I guess this will work more efficiently the more the dustbins!
tpinkham2 years ago
WOW!!! Great idea!! GREAT VIDEO!!! I have a dream to visit your part of the world...one day ....
GREAT WORK!!!
Technovation (author)  tpinkham2 years ago
Thanks for all the positive feedback!
Haha do contact us if ever : )
TimothyJ9992 years ago

I love your idea and the philosophy behind it. Also, the video is very well produced!


Just a couple of suggestions, if you're thinking about producing a lot of these: first, the connector shield is overkill and adds to the cost and the size. The sensor etc. can be connected directly to the Arduino.
Second, an Arduino nano would be smaller, cheaper, and would draw less power. You could use an inexpensive HM-10 Bluetooth BLE module or even an esp8266 wifi module for better range.

With those changes you could save money and use a much smaller enclosure.
Nicely done!

Technovation (author)  TimothyJ9992 years ago
Thanks a lot, glad that you liked it!
You have a good point and suggestions noted and much appreciated. We actually made this system with the concept in our head and the prototype was with all the components that we already had.
Now being successful we can look for cheaper, smaller alternatives, thanks again for your time!
DejayRezme2 years ago

Haha awesome. But from the link I was hoping for a garbage bin that automatically opens and closes when it senses you throwing something into the bin :P Like if any approaching flying object is detected, the flap opens quickly!

Technovation (author)  DejayRezme2 years ago
Haha that's maybe version 2.0 but this is just a system to make the whole process more efficient! Although your suggestion could be easily implemented...
DanukaB2 years ago

Can we do this on a arduino uno board? is it essential to have an arduino 101

Technovation (author)  DanukaB2 years ago
No any in fact the Arduino 101 one used because we wanted to test this new microcontroller, and also due to the fact that it has BLE capabilities. That said the Arduino Uno will work as well!
Из пушки по воробьям. Сделали б уже на raspberry pi ? на деле же esp8266 справился бы с этой задачей дешевле ;)
Very good point, but it turned out we already had these components from before.
diy_bloke2 years ago

Nice. One could argue that it is crazy to do this as you will just see how much is in the bin every time you open it, but I just smartalized a simple moustrap so i get a mail when a mouse is cought ;-).
Now the only thing left is to signal a robot to take the trash out ;-)

Anyway, seriously, I have seen a system once in which the Trashbin (the big ones outside that get collected) take themselves from the house to the street on collection day via a railsystem.
As there are usually costs connected to the pick up, it would pay to have this type of device included to prevent the trash taking itself out if the bin wasnt optimally full

Technovation (author)  diy_bloke2 years ago
I understand, smart idea!
belfastrab2 years ago

voted... definately the best entry for the macguyver content

Technovation (author)  belfastrab2 years ago
Haha thanks a lot for the support!