IoT Assignment 2
IoT Assignment 2
IoT Assignment 2
Assignment (2 of 2)
By ZinLinHtet
Victoria University College
Introduction
Environmental problems are raised by modern cities for waste collection and disposal.
Therefore, smart trash bin become essential for cities that aim to reduce cost and manage
resources and time. Currently, the trend is shifting towards smart devices and internet of
things (IoT) solutions to overcome common problems such as waste management issues,
pollution and have to touch the lid to open the trash bin will transfer germs and diseases to
people. Optimizing the process of trash collection is the main purpose of the smart solutions
provided by industry. The streets are cover in trash because people throw their trash
everywhere carelessly. So to keep the street clean and tide, there should be a trash bin
everywhere. And this project will help to reduce those trash on the street and keep them
clean. It also prevent physical connection between the trash bin so prevention from germs and
diseases. It also reduce time and energy because it is difficult for all the trash collectors to
find the trashes and collect them. Now with this project they can just collect them more
easily.
Existing problem and development
Street don’t have enough trash bin and people throw their trash everywhere carelessly.
To throw the trash the lid need to be open manually. There will also be a problem if the
person hands are full and can’t be able to open the lid. Overflowing waste bins are an ideal
breeding ground for bacteria, insects, vermin and germs. And it increase the risk of getting
salmonella, which causes typhoid fever, food poisoning, enteric fever, gastroenteritis, and
other major illnesses. To throw the trash people need to open the lid of the trash bin and they
might get germs and other harmful diseases into their bodies. People throw their trash
everywhere so it is also difficult for the trash collector to collect those. To solve this using
IoT I created an automatic open and close Smart Trash Bin. When the user come in front of
the trash bin the trash bin lid will open automatically and prevent the user from physically
touching the trash bin lid and prevent from germs and diseases. Another problem is if the user
hands are full of trash and he/she can’t open the trash bin lid the trash bin will automatically
open it for him/her. The smart trash bin can be controlled remotely so if it is for indoor use
people who are lazy to go near the trash bin and throw their trash they can open the trash bin
with the mobile app and throw the trash. The major need of a smart lifestyle begins with
cleanliness and cleanliness begins with trash bin. A society will get its waste dispatched
properly only if the trash bins are placed well and collected in well prepared so the street and
environment will be clean and it will reduce the pollution. (Anon, 2019)
Proposed system
The aim of my project is to produce a cost effective and affordable design of a smart
trash bin. This system is based on NodeMCU board and ultrasonic sensor to sense the user
and servo motor to open and close the lid. The system is powered by lithium battery power
bank supported by solar cell panel. The objectives are to keep the street clean, to reduce the
pollution, to make people throw their trash in a fun way, to prevent the physical connection
with the trash bin lid to prevent form germs and harmful diseases, to control the trash bin
remotely and to produce the cost effective and affordable trash bin. (Anon, 2019)
Literature Review
The most current related work is done by Zavare and his colleagues [5] on sensor
nodes connected to an Arduino board based control station that uses a GSM module to send
the sensor nodes data by SMS to the garbage collecting vehicle and to a server hosting web
application by a WiFi connection. The sensor nodes data by SMS to the garbage collecting
vehicle and to a server hosting web application by a WiFi connection. The sensor nodes of
the smart bins rely on the ultrasonic sensor to sense the fullness percentage according to pre-
calculated bin depth. Moreover, a GPS module is used to get the bin location. The GPS
module and the ultrasonic sensor are controlled by Amica R2 NodeMCU microcontroller
board which has a built in WiFi module, that is used to connect to the control station.
Another work on wireless sensor network is done by Singh, Mahajan and Bagai[6].
The bins in his work are equipped with an accelerometer sensor to sense the opening and
closing of the bin lid, a temperature and humidity sensor to check the present organic waste,
and an ultrasonic sensor to sense the fullness status of the bin. All these sensors are controlled
by Zigbee pro microcontroller board, which has a built in WiFi module that is used to send
the sensors data to a gateway. This paper also used the same type of microcontroller board in
the gateway to receive the bins data and send it to a control station that contains a server, over
GPRS. The server in the control station relies on Caspio database management system with a
web based user interface.
A paper by Navghane, Killedar and Rohokale[7] examined the use of weight sensor
and three IR sensors to check the fullness status of the smart bin and send the sensors data to
a web page over WiFi network to a mobile phone. The microcontroller board used in this
paper was ARM LPC2148.
A report was done by students of California Polytechnic state University [8],
thoroughly exploited the economic and power consumption aspects of converting a
conventional outdoor trash bin into a smart one. According to the literature, the project is
based on ublox C027-U20 microcontroller board, which has built in GPS module and cellular
module. The board is used to control HC-SR04 ultrasonic sensor, that measures the bin’s
fullness-level, and a temperature sensor for monitoring weather conditions and a fire alerts.
The setup is contained by 2x4x6 plastic box and powered by a 12V rechargeable lead-acid
battery. The report mentioned that the system generates an HTTP POST request using the
data from the sensors and send it to a web application, which is built using Python and Flask
framework on top of a SQLite database. The web application receives the HTTP request and
check if the bin is full then send SMS message using Twilio service. Moreover, Leaflet
JavaScript library is used to virtualize the collected data on a map. In summary, most of the
papers above did not focus on covering the overall cost and power consumption of the
system, which are the main issues tackled by this paper.
Architecture
IoT based solid waste management system: A conceptual approach with an
architectural solution as a smart city application
The Internet of Things (IoT) is constantly evolving and is giving unique solutions to
the everyday problems faced by man. “Smart City” is one such implementation aimed at
improving the lifestyle of human beings. One of the major hurdles in most cities is its solid
waste management, and effective management of the solid waste produced becomes an
integral part of a smart city. This paper aims at providing an IoT based architectural solution
to tackle the problems faced by the present solid waste management system. By providing a
complete IoT based system, the process of tracking, collecting, and managing the solid waste
can be easily automated and monitored efficiently. By taking the example of the solid waste
management crisis of Bengaluru city, India, we have come up with the overall system
architecture and protocol stack to give a IoT based solution to improve the reliability and
efficiency of the system. By making use of sensors, we collect data from the garbage bins and
send them to a gateway using LoRa technology. The data from various garbage bins are
collected by the gateway and sent to the cloud over the Internet using the MQTT (Message
Queue Telemetry Transport) protocol. The main advantage of the proposed system is the use
of LoRa technology for data communication which enables long distance data transmission
along with low power consumption as compared to Wi-Fi, Bluetooth or Zigbee. (Bharadwaj,
Rego and Chowdhury, 2019)
Frameworks
The Internet of Things Platform middleware joins different components together and
enables smooth communication between devices. The interface facilitates the interaction
between the “Internet” and the “Things”, which means hardware or applications. IoT
frameworks seem to focus on real-time data logging solutions, offering some basis to work
with many things and have them interact. Future developments might lead to specific
software-development environments to create the software to work with the hardware used in
the Internet of things. IoT framework is very beneficial for enterprises. With this enterprises
can access premises from anywhere and turn mute data into intelligence.
Some of the IoT platforms are
- Azure by Microsoft
Azure is a collection of Microsoft-managed cloud services that connect,
monitor, and control billions of IoT assets. In simpler terms, an IoT solution is made
up of one or more IoT devices and one or more back-end services running in the cloud
that communicate with each other.
- IoT Platform by Oracle
Oracle's IoT platform gives enterprises the tools and technologies to reliably
integrate, analyze, build, and deploy IoT solutions that deliver analytical insights from
real-time IoT data into your existing applications.
- Watson IoT Platform by IBM
IBM Watson IoT Platform is a managed, cloud-hosted service designed to
make it simple to derive value from your IoT devices.
- Cloud IoT by Google
Google's Internet of Things (IoT) solutions make it easy to build connected
devices. ... Cloud IoT Core is a fully managed service that allows you to easily and
securely connect, manage, and ingest data from millions of globally dispersed
devices.
- IoT Cloud Connect by Cisco –
Cisco Internet of Things (IoT) Cloud Connect is our new mobility-cloud-
based software suite. It offers a complete solution for mobile operators to provide
exceptional IoT experiences.
- Blynk
Blynk is a hardware agnostic IoT platform with customizable mobile apps,
private cloud, device management, analytics, and machine learning and I use blynk to
remotely control my smart trash bin.
Tools
Software
Arduino
The main objective of Arduino is to be able to sense and to get more control over real world
physics. This is an open source, provides prototyping platform which is easy to use either with
software or hardware. It allows developers to create interactive electronic hardware while it software
provides IDE and Arduino programming language (C/C++). And I use the Arduino to write code.
ThingSpeak
ThingSpeak can process HTTP requrests and store and process data. Key features of the open
data platform include an open API, real time data collection, geolocaiton data, data processing and
visualizations, device status messages and plugins. With ThingSpeak, the user can create sensor
logging applications, location tracking applications, and social network of things with status updates.
M2M Labs Mainspring
M2MLabs Mainspring is an open source application framework for building machine to
machine (M2M) applications such as remote monitoring, fleet management or smart grid. Its
capabilities include flexible modeling of devices, device configuration, communication between
devices and applications, validation and normalization of data, long term data storage, and data
retrieval functions. It is based on Java and the Apache Cassandra NoSQL database. M2M applications
can be prototyped in hours rather than weeks and finally transferred to a high performance execution
environment built on top of a standard J2EE server and the highly saleable Apache Cassandra
database.
Eclipse IoT project
Eclipse IoT project include application frameworks and services, open source
implementations of IoT protocols and tools for working with Lua, which Eclipse is promoting as an
ideal IoT programming language.
Kinoma
Kinoma, a Marvell Semiconductor hardware prototyping platform encompasses three
different open source projects. Kimona Create is a DIY construction kit for prototyping electronic
devices. Kimona Studio is the development environment that works with Create and the Kinoma
Platform Runtime. Kimona Connect is a free iOS and Android app that links smartphones and tables
with IoT devices.
Node-RED
A visual tool for wiring the internet of things. That is wiring together hardware devices, APIs
and online services in new and interesting ways. Built on Node.js, Node-RED describes itself as a
visual tool for wiring the internet of things. It allows developers to connect devices, services and APIs
together using a browser based flow editor. It can run on Raspberry Pi, and more than 60000 modules
are available to extend its capabilities. (Peddibhotla, 2019)
Hardware
HC- SR04 Ultrasonic Sensor Module
Ultrasonic Module HC-SR04 works on the principle of SONAR and RANDAR system. It can
be used to determine distance of an object in the range 2cm to 400cm. The module has only 4 pins,
VCC, GND, Trig and Echo. When a pulse of 10µsec or more is given to the Trig pin, 8 pulses of 40
kHz are generated. After this the Echo pin is made high by the control circuit in the module. Echo pin
remains high till it gets echo signal of the transmitted pulses back. The time for which the echo pin
remains high, i.e. the width of the Echo pin gives the time taken for generated ultrasonic sound to
travel to the object and back. Using this time and the speed of sound in air, we can find the distance of
the object using simple formula for distance using speed and time. And I use this ultrasonic sensor to
track user movement. (Electronicwings.com, 2019)
Servo Motor
A servo motor is an electric device used for precise control of angular rotation. It is used in
applications that demand precise control over motion, like in case of control of robotic arm. The
rotation angle of the servo motor is controlled by applying a PWM signal to it. By varying the width
of the PWM signal, we can change the rotation angle and direction of the motor. I use the servo motor
to open or close the trash bin lid. (Electronicwings.com, 2019)
NodeMCU eps8266
The NodeMCU (Node MicroController Unit) is an open source software and hardware
development environment that is built around a very inexpensive System-on-a-Chip (SoC) called the
ESP8266. The ESP8266, designed and manufactured by Espressif Systems, contains all crucial
elements of the modern computer: CPU, RAM, networking (wifi), and even a modern operating
system and SDK. And I use the NodeMCU esp8266 to control the servo motor wirelessly. (IBM
Developer, 2019)
API
IoT APIs are the points of interaction between an IoT device and the internet and/or other
elements within the network.
SOAP – Simple Object Access Protocol
SOAP is a protocol that defines the method of communication between the client and the
server. The transfer of data is done in a XML format. A SOAP web service publishes a definition of
its interface in a machine-readable document using web services definition language.
XML and JSON
XML and JSON are much older methods than SOAP. Instead of using a specific format for
data transfer, both methods use a simpler approach to calls and tend to use much less bandwidth,
which sometimes can be preferred.
REST – Representation State Transfer
When working with IoT hardware development boards such as Particle Photon, Arduino Yun,
Raspberry Pi, Intel Edison/Galileo, Beagle Bone Black/Green plus many more; chances are you will
be using a Restful API to communicate your electronic hardware with the rest of the world using a
IoT software platform. REST APIs are a set of architectural principles rather than a protocol. Some of
the features required for a REST service include the simplicity of interfaces, identification of
resources within the request made and also the ability to manipulate the resources via that particular
interface. From the client side of an application using REST, REST services offer and easy-to-parse
URL structure, made up of mostly nouns that would identify the logic and hierarchical categories of
the data available. (Digikey.com, 2019)
Requirement Specification
Before starting the project the data necessary for the project is needed to collect first. And
there are many methods for collecting data and I will use interviewing method to collect data for my
project I will create an interview question for collecting user requirements data.
Software Components
-Arduino IDE
Hardware Components
- Servo Motor
- Arduino Uno
- Jumpers
- Ultrasonic Sensor
- Two Servo Motors (metal)
Design
I will create a 3D model of the trash bin using 3D software Maya and draw the logo design
with Photoshop. And I will draw the circuit diagram with Fitzing.
Implementation
For this project I will use Arduino IDE to implement on this project. For the language I will
choose C programming.
Testing
After writing code I will test and fix the project using Arduino IDE.
Requirement Specification
I Created interview questions and asked by interviewing people.
I only use these components in the final project. I want to control the trash bin lid wirelessly but in
the original plan I said I will use Arduino Uno but it don’t have WiFi modules so I have to use
NodeMCU (ESP8266). Also I don’t need two servo motors to open the trash bin lid.
Software Requirements
- Arduino IDE
- Blynk Software
Hardware Requirements
- NodeMCU (ESP8266)
- Jumpers
- BreadBoard
- UltraSonic Sensor(HC-SR04)
- Servo Motor
Design
At the design stage, I use blender 3D software to model the 3D version of the trash bin. I
draw the circuit diagram for the project using Fritzing.
In the original plan I said I will use maya for creating the 3D model but I design the trash bin 3D
model version using the Blender 3D software because it is much easier to use and it is also open
source. I also create the logo design of with the Photoshop. And I use fitting for drawing circiuit
diagram.
Figure – 3D model of the trash bin
Coding
In this project I use Arduino IDE to implement on this project. For the language I choose C++
programming. I choose C++ because it is easier than other programming language.
Test 2(Opening the trash bin lid with the Blynk mobile app)
After pressing the on button in the blynk mobile app the trash bin lid didn’t open at all and it
is because of the code error. I accidently add wrong virtual pin number in the code. In the blynk app I
set the on button to Virtual Pin V3 but in the code I set it as V4.
I change the code back and it is now working perfectly.
When the user stand or put their hand in front of the sensor the trash bin lid open.
Test 4 (The trash bin lid close after opening)
After the lid open it close back immediately. And it is because there is no delay time after
opening. So I add the delay and now when the lid open and in 5s it close itself.
Time Scales
7 14.5.2019 Install NodeMCU and libraries for testing WiFi control LED project
8 15.5.2019 Install Blynk app and testing led control with moble over the internet
Step 9 – Connect NodeMCU Vin to positive of the breadboard and GND to negative.
Step 10 – Connect the Ultrasonic sensor VCC to positive of the breadboard, Trig to D4 and Echo to
D3 of the nodemcu, and put the GND to negative of the breadboard.
Step 11 – Install the servo motor to the lid of the dust bin.
Step 12 – Connect the Brown wire to negative of the breadboard, red to the positive and Orange to
the D8 of the Nodemcu.
Step 14 – and finally you can open or close the the Trash bin wirelessly with blynk or ultrasonic.
Advantage and disadvantage of the Smart trash bin
Advantage Disadvantage
Don’t have to touch the lid so prevent from Sensors might get damaged If it is raining.
germs and diseases. The smart trash bin will not work if it is out
If the user hands are full it will open of power.
automatically for the user. If people keep passing across the sensor it
Using smart trash bin improve living will open continuously.
standard.
User Feedback
1. Where will be place the sensors?
2. When open the door of trash bin, all trash bins will open?
3. Who are used? Trash collector or home resident?
4. What is the power supply for the trash bin?
5. What about security?
6. Is there any power break down procedure?
7. How to prototype / what is prototype design?
8. Are you going to supply power to the trash bin 24 hours?
9. What are the difficulties of trash system?
10. Will the lid close within small after leaving the sensor zone.
11. If the lid is open the sensor system know the user?
Bibliography
Bharadwaj, A., Rego, R. and Chowdhury, A. (2019). IoT based solid waste management system: A
conceptual approach with an architectural solution as a smart city application. [online]
Semanticscholar.org. Available at: https://www.semanticscholar.org/paper/IoT-based-solid-waste-
management-system%3A-A-approach-Bharadwaj-Rego/
f3180f8cf17eb07b4f628748ba2f7b6f36c0e018 [Accessed 29 May 2019].
Peddibhotla, G. (2019). 35 Open Source tools for Internet of Things. [online] Kdnuggets.com.
Available at: https://www.kdnuggets.com/2016/07/open-source-tools-internet-things.html [Accessed
29 May 2019].
Electronicwings.com. (2019). Ultrasonic Sensor HC-SR04 Interfacing With Particle Photon | Part...
[online] Available at: https://www.electronicwings.com/particle/ultrasonic-sensor-hc-sr04-interfacing-
with-particle-photon [Accessed 29 May 2019].
Electronicwings.com. (2019). Servo Motor Interfacing With Arduino Uno | Arduino. [online] Available
at: https://www.electronicwings.com/arduino/servo-motor-interfacing-with-arduino-uno [Accessed 29
May 2019].
IBM Developer. (2019). Getting to know NodeMCU and its DEVKIT board. [online] Available at:
https://developer.ibm.com/tutorials/iot-nodemcu-open-why-use/ [Accessed 29 May 2019].
Digikey.com. (2019). How important are APIs in IoT. [online] Available at:
https://www.digikey.com/en/maker/blogs/how-important-are-apis-in-iot [Accessed 29 May 2019].
Anon, (2019). Smart Trash Bin - The IEEE Maker Project. [online] Available at:
https://transmitter.ieee.org/makerproject/view/8c49a [Accessed 29 May 2019].