Introduction: SEBi: Smart Electric Bin

Picture of SEBi: Smart Electric Bin

What is Waste management?

According to Wikipedia: “Waste management or Waste disposal is all the activities and actions required to manage waste from its inception to its final disposal. This includes among other things, collection, transport, treatment and disposal of waste together with monitoring and regulation. It also encompasses the legal and regulatory framework that relates to waste management encompassing guidance on recycling etc."

Problem in Waste Management

One of the major issues in waste management is to collect the waste at right time, also it's really a headache for waste management agencies. Waste management agencies are collecting waste from household/industry once in a month, so sometimes the waste bin will be full before the collection time or sometimes, such as during vacations the bin is not going to get filled and still the agency will come for collecting the waste it will waste their fuel.

Why we need a smart waste bin? (Solution)

As a solution for the problem in waste management that I mentioned above we have:

When the bin is full, it will notify the waste management agency as well as us, so it will help the agency avoid the waste of fuel also make it possible for them to create a better map of collecting waste from citizens.

The network of sensors enabled smart bins connected through the IoT network generates a large amount of data, which is further analyzed and visualized at real time to gain insights about the status of waste around the city. The scope for the future work of this system can be implemented on various places like bus stops, railway stations etc.

Step 1: How It's Working

Smart Waste Bin is Powered by Cayenne and NodeMCU.

Cayenne: Easily enable your company's microcontrollers, gateways, sensors, and other devices for the Internet of Things.
NodeMCU: NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12E module. So you want to build one of your own! Let's get started!

Step 2: Set Up Cayenne

Picture of  Set Up Cayenne

First create a Cayenne Account.

And log on to your account:

Step 3: Click Add New:

Picture of Click Add New:

Step 4: In the List Menu Select Device/Widget:

Picture of In the List Menu Select Device/Widget:

Step 5: In the Menu Select Bring Your Own Things:

Picture of In the Menu Select Bring Your Own Things:

Note: In here we are using NodeMCU and it's not listed in here, that's why we are selecting Bring Your Own Things.

Step 6: Obtain Credentials

Picture of Obtain Credentials

Save MQTT USERNAME, MQTT PASSWORD, CLIENT ID in a Note (important).

Step 7: Setup NodeMCU/ESP8266

Picture of Setup NodeMCU/ESP8266

Download Arduino IDE and Open Arduino IDE and Set Set additional Board URL:

File => Preference (Ctrl + Comma)

Step 8: Add Nodemcu in Additional Boards Manager

Picture of Add Nodemcu in Additional Boards Manager

In Additional Boards Manager, click add and paste the URL there:

<p>http://arduino.esp8266.com/stable/package_esp8266com_index.json</p>

And click "OK".

Step 9: Download Board Definitions

Picture of Download Board Definitions

Open Board Manager by going to:

Tools => Board => Boards Manger

Open Boards Manager and search for NodeMCU:

Step 10: Download Cayenne Library

Picture of Download Cayenne Library

Click here to Download Cayenne library or Clone from here. After that Open library Manager:

Sketch => Include library => Add .ZIP Library

And select ZIP file that we downloaded (Cayenne library file).

Step 11: Select Our Board and Port

Picture of Select Our Board and Port
Open Board: Tools => Board => NodeMCU ESP-12E

Select Port in same menu (in my case, I have Port-3).

Note: Only the boards appear when you download the Board definitions.

Step 12: Code

Upload the code to NodeMCU by connecting to your computer.

Note: Add the WiFi name and password in the code, also add MQTT username, password, client ID from the Cayenne dash board.

#include <CayenneMQTTESP8266.h>

char ssid[] = "wifi name"; char password[] = "wifi password"; char username[] = "mqtt user name"; char mqtt_password[] = "mqtt password"; char client_id[] = "mqtt client id"; #define trigPin D2 #define echoPin D5 int green = D6; void setup() { Cayenne.begin(username,mqtt_password,client_id,ssid,password); pinMode(green,OUTPUT); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); Serial.begin(115200); digitalWrite(green,HIGH); } void loop(){ Cayenne.loop(); long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; Serial.println(distance); Cayenne.virtualWrite(3,distance); delay(1000); } CAYENNE_IN(1) { digitalWrite(green,!getValue.asInt()); }

Step 13: Connect the Modules

Picture of  Connect the Modules

In here we are using Hc-Sr04 ultarsonic sensor and a LED.

Connect the ultrasonic sensor and led like the diagram.

Step 14: Open the Cayenne Dashboard

Picture of  Open the Cayenne Dashboard

Click Add new and Select Device/Widget.

Step 15: Under the Custom Widgets Select Gauge:

Picture of Under the Custom Widgets Select Gauge:

Step 16: Set a Name and Select Your Device:

Picture of Set a Name and Select Your Device:

Step 17: Set Channel

Picture of Set Channel

Set Channel "1" and Min value to "0" and Max value to "1000". And click Add Widget. Also set LED like this.

Step 18: Dashboard

Picture of Dashboard

You can now see your Waste Bin data and Notification LED In Dashboard.

Step 19: Set a Trigger Notification

Picture of  Set a Trigger Notification

Select Trigger:

Step 20: Drag and Drop Device in If and Then Box.

Picture of Drag and Drop Device in If and Then Box.

Step 21: Select Ultrasoinc Sensor (office Waste Bin).

Picture of Select Ultrasoinc Sensor (office Waste Bin).

Step 22: Setrup Trigger

Picture of Setrup Trigger

And set parameters like this also make you to change to your email. And Save it. Also set LED notification when the Sensor value Below 10 (like this).

Step 23: Let's Try

Picture of Let's Try

Attach the SEBi to your Waste Bin, and fill some waste:

Step 24: After the Bin Is Is Filled Check the Notification LED and Your Mail:

Picture of After the Bin Is Is Filled Check the Notification LED and Your Mail:

Step 25: Video Demo

Comments

About This Instructable

699views

8favorites

License:

More by salmanfarisvp:SEBi: Smart Electric BinDiy Home Made Rocket With Using Old BulbHome Automation Using Arduino Uno
Add instructable to: