Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Technovation
Published © GPL3+

Smart Garbage Monitoring System Using Arduino 101

A method in which waste management is automated. An innovative system that will help keep the city clean and healthy

IntermediateFull instructions provided4 hours89,699

Things used in this project

Hardware components

Arduino 101
Arduino 101
The star of the show, this powerful micro-controller will be used to send the Data via BLE.
×1
Base Shield V2
Seeed Studio Base Shield V2
This shield will all the connections a whole lot simpler.
×1
Arduino Wifi Shield 101
Arduino Wifi Shield 101
This will be connected to the Arduino 101 to then transmit its data through the help of WiFi.
×1
Arduino MKR1000
Arduino MKR1000
As we had the MKR1000 micro controller we used it instead of buying the Arduino WiFi shield 101. We use both the same way so you can choose any one of the two.
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
We used the one from the Grover Arduino 101 kit, any ultrasonic sensor will work, although to connect the starter kit one is easier.
×1
9V battery (generic)
9V battery (generic)
Our power source
×1
9V Battery Clip
9V Battery Clip
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Slide Switch
Slide Switch
×1
LED (generic)
LED (generic)
×3

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk
This is one of the best apps for hobbyist and makers as it let's you visually see your project on any of your devices.

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Bosch Hand drill

Story

Read more

Schematics

Circuit of the system

Connect the Base shield v2 to the Arduino 101, then the Ultrasonic sensor to slot or pin D6. We made a diagram on Fritzing , for those who aren't using the Shield.

Circuit diagram ( without shield)

This one is made on Fritzing an shows the same circuit although this time witout the Base shield.

Code

Iot Garbage Monitoring App

Arduino
This app will display the real time level of the trash with three Leds placed vertically on the Blynk application. Green represents the range from 0 to 25%, Orange from 25 to 60% and Red from 60 to 100%.
#define BLYNK_PRINT Serial

#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
#include <Ultrasonic.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "8b7229b2c3ec4b999eca6781903a208d";

BLEPeripheral  blePeripheral;
WidgetLED green(V1);
WidgetLED orange(V2);
WidgetLED red(V3);


Ultrasonic ultrasonic(7);
int distance = 0;
int thresh [3] = {20,12,4};


void setup() {
  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() {
distance = ultrasonic.distanceRead();
Serial.print(distance);
Blynk.run();
  if(distance<=thresh[0]&&distance>=thresh[1]&&distance>=thresh[2]){
    green.on();
    Serial.println(1);
    }
  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);

}

Credits

Technovation

Technovation

7 projects • 92 followers
We are two young inventors, Kousheek and Satya .We like making robots and tech related things. Our projects focus on simplicity utility.

Comments