Skip to content

Instantly share code, notes, and snippets.

View lordzohar's full-sized avatar

Quid Zohar Morbiwala lordzohar

  • mumbai
View GitHub Profile
@lordzohar
lordzohar / smart.ino
Created April 9, 2021 07:18 — forked from vinayyn/smart.ino
Smart dustbin using Arduino,ultrasonic sensor,GSM 900
#include<SoftwareSerial.h>
SoftwareSerial GPRS(5, 6);
int buzzerPin = 8;                          //Pin number the buzzer is connected
int echoPin = 11;                           // Echo Pin of the ultrasonic sensor
int trigPin = 12;                           // Trigger Pin of the ultrasonic sensor
unsigned long previousMillis = 0;           //This will be used to store the millisecnd value after each time the buzzer is triggered. This is used because delay function is not used for the buzzer timing.
int maxBeepInterval = 1000;                 //Max beep interval
int minBeebInterval = 300;                   //Min beep interval
int frequency = 1000;                       //Buzzer frequency in Hz
long distance;                              //Distance of the object from sensorlong echoTime;                              //Time taken for the echo