You are on page 1of 52

SMART MOBILE DUSTBIN

A PROJECT REPORT

Submitted by
AJIT KUMAR GUPTA (160606006)
SOURAV KUMAR SAW (160606014)
AMIT KUMAR (160606015)
SANDEEP MAHATO (160606021)

Under the guidance of


Mr. KUNDAN KUMAR
(Assistant Professor, Department of Electronics and Communication Engineering)

In partial fulfilment for the award of the degree


of

BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATION ENGINEERING


Of

RAMGARH ENGINEERING COLLEGE


(ESTD. BY GOVT. OF JHARKHAND & RUN BY TECHNO INDIA UNDER PPP
RAMGARH – 825101
BONAFIDE CERTIFICATE

This is to certify that this project report entitled “SMART MOBILE


DUSTBIN” submitted to Ramgarh Engineering College, Ramgarh, is a
bonafide record of work done by “AJIT KUMAR GUPTA (160606006),
SOURAV KUMAR SAW (160606014), AMIT KUMARM (160606015),
SANDEEP MAHATO (160606021)” under the supervision of Mr.
KUNDAN KUMAR.

SIGNATURE SIGNATURE

DR. SUDIPTO CHAKRABORTY, HOD KUNDAN KUMAR, GUIDE


Associate Professor (ECE) Assistant Professor (ECE)

SIGNATURE

EXTERNAL EXAMINER

Place:
Date:
:

ACKNOWLEDGEMENTS

We Ajit Kumar Gupta, Sourav Kumar saw, Amit Kumar and Sandeep Mahato
would like to express our deepest gratitude to our guide, Mr. KUNDAN KUMAR
for helping us to choose this project SMART MOBILE DUSTBIN and for his
valuable guidance, consistent encouragement, personal caring, timely help and
providing us proper atmosphere for doing project related research.

We would also like to thank the Department of ECE for providing us with the
required equipment’s and facilities to carry out this project.
TABLE OF CONTENT
1 INTRODUCTION ................................................................................ 1
2 METHODOLOGY: .............................................................................. 2
2.1 AUTOMATIC CAP MOVEMENT ................................................................................. 2
2.2 BIN LEVEL MONITORING SYSTEM .......................................................................... 2
2.3 BIN MOVEMENT...................................................................................................... 3
3 HARDWARE’S USED ......................................................................... 4
3.1 ARDUINO UNO R3 BOARD (ATMEGA328) ...................................................... 4
3.2 ULTRASONIC SENSOR (HC SR04)................................................................... 9
3.3 WI-FI MODULE (ESP8266) .............................................................................. 11
3.4 DC MOTER (12 VOLT) ..................................................................................... 13
3.5 MOTOR DRIVER (Q L293D) ............................................................................ 14
3.6 SERVO MOTOR ................................................................................................ 15
3.7 BLUETOOTH MODULE (HC-05) ......................................................................... 16
3.8 JUMPER WIRE .................................................................................................. 19
3.9 POWER SUPPLY (18650 LI-ON BATTERY) ................................................... 19
4 BASIC SOFTWARE USED: ............................................................. 20
4.1 ARDUINO IDE ...................................................................................................... 20
4.2 TINKERCAD...................................................................................................... 21
4.3 MIT APP INVENTOR ............................................................................................. 22
4.4 ADA FRUIT IO ....................................................................................................... 23
4.5 IFTTT .................................................................................................................. 24
5 IMPLIMENTATION ......................................................................... 25
5.1 AUTOMATIC CAP MOVEMENT .................................................................... 25
5.1.3 THE CODE TO ARDUINO FOR AUTOMATIC CAP MOVEMENT .......... 26
5.2 BIN LEVEL MONITORING SYSTEM ........................................................................ 28
5.3 BIN MOVEMENT.................................................................................................... 37
6 EXPERIMENTAL RESULT: ............................................................ 42
7 FUTURE ENHANCEMENT ............................................................. 46
8 CONCLUSION ................................................................................... 46
9 REFERENCES: .................................................................................. 47
ABSTRACT

Many Time we see that the garbage bin or Dustbins placed at public are open
and overloaded. It create an unhygienic condition for people and surrounding.
Sometime due to hygienic problem people avoid to touch dustbins, also they
avoid to go near to dustbins just for putting some waste on it. To overcome all
such situations we are going to implement a project called “SMART
MOBILE DUSTBIN”. In the entire world, waste management is a major
challenging one. If it is not properly dispose or cleaned which will causes lot
of deceases and spoil the green environment. There is need of new mechanism
to properly dispose the waste. In our project, we have design here a Smart
mobile dustbin this smart mobile dustbin automatic open its cap when we pass
our hand above it and closes if we go away from bin, the other feature of this
project is that bin will be mobile in nature and can be control by android
application. If a person wants throw garbage in a bin but he is not in a position
to move or walk to the dustbin then dustbin will come to that person and after
he finishes, bin will come back to the its original position. Apart from this A
web server is also been setup through which the organization will get
information about the bins in their Bins filled or not so that they can dispose.
This idea can be used in various places like general ward of the hospital,
college campus, and conferences. May be in future with enhancement in
technology it can be used in every place.
1 INTRODUCTION
As world is moving forward rapidly still cleanliness is a challenge for most
organization to maintain. Where people there is garbage and for dump them
needs dustbins and it’s also ask for proper maintenance. Sometime its
management cost much for an organization. Conventionally dustbins are takes
a corner any place and when people find needs they went there and dump its
takes people to move to the place where dustbin is. Sometime it is not possible
for people move like in hospitals patients cannot move to the dustbin, there is
always a staff required for it and also the garbage and dustbin always been a
matter of filthy and in most of the cities, the overflowed garbage bins creating
an unhygienic environment. This will further lead to the arise of different
types of unnamed diseases. It open cap and overflow of garbage is common
in many places. In order to solve this issue, we will design here a Smart
mobile dustbin this smart mobile dustbin automatic open its cap when we pass
our hand above it and closes if we go away from bin, the other feature of this
project is that bin will be mobile in nature and can be control by android
application. If a person wants throw garbage in a bin but he is not in a position
to move or walk to the dustbin then dustbin will come to that person and after
he finishes, bin will come back to the its original position. Apart from this A
web server is also been setup through which the organization will get
information about the bins in their Bins filled or not so that they can dispose.
This idea can be used in various places like general ward of the hospital,
college campus, and conferences. May be in future with enhancement in
technology it can be used in every place.-

1
2 METHODOLOGY:
As this project consist three different function so we will implement this
project in three section. In First section we will implement the cap opening
and closing function of bin, in second section we will implement the garbage
level detection and send data directly to the server so that we can see status on
web and in third section we will implement the mobile function of bin, this is
how we will complete this project in three different section.

2.1 AUTOMATIC CAP MOVEMENT


As title show when we pass our over dustbin cap will be open automatically
and when we move away it will c lose. This is implemented through the aid
of hardware and software. Methodology is

Figure 1. System for automatic cap opening

2.2 BIN LEVEL MONITORING SYSTEM


This system monitors the garbage bins and informs about the level of garbage
collected in the dustbins via a web page. Here is the block diagram on how we
are going to upload ultrasonic sensor data to adafrute. Firstly the Arduino will

2
trigger the ultrasonic sensor and collects the data, after calculating the distance
Arduino will convey this data to ESP8266 module via UART / serial
communication. The serial data consists of distance data in cm with 3 to 5
decimal places.

Figure 2. System for bin level monitoring

2.3 BIN MOVEMENT


This project can be moved remotely through mobile application, there will
be an app from which we can control and shift the whole bin from here to
there. There are two part of system first the moving part and second the
remote interfaced application by which we can control bin.

3
Figure 3 . Mobile dustbin system architecture

3 HARDWARE’S USED

 ARDUINO UNO R3 BOARD(ATmega32)


 ULTRASONIC SENSOR (HC SR04)
 WI-FI MODULE(ESP8266)
 DC MOTOR (12 V)
 MOTOR DRIVER(Q L293D)
 SERVO MOTOR
 JUMPER WIRES
 POWER SUPPLY
 BUCKET

3.1 ARDUINO UNO R3 BOARD (ATMEGA328)

Arduino is an open-source electronics platform based on easy-to-use


hardware and software. Arduino boards are able to read inputs - light on a
sensor, a finger on a button, or a Twitter message - and turn it into an output

4
- activating a motor, turning on an LED, publishing something online. You
can tell your board what to do by sending a set of instructions to the
microcontroller on the board. To do so you use the Arduino programming
language (based on Wiring), and the Arduino Software (IDE), based
on Processing. Over the years Arduino has been the brain of thousands of
projects, from everyday objects to complex scientific instruments. A
worldwide community of makers - students, hobbyists, artists,
programmers, and professionals - has gathered around this open-source
platform, their contributions have added up to an incredible amount
of accessible knowledge that can be of great help to novices and experts
alike. Arduino was born at the Ivrea Interaction Design Institute as an easy
tool for fast prototyping, aimed at students without a background in
electronics and programming. As soon as it reached a wider community,
the Arduino board started changing to adapt to new needs and challenges,
differentiating its offer from simple 8-bit boards to products
for IoT applications, wearable, 3D printing, and embedded environments.
All Arduino boards are completely open-source, empowering users to build
them independently and eventually adapt them to their particular needs.
The software, too, is open-source, and it is growing through the
contributions of users worldwide. The Arduino Uno is a microcontroller
board grounded on the ATmega328 (datasheet).

It comprises of 14 digital input/output pins (out of which 6 can be utilized


as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a
facilitation for USB connectivity, a power jack, an ICSP header, and a reset
button. Its designs comprises of assistances that supports the
microcontroller in every possible way. In order to get to work with it one
has to simply connect it to a computer with a USB cable or power it with
an AC-to-DC adapter or battery.

5
Figure 4. Arduino Uno (R3)

3.1.1 SPECIFICATION
Table 1.

Microcontroller ATmega328P

Operating Voltage 5V

Input Voltage
7-12V
(recommended)

Input Voltage (limit) 6-20V

14 (of which 6 provide PWM


Digital I/O Pins
output)

PWM Digital I/O Pins 6

Analog Input Pins 6

DC Current per I/O


20 mA
Pin

DC Current for 3.3V


50 mA
Pin

6
32 KB (ATmega328P) of which
Flash Memory
0.5 KB used by bootloader

SRAM 2 KB (ATmega328P)

EEPROM 1 KB (ATmega328P)

Clock Speed 16 MHz

LED_BUILTIN 13

Length 68.6 mm

Width 53.4 mm

Weight 25 g

3.1.2 ARDUINO PIN DESCRIPTION:

1. Reset Button – This will restart any code that is loaded to the Arduino
board
2. AREF – Stands for “Analog Reference” and is used to set an external
reference voltage
3. Ground Pin – There are a few ground pins on the Arduino and they all
work the same
4. Digital Input/output – Pins 0-13 can be used for digital input or output
5. PWM – The pins marked with the (~) symbol can simulate analog output
6. USB Connection – Used for powering up your Arduino and uploading
sketches
7. TX/RX – Transmit and receive data indication LEDs
8. ATmega Microcontroller – This is the brains and is where the programs
are stored

7
9. Power LED Indicator – This LED lights up anytime the board is plugged
in a power source
10. Voltage Regulator – This controls the amount of voltage going into the
Arduino board
11. DC Power Barrel Jack – This is used for powering your Arduino with a
power supply
12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects
13. 5V Pin – This pin supplies 5 volts of power to your projects
14. Ground Pins – There are a few ground pins on the Arduino and they all
work the same
15. Analog Pins – These pins can read the signal from an analog sensor and
convert it to digital

Figure 5: Arduino pin diagram.

8
3.2 ULTRASONIC SENSOR (HC SR04)

An ultrasonic sensor is an electronic device that measures the distance of a


target object by emitting ultrasonic sound waves, and converts the reflected
sound into an electrical signal. Ultrasonic waves travel faster than the speed
of audible sound (i.e. the sound that humans can hear). Ultrasonic sensors have
two main components: the transmitter (which emits the sound using
piezoelectric crystals) and the receiver (which encounters the sound after it
has travelled to and from the target).

Figure 6. Ultrasonic sensor with pin name.

3.2.1 ULTRASONIC SENSOR PIN CONFIGURATION


Table 2.

Pin Pin Description


Number Name

1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept high
for 10us to initialize measurement by sending US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a
period of time which will be equal to the time taken for
the US wave to return back to the sensor.

4 Ground This pin is connected to the Ground of the system.

9
3.2.2 HC-SR04 SENSOR FEATURES

 Operating voltage: +5V


 Theoretical Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40Hz

3.2.3 EQUIVALENT DISTANCE MEASURING SENSORS


 US transmitter Receiver pair
 IR sensor module
 IR sensor pair
 IR Analog distance sensor
3.2.4 HC-SR04 ULTRASONIC SENSOR - WORKING
Ultrasonic ranging module HC - SR04 offers a 2cm - 400cm non-contact
measurement function, the ranging accuracy could reach up to 3mm. The
building modules includes ultrasonic transmitters, receiver and control circuit.
The basic principle: (1) Making use of IO trigger for at least 10us high level
signal, (2) The Unit inevitably sends eight 40 kHz and detects whether there
is any pulse signal back. (3) If any of a signal is received back in a high level,
time of high output IO duration is the time from sending ultrasonic signal and
receiving it back. Test distance = (high level time× velocity of sound
(340M/S) / 2

Figure 7.Working of ultrasonic sensor.

10
Here electrical energy is transformed into sound to send the pulse. The sound
that is received back is converted into electricity. Thus the time lag between
the sent and received sound signal is used to estimate the distance to the object.
Spacing between sensors is dogged by their beam angles. The sensors must be
spaced so that they do not interfere with each other. This interference is
sometimes referred to as “crosstalk”. The target should be mounted
perpendicular to the axis of the sensor.

3.3 WI-FI MODULE (ESP8266)


The ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP
protocol stack that can give any microcontroller access to your WiFi
network. The ESP8266 is capable of either hosting an application or
offloading all Wi-Fi networking functions from another application
processor. This module has a powerful enough on-board processing and
storage capability that allows it to be integrated with the sensors and other
application specific devices through its GPIOs with minimal development
up-front and minimal loading during runtime. Its high degree of on-chip
integration allows for minimal external circuitry, including the0front-end
module, is designed to occupy minimal PCB area. The ESP8266 supports
APSD for VoIP applications and Bluetooth co-existence interfaces, it
contains a self-calibrated RF allowing it to work under all operating
conditions, and requires no external RF parts. The applications of ESP8266
are Smart power plugs, Home automation, Wi-Fi location-aware devices,
Industrial wireless control, and Security ID tags.

Figure 8. ESP8266 (WiFi Module)

11
3.3.1 ESP8266 PIN CONFIGARATION
Table 3.

Pin Pin Alternate Normally used for Alternate purpose


Number Name Name

1 Ground - Connected to the ground -


of the circuit

2 TX GPIO – 1 Connected to Rx pin of Can act as a General


programmer/uC to upload purpose Input/output
program pin when not used
as TX

3 GPIO-2 - General purpose -


Input/output pin

4 CH_EN - Chip Enable – Active high -

5 GPIO – Flash General purpose Takes module into


0 Input/output pin serial programming
when held low
during start up

6 Reset - Resets the module -

7 RX GPIO – 3 General purpose Can act as a General


Input/output pin purpose Input/output
pin when not used
as RX

8 Vcc - Connect to +3.3V only

12
3.3.2 ESP8266-01 FEATURES
 Low cost, compact and powerful Wi-Fi Module
 Power Supply: +3.3V only
 Current Consumption: 100mA
 I/O Voltage: 3.6V (max)
 I/O source current: 12mA (max)
 Built-in low power 32-bit MCU @ 80MHz
 512kB Flash Memory
 Can be used as Station or Access Point or both combined
 Supports Deep sleep (<10uA)
 Supports serial communication hence compatible with many
development platform like Arduino
 Can be programmed using Arduino IDE or AT-commands or Lua Script

3.4 DC MOTER (12 VOLT)


A DC motor is any of a class of rotary electrical motors that converts direct
current electrical energy into mechanical energy. The most common types rely
on the forces produced by magnetic fields. Nearly all types of DC motors have
some internal mechanism, either electromechanical or electronic, to
periodically change the direction of current in part of the motor.

DC motors were the first form of motor widely used, as they could be powered
from existing direct-current lighting power distribution systems. A DC
motor's speed can be controlled over a wide range, using either a variable
supply voltage or by changing the strength of current in its field windings.
Small DC motors are used in tools, toys, and appliances.

13
Figure 9. DC Motor.

3.4.1 FEATURES

 The metal gears have better wear and tear properties.


 Gearbox is sealed and lubricated with lithium grease and requires no
maintenance.
 Although motor gives 100 RPM at 12V, motor runs smoothly from 4V
to 12V and gives the wide range of RPM, and torque.
 The shaft has a hole for better coupling.
 Operating Voltage(V): 12
 Rated Torque(kg-cm): 2.9
 Stall Torque(kg-cm): 11.4

3.5 MOTOR DRIVER (Q L293D)

L293D is a monolithic integrated, high voltage, high current, 4-channel


driver. Basically this means using this chip you can use DC motors and
power supplies of up to 16 Volts, that’s some pretty big motors and the chip
can supply a maximum current of 600mA per channel, the L293D chip is
also what's known as a type of H-Bridge. The H-Bridge is typically an
electrical circuit that enables a voltage to be applied across a load in either
direction to an output,

14
Figure 10. Motor Driver QL293D.

3.5.1 FEATURES

 Wide Supply-Voltage Range: 4.5 V to 36 V


 Separate Input-Logic Supply
 Internal ESD Protection
 Thermal Shutdown
 High-Noise-Immunity Inputs
 Output Current 600 mA Per Channel
 Peak Output Current 1.2 A Per Channel

3.6 SERVO MOTOR


A servomotor is a rotary actuator or linear actuator that allows for precise
control of angular or linear position, velocity and acceleration. It consists of a
suitable motor coupled to a sensor for position feedback. It also requires a
relatively sophisticated controller, often a dedicated module designed
specifically for use with servomotors.

Servomotors are not a specific class of motor, although the term servomotor is
often used to refer to a motor suitable for use in a closed-loop control system.

15
Figure 11. Servo motor

A servomotor is a closed-loop servomechanism that uses position feedback to


control its motion and final position. The input to its control is a signal (either
analogue or digital) representing the position commanded for the output shaft.
The motor is paired with some type of position encoder to provide position
and speed feedback. In the simplest case, only the position is measured. The
measured position of the output is compared to the command position, the
external input to the controller. If the output position differs from that
required, an error signal is generated which then causes the motor to rotate in
either direction, as needed to bring the output shaft to the appropriate position.
As the positions approach, the error signal reduces to zero and the motor stops.

3.7 BLUETOOTH MODULE (HC-05)


The HC-05 is a Bluetooth module which can be used as two-way (full-duplex)
wireless functionality for any projects. We can use this module to
communicate between two microcontrollers like Arduino or communicate
with any device with Bluetooth functionality like a Phone or Laptop. The
module communicates with the help of USART at 9600 baud rate hence it is
easy to interface with any microcontroller that supports USART. We can also
configure the default values of the module by using the command mode.

16
The HC-05 has two operating modes, one is the Data mode in which it can
send and receive data from other Bluetooth devices and the other is the AT
Command mode where the default device settings can be changed. We can
operate the device in either of these two modes by using the key pin as
explained in the pin description.

It is very easy to pair the HC-05 module with microcontrollers because it


operates using the Serial Port Protocol (SPP). Simply power the module with
+5V and connect the Rx pin of the module to the Tx of MCU and Tx pin of
module to Rx of MCU as shown in the figure below

Figure 12. Bluetooth Module (HC-05)

3.7.1 PIN CONFIGURATION


Table 4.

Pin Pin Name Description


Number
1 Enable / This pin is used to toggle between Data Mode (set
Key low) and AT command mode (set high). By default
it is in Data mode
2 Vcc Powers the module. Connect to +5V Supply voltage
3 Ground Ground pin of module, connect to system ground.

17
4 TX – Transmits Serial Data. Everything received via
Transmitter Bluetooth will be given out by this pin as serial data.
5 RX – Receive Serial Data. Every serial data given to this
Receiver pin will be broadcasted via Bluetooth
6 State The state pin is connected to on board LED, it can
be used as a feedback to check if Bluetooth is
working properly.

3.7.2 HC-05 DEFAULT SETTINGS


 Default Bluetooth Name: “HC-05”

 Default Password: 1234 or 0000

 Default Communication: Slave

 Default Mode: Data Mode

 Data Mode Baud Rate: 9600, 8, N, 1

 Command Mode Baud Rate: 38400, 8, N, 1

 Default firmware: LINVOR

3.7.3 HC-05 TECHNICAL SPECIFICATIONS

 Serial Bluetooth module for Arduino and other microcontrollers


 Operating Voltage: 4V to 6V (Typically +5V)
 Operating Current: 30mA
 Range: <100m
 Works with Serial communication (USART) and TTL compatible
 Follows IEEE 802.15.1 standardized protocol
 Uses Frequency-Hopping Spread spectrum (FHSS)
 Can operate in Master, Slave or Master/Slave mode
 Can be easily interfaced with Laptop or Mobile phones with Bluetooth

18
 Supported baud rate: 9600,19200,38400,57600,115200,230400,
460800.

3.8 JUMPER WIRE


A jump wire (also known as jumper wire, or jumper) is an electrical wire, or
group of them in a cable, with a connector or pin at each end (or sometimes
without them – simply "tinned"), which is normally used to interconnect the
components of a breadboard or other prototype or test circuit, internally or
with other equipment or components, without soldering.

Individual jump wires are fitted by inserting their "end connectors" into the
slots provided in a breadboard, the header connector of a circuit board, or a
piece of test equipment.

Figure 13. Jumper Wire

3.9 POWER SUPPLY (18650 LI-ON BATTERY)


An 18650 Battery is a lithium-ion rechargeable battery. The first 4 digits of
the designation “18650” indicate the physical dimensions while the
5 th digit indicates it is a cylinder cell. The standard 18650 battery is 18mm
around by 65mm long. This type of battery is very common in applications
such as laptop battery packs, flashlights, electric vehicles, cordless tools
and various other devices that require portable power. Voltage rating is 3.7v
and the power rating is 2000mh.

19
Figure 14. 18650 LION BATTERY

4 BASIC SOFTWARE USED:


 Arduino IDE
 Tinkercad
 Adafruit
 IFTTT
 Mit App Inventer

4.1 ARDUINO IDE


The open-source Arduino Software (IDE) makes it easy to write code and
upload it to the board. It runs on Windows, Mac OS X, and Linux. The
environment is written in Java and based on Processing and other open
source software. This software can be used with any Arduino board. The
Arduino development environment contains a text editor for writing code,
a message area, a text console, a toolbar with buttons for common functions,
and a series of menus. It connects to the Arduino hardware to upload
programs and communicate with them. Software written using Arduino are
called sketches. These sketches are written in the text editor. Sketches are
saved with the file extension. ino. It has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and
exporting and also displays errors. The console displays text output by the

20
Arduino environment including complete error messages and other
information. The bottom right-hand corner of the window displays the
current board and serial port. The toolbar buttons allow you to verify and
upload programs, create, open, and save sketches, and open the serial
monitor.

Figure 15. Arduino software IDE

4.2 TINKERCAD
Tinkercad is a free, online 3D modelling program that runs in a web browser,
known for its simplicity and ease of use. It is a popular platform for creating
models for 3D printing and it is also use for electronic circuit design and
simulation.
[4]
Tinkercad was founded as a company in 2010 in the European Union by
former Google engineer Kai Backman and his cofounder Mikko Mononen,
with a goal to make 3D modelling.

21
Tinkercad uses a simplified virtual Element and devices. A design is made up
of electronic elements and connecting wires. Combining different element
such as diode, resistor, Arduino etc. together create new circuit, which can be
simulate at real time. In addition to the standard library of primitive circuit, a
user can create different circuit and allow us simulate our circuit for electronic
circuit.

Figure 15. Tinker cad logo

4.3 MIT APP INVENTOR


MIT App Inventor is a web application integrated development environment
originally provided by Google, and now maintained by the Massachusetts
Institute of Technology (MIT). It allows newcomers to computer
programming to create application software (apps) for two operating systems
(OS): Android, and iOS, which, as of 8 July 2019, is in final beta testing. It is
free and open-source software released under dual licensing: a Creative
Commons Attribution ShareAlike 3.0 Unposted license, and an Apache
License 2.0 for the source code.

It uses a graphical user interface (GUI) very similar to the programming


languages Scratch (programming language) and the StarLogo, which allows
users to drag and drop visual objects to create an application that can run on
android devices, while a App-Inventor Companion (The program that allows
the app to run and debug on) that works on iOS running devices are still under
development. In creating App Inventor, Google drew upon significant prior

22
research in educational computing, and work done within Google on online
development environments.

App Inventor and the other projects are based on and informed
by constructionist learning theories, which emphasize that programming can
be a vehicle for engaging powerful ideas through active learning. As such, it
is part of an ongoing movement in computers and education that began with
the work of Seymour Papert and the MIT Logo Group in the 1960s, and has
also manifested itself with Mitchel Resnick's work on Lego Mind
storms and Star Logo.

App Inventor also supports the use of cloud data via an


experimental Firebase# Firebase Real-time Database component.

Figure 16. MIT App Inventor logo.

4.4 ADA FRUIT IO


Adafruit.io is a cloud service with we can connect to it over the
Internet.it means we can store and then retrieve data from anywhere in
the world, apart from this it can do a lot more than just that like:

 Display your data in real-time, online


 Make your project internet-connected: Control motors, read sensor data,
and more!
 Connect projects to web services like Twitter, RSS feeds, weather
services, etc.
 Connect your project to other internet-enabled devices
23
Adafruit.io can handle and visualize multiple feeds of data.
Dashboards are a feature integrated into Ada-fruit IO which allow you
to chart, graph, gauge, log, and display your data. You can view your
dashboards from anywhere in the world.

Dashboards

Figure 17. Ada-fruit Dashboard for level monitoring.

4.5 IFTTT
If This Then That, also known as IFTTT is a freeware web-based service that
creates chains of simple conditional statements, called applets.

An applet is triggered by changes that occur within other web services such
as Gmail, Facebook, Telegram, Instagram, or Pinterest.

For example, an applet may send an e-mail message if the user tweets using
a hashtag, or copy a photo on Facebook to a user's archive if someone tags a
user in a photo.

In addition to the web-based application, the service runs on iOS and Android.
In February 2015, IFTTT renamed its original application to IF, and released
a new suite of apps called Do, with which users can create shortcut
applications and actions. As of 2015, IFTTT users created about 20 million
recipes each day. All of the functionalities of the Do suite of apps have since
been integrated into a redesigned IFTTT app.

24
5 IMPLIMENTATION

5.1 AUTOMATIC CAP MOVEMENT


This function of project is implemented by using ultrasonic sensor, servo moter, and
arduino uno.

5.1.1 Circuit Diagram:

Figure 18. Block Diagram

5.1.2 Hardware implementation/Simulation


Connection of Ultrasonic sensor1 to arduino:

 trigger >>>>> Arduino pin D6


 Echo >>>>>> Arduino pin D5
 GND >>>>>> GND
 VCC >>>>>> 5V

Connection of servo moter to arduino:

 VCC >>>>>> 5V
 Signal >>>>> Arduino pin D2
 GND >>>>>> GND

25
Figure 19. Simulation of Cap movement

Figure 20. Circuit for Cap opening function

5.1.3 THE CODE TO ARDUINO FOR AUTOMATIC CAP MOVEMENT.


#include <Servo.h>

Servo servo1;

int trigPin = 6;
int echoPin = 5;

long distance;

26
long duration;

void setup()

servo1.attach(2);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);// put your setup code here, to run once:

void loop() {

ultra();

servo1.write(0);

if(distance <= 10){

servo1.write(90);

void ultra(){

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = duration*0.034/2;

27
}

5.2 BIN LEVEL MONITORING SYSTEM


In this section the level of garbage will detected by ultrasonic sensor and the
result will show on web page.

5.2.1 Circuit Simulation:

Figure 21. Circuit diagram for Bin level monitoring system

5.2.2 Hardware implementation


Connections to upload program in ESP8266:

 GPIO 0 pin of ESP8266 >>>>>>GND of Arduino UNO.


 Rx pin of ESP8266 >>>>> Rx of Arduino UNO.
 Tx pin of ESP8266 >>>>> Tx of Arduino UNO.
 CH_EN pin of ESP8266 >>>>>3.3 V supply of Arduino UNO.
 VCC pin of ESP8266 >>>>> 3.3 V supply of Arduino UNO.
 RESET pin of Arduino UNO >>>>GND of Arduino UNO.
 RESET pin of ESP8266 >>>>>>>GND of Arduino UNO as a
push button.

28
Figure 22: Circuit of uploading program to ESP8266

5.2.3 CODE FOR ESP8266:

#include <ESP8266WiFi.h>

#include "Adafruit_MQTT.h"

#include "Adafruit_MQTT_Client.h"
#define WLAN_SSID "Sim 22"

#define WLAN_PASS "akku1234"


#define AIO_SERVER "io.adafruit.com"

#define AIO_SERVERPORT 1883


#define AIO_USERNAME "ksourav940"

#define AIO_KEY "aio_TIaW83Y5OP1uiAY1FQpt4mxkaL94"

uint16_t num1;

WiFiClient client;

29
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT,

AIO_USERNAME, AIO_KEY);

Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");

Adafruit_MQTT_Subscribe Relay1=

Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/Led");

void MQTT_connect();

void setup()
{
pinMode(2,OUTPUT);
Serial.begin(115200);
delay(10);
Serial.println(); Serial.println();
Serial.print("Connecting to ");
Serial.println(WLAN_SSID);
WiFi.begin(WLAN_SSID, WLAN_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

mqtt.subscribe(&Relay1);
}

uint32_t x=0;

30
void loop() {
MQTT_connect();
Adafruit_MQTT_Subscribe *subscription;
while ((subscription = mqtt.readSubscription(5000))) {
if (subscription == &Relay1) {
Serial.print(F("Got Relay1: "));
Serial.println((char *)Relay1.lastread);
num1=atoi((char *)Relay1.lastread);
digitalWrite(2,num1);
}
}
}

void MQTT_connect() {
int8_t ret;
if (mqtt.connected()) {
return;
}
Serial.print("Connecting to MQTT... ");
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0)
{
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000);
retries--;
if (retries == 0) {
while (1);
}
}
Serial.println("MQTT Connected!");

31
}

Figure 23. Level of the bin

Connections for Ultrasonic sensor to ESP8266:-


 Vcc pin of sensor >>>>> main power supply (5V).
 VCC pins of ESP8266 >>>>power supply (3.3V).
 CH_EN pins of ESP8266 >>>>power supply (3.3V).
 GPIO2 pin of ESP8266 >>>>Echo pin of sensor.
 GPIO0 pin of ESP8266 >>>> trigger pin of sensor.
 GND pin of sensor >>>>> GND.

32
Figure 24. Circuit of ultrasonic sensor connected to ESP8266.

5.2.4 CODE for Bin level monitoring system


#include <ESP8266WiFi.h>

#include "Adafruit_MQTT.h"

#include "Adafruit_MQTT_Client.h"

#define WLAN_SSID "Sim 22"


#define WLAN_PASS "akku1234"

#define AIO_SERVER "io.adafruit.com"

#define AIO_SERVERPORT 1883


#define AIO_USERNAME "ksourav940"

#define AIO_KEY "aio_TIaW83Y5OP1uiAY1FQpt4mxkaL94"

int trigPin = 0;

33
int echoPin = 2;
WiFiClient client;

void MQTT_connect();

void setup() {
Serial.begin(115200);
delay(10);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.println(F("Adafruit MQTT demo"));
Serial.println(); Serial.println();
Serial.print("Connecting to ");
Serial.println(WLAN_SSID);
WiFi.begin(WLAN_SSID, WLAN_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: "); Serial.println(WiFi.localIP());

uint32_t duration, cm,temp, pub;

void loop() {
MQTT_connect();
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

34
duration = pulseIn(echoPin, HIGH);
cm = (duration/2) / 29.1;
temp = cm*5.65;
if(temp>10&&temp<=20)
pub=100;
if(temp>20&&temp<=30)
pub=90;
if(temp>30&&temp<=40)
pub=80;
if(temp>40&&temp<=50)
pub=70;
if(temp>50&&temp<=60)
pub=60;
if(temp>60&&temp<=70)
pub=50;
if(temp>70&&temp<=80)
pub=40;
if(temp>80&&temp<=90)
pub=30;
if(temp>90&&temp<=100)
pub=20;
if(temp>100&&temp<110)
pub=10;
if(temp>=110)
pub=0;

if(pub>=100)
pub=100;
Serial.print(F("\nSending level val "));
Serial.print(pub);

Serial.print("...");
if (!level.publish(pub)) {
Serial.println(F("Failed"));

35
} else {
Serial.println(F("OK!"));
}

delay(2000);

void MQTT_connect() {
int8_t ret;

if (mqtt.connected()) {
return;
}

Serial.print("Connecting to MQTT... ");

uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) {
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0) {
// basically die and wait for WDT to reset me
while (1);
}
}
Serial.println("MQTT Connected!");
}

36
5.3 BIN MOVEMENT
The entire system can be move from here to there, so that one can bring their
dustbin to their comfortable place.

This can be implemented through Arduino, motor diver, and Bluetooth


module.

Circuit diagram

Figure 25. Circuit for Bin movement

5.3.1 Hardware implementation

Connection of motor driver (Q L293D) to Arduino

Module 5V (VCC) >>>>> Arduino 5V.

Module GND >>>>>> Arduino GND.

Module 1 >>>> Arduino D8.

Module 2 >>>> Arduino D9.

Module 3 >>>> Arduino D10.


37
Module 4 >>>> Arduino D11.

Module Motor terminals >>>> DC motors.

Module VSS power terminal >>>>> External power source of 9V.

Figure 26. Arduino with QL293D Motor Driver

While using this shield 6 analog Pins (which can be used as digital pins
too), pin 2 and pin 13 of Arduino are free.

In the case of using DC motor, pin11 for #1, pin3 for #2, pin5 for #3, pin6
for #4 and pins 4, 7, 8 and 12 for all of them are in use.

Figure 27. DC Motor with Arduino and Motor Driver

Note: In case applying separate power supply to Arduino and shield, make
sure you have disconnected the jumper on the shield .

38
Connection of Bluetooth module to Arduino.

RX <----------------> TX

TX <----------------> RX

5V <----------------> VCC

GND <----------------> GND

Figure 28. Circuit of Bluetooth with Arduino.

Figure 29. Bottom part of bin.

39
Figure 31. Smart bin.

Code for Bin movement

int motorRightA = 5; //Right Motor-clockwise


int motorRightB = 6; //Right Motor-anticlockwise
int motorLeftA = 11; //Left Motor-clockwise
int motorLeftB = 12; //Left Motor-clockwise

char bt = 0; //BT

void setup()
{
Serial.begin(9600);

pinMode(motorRightA,OUTPUT);
pinMode(motorRightB,OUTPUT);
pinMode(motorRightB,OUTPUT);
pinMode(motorLeftB,OUTPUT);
}
void loop()
{
if (Serial.available() > 0)
{
bt = Serial.read();
digitalWrite(led, 1);

40
if(bt == 'F') //move forwards
{
digitalWrite(motorRightA, HIGH);
digitalWrite(motorRightB, LOW);
digitalWrite(motorLeftA, HIGH);
digitalWrite(motorLeftB, LOW);
}
else if (bt == 'B') //move backwards
{
digitalWrite(motorRightA, LOW);
digitalWrite(motorRightB, HIGH);
digitalWrite(motorLeftA, LOW);
digitalWrite(motorLeftB, HIGH);
}
else if (bt == 'S') //stop!!
{
digitalWrite(motorRightA, LOW);
digitalWrite(motorRightB, LOW);
digitalWrite(motorLeftA, LOW);
digitalWrite(motorLeftB, LOW);
}
else if (bt == 'R') //right
{
digitalWrite(motorRightA, HIGH);
digitalWrite(motorRightB, LOW);
digitalWrite(motorLeftA, LOW);
digitalWrite(motorLeftB, LOW);
}
else if (bt == 'L') //left
{
digitalWrite(motorRightA, LOW);
digitalWrite(motorRightB, LOW);
digitalWrite(motorLeftA, HIGH);

41
digitalWrite(motorLeftB, LOW);
}
else if (bt == 'I') //forward right
{
digitalWrite(motorRightA, HIGH);
digitalWrite(motorRightB, LOW);
digitalWrite(motorLeftA, LOW);
digitalWrite(motorLeftB, HIGH);
}
else if (bt == 'G') //forward left
{
digitalWrite(motorRightA, LOW);
digitalWrite(motorRightB, HIGH);
digitalWrite(motorLeftA, HIGH);
digitalWrite(motorLeftB, LOW);
}

6 EXPERIMENTAL RESULT:
All the sub system of smart mobile dustbin is design and simulated. The
system is designed in such a way that when a person wises to throw the
garbage then ultrasonic sensor will sense the person hand and it will give
command to the servo motor through Arduino which leads the action of
opening of a flap automatically. A movant of garbage bin is done by s simple
small four wheeler automatic car. A smart bin is kept at the top of the car and
the movant is control by mobile based android application which is design in
MIT app Inventor. Also the level of the is continuously measured and

42
monitored. Some operation of the system is simulated. Given Fig. which
shows the cap movement function of bin through simulation.

Result 1.

Figure 30. When NO Object near ultrasonic sensor the cap of Bin Remains closed.

Result 2.

Figure 31. When an object came near to ultrasonic sensor Cap is open automatically.

43
Result 3.

Figure 32 .Showing that the status of bin level that what percentage of bin filed in real time.

Result 4.

Figure 34. Mobile application.

44
Final Result of the Project:-

Figure 35 .Smart Bin Mobile System when flap is closed

Figure 36. Smart Bin Mobile System when flap is opened

45
7 FUTURE ENHANCEMENT
 Using Machine learning and artificial intelligence it can be identify
human instruction and path.
 Identify garbage and collect it itself.
 It be the part of smart city ecosystem.
 Communicate with other devices for cleanliness.

8 CONCLUSION
In the entire world, waste management is a major challenging one. If it is not
properly dispose or cleaned which will causes lot of deceases and spoil the
green environment. There is need of new mechanism to properly dispose the
waste. In our project, we have design here a Smart mobile dustbin this smart
mobile dustbin automatic open its cap when we pass our hand above it and
closes if we go away from bin, the other feature of this project is that bin will
be mobile in nature and can be control by android application. If a person
wants throw garbage in a bin but he is not in a position to move or walk to the
dustbin then dustbin will come to that person and after he finishes, bin will
come back to the its original position. Apart from this A web server is also
been setup through which the organization will get information about the bins
in their Bins filled or not so that they can dispose. This idea can be used in
various places like general ward of the hospital, college campus, and
conferences. May be in future with enhancement in technology it can be used
in every place.

46
9 REFERENCES:

1. Kumar, N. S., Vuayalakshmi, B., Prarthana, R. J., & Shankar, A. (2016). IOT based smart
garbage alert system using Arduino UNO. 2016 IEEE Region 10 Conference (TENCON)
2. S.S.Navghane, M.S.Killedar, Dr.V.M.Rohokale,"IOT based Smart Garbage andWaste
Collection",International Journal of Advanced Research in Elec- tronics and Communication
Engineering (IJARECE)Volume 5, Issue 5, May 2016.
3. Mr. V.Nanthakumar1 , Mr.S.Balakrishnan2 , Mr.G.Naveen kumar3 , Mr.R.Kanagarathinam4 .
AUTOMATED SELF NAVIGATED DUSTBIN DISPENSARY SYSTEM IN SMART CITIES
4. Journal of Information and Computational Science ISSN: 1548-7741 123 Volume 13 Issue 3 –
2020 www.joics.net

5. https://www.electronicwings.com/sensors-modules/bluetooth-module-hc-05-

6. https://components101.com/wireless/hc-05-bluetooth-module

7. Hardesty, Larry (August 19, 2010). "The MIT roots of Google's new software". MIT News
Office.

8. Wolber, David; Abelson, Hal; Spertus, Ellen; Looney, Liz (May 2011), App Inventor for
Android: Create Your Own Android Apps, O'Reilly, ISBN 978-1-4493-9748-7
9. https://create.arduino.cc/projecthub/121669/arduino-bluetooth-controlled-rc-car-9673ea
10. IOT - Smart Jar Using ESP8266 , Arduino and Ultrasonic Sensor Publishing Data in Local
Server from https://www.instructables.com/id/IOT-Smart-Jar-Using-ESP8266-Arduino-
and-Ultrasonic/
11. Smart Dustbin using Arduino Uno from https://bestengineeringprojects.com/smart-dustbin-
using-arduino-uno/

12. https://store.arduino.cc/usa/arduino-uno-rev3

13. https://components101.com/ultrasonic-sensor-working-pinout-datasheet Jump wire


patents
14. https://www.makerspaces.com/arduino-uno-tutorial-beginners/

15. www.tinkercad.com

47

You might also like