JustDoElectronics
Published © MIT

Smart Dustbin With GPS Location

Hey Friends In This Video I Will Show You How To Make Smart Dustbin With GPS Location | Smart Garbage Dustbin Using Esp8266, GSM, GPS |

ExpertFull instructions provided3 hours4,770
Smart Dustbin With GPS Location

Things used in this project

Story

Read more

Schematics

CIrcuit Diagram

Code

Code

Arduino
//Prateek
//www.prateeks.in

#define BLYNK_PRINT Serial
#include <Ultrasonic.h>

#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleMKR1000.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "justdo";
char pass[] = "phuhbjjnk";

BlynkTimer timer;
int distance = 0;
int thresh[3] = {25, 50, 75};
Ultrasonic ultrasonic(12, 13);

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



void setup()
{
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
}

void loop()
{
  distance = ultrasonic.distanceRead();
  Serial.println(distance);
  Blynk.run();

  if(distance<thresh[0]){
    green.on();
    }
  else if(distance<thresh[1])
    green.on();
    orange.on();
  }
  else if(distance<thresh[2])
    green.on();
    orange.on();
    red.on();
  }
  else{
    green.off();
    orange.off();
    red.off();
  delay(100);
}

Credits

JustDoElectronics

JustDoElectronics

2 projects • 0 followers
Electronics And Tele-Communication Engineer

Comments