saravana surendar
Published © GPL3+

Bin Tracker

This system monitors the garbage level and sends an sms to the user when value crosses threshold value.

BeginnerFull instructions provided5 hours144
Bin Tracker

Things used in this project

Story

Read more

Schematics

HARDWARE

Hardware setup:



Ultrasonic to arduino connections

Vcc -> 5V#SUPPLY VOLTAGE TO SENSOR

Trig -> 12

Echo -> 13

GND -> GND

Arduino to bolt wifi modiule connections

Rx -> TX#RX->RECIEVER, TX->TRANSMITTER

Tx -> RX

GND -> GND

VIN->5V #SUPPLY VOLTAGE TO BOLT



After completing the above connections just power on ur arduinoby connecting the arduino to your laptop/pc via usb cable and then u will see all the light glowing like this In the below picture

Code

Server Coding

Python
from boltiot import Bolt, Sms #Import Sms and Bolt class  from boltiot library 

import bolt, json, time # accesing the json and time function 

 Maxlimit= 10 # the distance between device and garbage in dustbin in cm
  

mybolt = Bolt(bolt.API, bolt.ID) #Create object to fetch data 

sms = Sms(bolt.SID, bolt.AUTH, bolt.TO, bolt.FROM) #Create object to send SMS 

response = mybolt.serialRead('13')# we are now receiving the data read at the 13th pin of arduino board 

print(response) 

  

while True: 

    response = mybolt.serialRead('13')  #Fetching the value from Arduino 13th pin 

    data = json.loads(response)#storing the value received to the bolt from arduino 

    glevel = data['value'].rstrip()#storing the integer part  

    print("Garbage level is", glevel) 

     

     if (int(glevel) <= Maxlimit or int(glevel)==357): 

         response = sms.send_sms('Hello  I am full,please clean me out') #sending the sms to your mobile number 

    time.sleep(2.5)#time between two consecutive readings in seconds 

Arduino

C/C++
Code Uploaded to Arduino
#include <Ultrasonic.h>/* library to access the function distance read*/ 

 Ultrasonic ultrasonic(12, 13);/*trig-12,echo-13*/ 

 void setup() {/* setting up the sensor to work*/ 

  Serial.begin(9600); /* initializing the frequency to run the sensor*/ 

  } 

 void loop() {/* initializing the loop*/ 

 Serial.println(ultrasonic.distanceRead());/* prints the distance measure by the sensor on the serial monitor also transmits these values to the bolt wifi module*/ 

  delay (4000) ;/* time taken between two consecutive readings*/ 

} 

Bolt Iot

Python
Has all the credentials for bolt iot to access the cloud and Twillio account via API
 API = "bolt cloud api" 

 ID  = "device" 

 # Credentials required to send SMS 

SID = 'your twillio account sid' 

AUTH = 'your twillio account auth token' 

FROM = 'your twillio number' 

TO =' your number to get alert sms, please dont forget to add your country  code in the beginning of your phone number '

# Save it in a separate file called as bolt.py and then we can acces this file in the main code by importing it there

Credits

saravana surendar
2 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.