Garbage Monitoring
Garbage Monitoring
Project
Report on
IoT based smart garbage monitoring system in cities-To
detect metal or non-metal
BONAFIDE CERTIFICATE
Internal Guide
DECLARATION
Date: 01/03/2022.
Place: Chennai
I convey my thanks to Dr. M Nandita, Dean, School of Electronics and Dr. Ravi
Kumar, Head of the Department, Dept. of Electronics for providing me necessary
support and details at the right time during the progressive reviews.
This reduce the unhygienic condition and avoids health issues, here in
case of wet waste, we are converting it to manure, hence total number of trips of
garbage collection vehicle is reduced, thereby overall expenditure associated with
the garbage collection will also be minimize.
TABLE OF CONTENT
2. LITERATURE SURVEY......................................2
4. EXPERIMENTAL OR MATERIALS.......................7
AND METHODS USED
4.2 NODE MCU.....................................10
6. UBIDOTS EXPLORER............................................49
7. CONCLUSION........................................................58
8. REFERENCES........................................................59
CHAPTER-I
1.1 INTRODUCTION:
As the world is in a stage of up gradation, there is one stinking problem [1]
we have to deal with. Garbage! In our daily life, we see the pictures of garbage
bins being overfull and all the garbage spills out. This leads to the number of
diseases as large number of insects and mosquitoes breed on it. A big challenge
in the urban cities is solid waste management not only in India but for most of the
countries in the world. Hence, such a system has to be build which can eradicate
this problem or at least reduce it to the minimum level. The project gives us one
of the most efficient ways to keep our environment clean and green. The smart
city [2] concept is still new in India, although it has received a lot of attention in
few years when our present prime minister gave the idea of building 100 smart
cities throughout India. Now, with the upcoming large number of smart cities,
large numbers of responsibilities are also required to be fulfilled. The prime need
of a smart lifestyle begins with cleanliness and cleanliness begins with dustbin. A
society will get its waste dispatched properly only if the dustbins are placed well
and collected well. The main problem in the current waste management system
in most of the Indian cities is the unhealthy status of dustbins. In this paper we
have tried to upgrade the trivial but vital component of the urban waste
management system, i.e. dustbin. Now with the rise of technology it is high time
that we should use technology for waste management systems [2]. As we have
seen that technology with analytics has made the world a better place to live by
its application in the field of genetics, insurance, marketing, engineering, banking
etc in past many years. So, in this paper we have integrated analytics and
electronics in order to create optimal changes in the conventional methodology of
waste collection with the large amount of data that is being produced by the
smart bin networks.
CHAPTER -2
2.1 LITERATURE SURVEY
As we know, the large bins are present in each locality and serve as the
centre point of garbage of that particular locality. The garbage collection team
collects the garbage from these central bins in their trucks. Our model of
hardware is going to be applied in these central bins and thus making them smart
bins. For this we have divided the dustbin into three different levels according to
the level of garbage filled. Accordingly, the text messages indicating the levels
are being sent to the central office, which acts as a data warehouse for all the
level data being sent by the different bins. The central office of waste
management department now will be able to track the level of every dustbin
getting filled up just by sitting in their office at real time. This information will now
guide them efficiently to take up the action of sending the trucks to empty the
dustbin whose levels are significant. The hardware has used some very basic
electronic components to make out the complete system at the best possible
cost. The built hardware can be implemented at any dustbin irrespective of its
size and height and thus is portable with any bins.
This is not an original idea, for the implementation of smart garbage bin;
the idea has existed for many years, After the IoT field finding its grip in our lives.
This is, however an original plan for designing a smart garbage bin with weight
sensor, IR sensor and Wi-Fi module for transmission of data. [1]. A State of the
Art review on Internet of Things by P. Suresh, Vijay. Daniel, R.H. Aswathy, Dr. V.
Parthasarathy. It gave the idea of IoT subject and addition details about IoT. The
proper smart environment and various applications.
[2].Internet of Things: Challenges and state-of-theart solutions in Internet-scale
Sensor Information Management and Mobile analytics by Arkady Zaslavsky,
Dimitrios Georgakopoulos. This paper gave us the details about mobile analysis
and sensor information management that will help in data segregation of various
dustbins. [3]Top-k Query based dynamic scheduling for IoTenabled small city
waste collection by Theodoros Anagnostopoulos, Arkady Zaslavsky, Alexey
Medvedev, Sergei Khoruzhnicov. It gave us the concept of dynamic scheduling
required for the cleaning of dustbin and the Top-k query led us to priority based
cleaning of dustbins [4]City Garbage collection indicator using RF(Zigbee) and
GSM technology. This paper gave the details for the module required for the
transmission of the data to the receiver side and also the main channel follow of
the project. Initially we used GSM technology for our project but later on decided
to us Wi-Fi module for the ease of data transmission.
[2].Internet of Things: Challenges and state-of-theart solutions in Internet-scale
Sensor Information Management and Mobile analytics by Arkady Zaslavsky,
Dimitrios Georgakopoulos. This paper gave us the details about mobile analysis
and sensor information management that will help in data segregation of various
dustbins. [3]Top-k Query based dynamic scheduling for IoTenabled small city
waste collection by Theodoros Anagnostopoulos, Arkady Zaslavsky, Alexey
Medvedev, Sergei Khoruzhnicov. It gave us the concept of dynamic scheduling
required for the cleaning of dustbin and the Top-k query led us to priority based
cleaning of dustbins [4]City Garbage collection indicator using RF(Zigbee) and
GSM technology. This paper gave the details for the module required for the
transmission of the data to the receiver side and also the main channel follow of
the project. Initially we used GSM technology for our project but later on decided
to us Wi-Fi module for the ease of data transmission.
Literature survey:
Title 1:
Title 2:
Author: Chitluri Sai Srikanth, Tadivaka Bhupathi Rayudu, Javvaji Radhika, Raju
Anitha
To avoid each such condition, we plan to propose a reaction for this issue "Sharp
Garbage Bin", which will alert and set up the maintained individual when the
waste compartment will fill. By then message will be send to the gotten a handle
on individual to amass the hardship from the specific territory. The announced
individual will send the message from his web application to the waste specialists
by sending a SMS. In this undertaking we use strain check to know the burglary
of the report. This will diminish the flood of the waste compartment and suitably
keeping nature clean.
CHAPTER -3
EXISTING SYSTEM:
• In a smart bin using some kind of sensor like IR and Ultrasonic sensor is
used to identify the bin is filled or not.
• If it is filled means it sends message to garbage management contractor or
office in IOT technology or GSM based technology.
• This is already existing technology.
• This bin can separates dry waste, wet waste and e-waste.
PROPOSED SYSTEM;
• In this proposed system it divides the waste into dry waste, wet waste, e-
waste and metal or non metal.
• Using ultrasound sensor used to detect the level of waste in garbage bin.
When the bin filled with 50% then alert messages send to the ward
member, and it will filled with 90% the alert message send to the
government.
• The bin is continuously monitoring the level of garbage if it’s full means it
gives alert to Government Corporation. When a corporation separate the
waste for recycle process.
• After the recycling process is completed when a government organization
gives notification to some corporate company, NGO etc.
• It is also have another advantage to reduce environmental pollution and it
increase the financial support in government organization.
3.2 Block diagram:
HARDWARE USED:
• Nodemcu
• ultrasonic sensor
• DHT11 sensor
• smoke sensor
• metal detector
SOFTWARE USED:
Arduino c
CHAPTER -4
4.1 Communication
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL
(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The '16U2 firmware
uses the standard USB COM drivers, and no external driver is needed. However,
on Windows, a inf file is required. The Arduino software includes a serial monitor
which allows simple textual data to be sent to and from the Arduino board. The
RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
Power Micro-USB, 3.3V, Micro-USB: NodeMCU can be powered through the USB port
GND, Vin
3.3V: Regulated 3.3V can be supplied to this pin to power the
board
Control EN, RST The pin and the button resets the microcontroller
Pins
GPIO Pins GPIO1 to GPIO16 NodeMCU has 16 general purpose input-output pins on its
board
SPI Pins SD1, CMD, SD0, NodeMCU has four pins available for SPI communication.
CLK
UART Pins TXD0, RXD0, NodeMCU has two UART interfaces, UART0 (RXD0 & TXD0)
TXD2, RXD2 and UART1 (RXD1 & TXD1). UART1 is used to upload the
firmware/program.
I2C Pins NodeMCU has I2C functionality support but due to the internal
functionality of these pins, you have to find which pin is I2C.
The Nodemcu Development Board can be easily programmed with Arduino IDE
since it is easy to use.
Programming Nodemcu with the Arduino IDE will hardly take 5-10 minutes. All
you need is the Arduino IDE, a USB cable and the NodeMCU board itself. You
can check this Getting Started Tutorial for NodeMCU to prepare your Arduino IDE
for NodeMCU.
THERMOCOUPLE:
Thermistors:
Semiconductor sensors:
They are classified into different types like Voltage output, Current output,
Digital output, Resistance output silicon and Diode temperature sensors. Modern
semiconductor temperature sensors offer high accuracy and high linearity over
an operating range of about 55°C to +150°C. Internal amplifiers can scale the
output to convenient values, such as 10mV/°C. They are also useful in cold-
junction compensation circuits for wide temperature range thermocouples. A brief
details about this type of temperature sensor are given below.
SENSOR ICS
There are a wide variety of temperature sensor ICs that are available to
simplify the broadest possible range of temperature monitoring challenges. These
silicon temperature sensors differ significantly from the above mentioned types in
a couple of important ways. The first is operating temperature range. A
temperature sensor IC can operate over the nominal IC temperature range of -
55°C to +150°C. The second major difference is functionality.
Low self-heating,
This presumes that the ambient air temperature is just about the same as the
surface temperature; if the air temperature were much higher or lower than
the surface temperature, the actual temperature of the LM35 die would be at
an intermediate temperature between the surface temperature and the air
temperature.
Image shows externals of a standard gas sensor module: a steel mesh, copper
clamping ring and connecting leads. The top part is a stainless steel mesh which
takes care of the following:
Filtering out the suspended particles so that only gaseous elements are able to
pass to insides of the sensor.
In order to manage above listed functions efficiently, the steel mesh is made into
two layers. The mesh is bound to rest of the body via a copper plated clamping
ring.
The connecting leads of the sensor are thick so that sensor can be
connected firmly to the circuit and sufficient amount of heat gets conducted to the
inside part. They are casted from copper and have tin plating over them. Four of
the six leads (A, B, C, D) are for signal fetching while two (1, 2) are used to
provide sufficient heat to the sensing element.
The pins are placed on a Bakelite base which is a good insulator and provides
firm gripping to the connecting leads of the sensor.
The top of the gas sensor is removed off to see the internals parts of the
sensor: sensing element and connection wiring. The hexapod structure is
constituted by the sensing element and six connecting legs that extend beyond
the Bakelite base.
Using a ceramic substrate increases the heating efficiency and tin oxide,
being sensitive towards adsorbing desired gas’ components (in this case
methane and its products) suffices as sensing coating.
The leads responsible for heating the sensing element are connected
through Nickel-Chromium, well known conductive alloy. Leads responsible for
output signals are connected using platinum wires which convey small changes
in the current that passes through the sensing element. The platinum wires are
connected to the body of the sensing element while Nickel-Chromium wires pass
through its hollow structure.
While other wires are attached to the outer body of the element, Nickel-
Chromium wires are placed inside the element in a spring shaped. Image shows
coiled part of the wire which is placed on the inside of the hollow ceramic
Image shows the ceramic with tin dioxide on the top coating that has good
adsorbing property. Any gas to be monitored has specific temperature at which it
ionizes. The task of the sensor is to work at the desired temperature so that gas
molecules get ionized. Through Nickel-chromium wire, the ceramic region of the
sensing element is subjected to heating current. The heat is radiated by the
element in the nearby region where gases interact with it and get ionized. Once,
ionized, they are absorbed by the tin dioxide. Adsorbed molecules change the
resistance of the tin dioxide layer. This changes the current flowing through the
sensing element and is conveyed through the output leads to the unit that
controls the working of the gas sensor.
History
The history dates back to 1790, when Lazzaro Spallanzani first discovered
that bats maneuvered in flight using their hearing rather than sight. Jean-Daniel
Colladon in 1826 discovered sonography using an underwater bell, successfully
and accurately determining the speed of sound in water. Thereafter, the study
and research work in this field went on slowly until 1881 when Pierre Curie’s
discovery set the stage for modern ultrasound transducers. He found out the
relationship between electrical voltage and pressure on crystalline material. The
unfortunate Titanic accident spurred rigorous interest into this field as a result of
which Paul Langevin invented the hydrophone to detect icebergs. It was the first
ultrasonic transducer. The hydrophone could send and receive low frequency
sound waves and was later used in the detection of submarines in the World War
1.
When ultrasonic waves are incident on an object, diffused reflection of the energy
takes place over a wide solid angle which might be as high as 180 degrees. Thus
some fraction of the incident energy is reflected back to the transducer in the
form of echoes and is detected.
The distance to the object (L) can then be calculated through the speed of
ultrasonic waves (v) in the medium by the relation
Where‘t’ is the time taken by the wave to reach back to the sensor
and ‘ ’ is the angle between the horizontal and the path taken as shown in the
figure. If the object is in motion, instruments based on Doppler shift are used. Get
all the details about internal structure and working of an ultrsound sensor
at Insight-How Ultrasonic Sensors Work.
For example, in the case of clear object detection and measurement of liquid
levels or high glare environments, light based sensors would suffer greatly
because of the transmittance of the target or the translucence of the propagating
media. Ultrasonic devices being based upon sound propagation would remain
practically unaffected.
These also function well in wet environments where optical beams may
suffer from refraction from the water droplets in the environment. On account of
range and accuracy, the ultrasonic sensors may lie in between two EM wave
based sensors, the Infrared rangefinders on the lower end and the LIDARs on the
upper end. Not as accurate or long distance as the LIDARs, the Ultrasonic
rangefinders fare better than the IR rangefinders which are highly susceptible to
ambient conditions and require recalibration when environment changes. Further
these devices offer advantage in medical imaging as compared to MRI or X-Ray
scans due to inexpensiveness and portability. No harmful effects of ultrasonic
waves at the intensity levels used have been detected in contrast to X-rays or
radioactivity based methods and is particularly suited for imaging soft tissues.
Acoustic noise like high pitched sounds created due to whistling or hissing
of valves and pneumatic devices at the frequency close to the operating
frequency may interfere with the output of the sensor. Electrical noise also affects
the performance of the sensor. These may generate artifacts which are not a true
representation of the imaged object. Just like the vision starts to blur when the
distance of the object from the eye gets too small for the eyes to see it, ultrasonic
devices also have a ‘dead zone’ where the sensor cannot reliably make
measurements. This happens due to a phenomenon called ringing which is the
continuous vibration of the transducer after emitting the pulse. Thus when the
distance is too small, the transducer has not yet come to rest to be able to
differentiate between the vibration due to the incident radiation or the oscillation
from the electrical excitation. The dangers of Ultrasonic waves are also well
founded. If the intensity is too high, it can cause human tissues to heat and may
cause ruptures in people exposed to it. Ethical issues like fetus identification and
resulting abortions in medical field are also a widespread concern.
Applications
The applications of ultrasonic sensors can be classified on the basis of the
property that they exploit.
EXPERIMENT 1
"PROXIMITY SENSORS"
4.8 OBJECTIVE
Increasing automation of complex production systems necessitates the
use of components which are capable of acquiring and transmitting information
relating to the production process. Sensors fulfill these requirements and have
therefore in the last few years become increasingly important components in
measuring and in open and closed loop technology. Sensors provide information
to a controller in the form of individual process variables.
Proximity sensors are the most basic data acquisition devices in automation.
They measure / detect physical input such as temperature, pressure, force,
length, and proximity of an object. Transducers are typically a sensorial system
capable of signal processing, equipped with electronic instrumentation. Position
sensors give a “yes” or “no” response according to the place of the object.
GENERAL INFORMATION
Sensors are the first of the four milestones of Automation:
1. Sensing
2. Signal Processing
3. Planning and Response
4. Memory
They usually convert some physical data into a voltage difference for further
processing by a Computer, PLC or I/O Card. The advantages of proximity
sensors are:
Automotive industry,
Packaging industry,
Printing and paper industry
Ceramic industry
Wood-working industry
Food processing industry
CATEGORIES
According to I/O processing:
Binary: Convert a physical measurement value to a binary code (in the form of
ON/OFF signals in a selected voltage range)
Analog: Convert a physical measurement into an analog signal (e.g.
temperature readings to variable voltage differences)
According to physical considerations:
Mechanical switches
Magnetic (with/without contacts, pneumatic output)
Inductive (inductive sensors)
Capacitive (capacitive sensors)
Optical (light barriers, reflection sensors)
Ultrasonic (ultrasonic barriers, ultrasonic sensors)
Pneumatic (back-pressure nozzles, air reflection sensors, air barriers)
TYPICAL USAGE
Positioning of an object:
Counting the number of parts:
TYPES
1. Mechanical switches:
Mechanical switches are simple GO/NoGO indicators. They have physical
contact with the object, usually coupled with relays and contactors to drive a
circuit. Widely used in the industry to mark the end-start points of cylinders,
pistons, linear and rotary drives, to sense doors. They are less sensitive and
have lower maximum switching frequency compared to proximity switches.
Because of the physical contact with the object, they require maintenance and
replacement.
Light sensors (can be equipped with fiber-optic cabling for long distance
transmission, may use ambient light or the light produced in a coupled unit)
Reflected light sensors (can be equipped with fiber-optic cabling for long
distance transmission, uses the reflected light produced in the same unit from
the part or a reflector sheet)
Optical sensors have a relatively greater switching distance. Therefore they may
be used in detecting surface irregularities, failure detection, detection of
transmissive surfaces, colors etc. Fiber optic cabling for transmission also gives a
flexibility to use small units at difficult locations.
SELECTION CRITERIA:
4.9 PROTECTION CLASSES
0 No special protection
0 No special protection
3 Protection against water tipping at 60 to the normal of the device. The
water has no hazardous effects (sprinkling water)
4 Protection against water from any direction to the device. The water has
no hazardous effects (flowing water)
5 Protection against water from a nozzle coming from any direction to the
device. The water has no hazardous effects (flowing water)
6 Protection against water forced water coming from any direction to the
device. The water has no hazardous effects (forced water)
CHAPTER-5
Arduino can be used to develop interactive objects, taking inputs from a variety of
switches or sensors, and controlling a variety of lights, motors, and other physical
outputs. Arduino projects can be stand-alone, or they can be communicate with
software running on your computer. The boards can be assembled by hand or
purchased preassembled; the open-source IDE can be downloaded for free.
The Arduino programming language is an implementation of Wiring, a similar
physical computing platform, which is based on the Processing multimedia
programming environment.
Writing Sketches
o File
o Edit
o Sketch
o Tools
o Help
Sketchbook
Boards
Writing Sketches
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino.
The editor 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 Arduino Software (IDE), including
complete error messages and other information. The bottom righthand corner of
the window displays the configured board and serial port. The toolbar buttons
allow you to verify and upload programs, create, open, and save sketches, and
open the serial monitor.
NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with the
extension .pde. It is possible to open these files with version 1.0, you will be
prompted to save the sketch with the .ino extension on save.
Verify
Checks your code for errors compiling it.
Upload
Compiles your code and uploads it to the configured board.
See uploading below for details.
Note: If you are using an external programmer with your board, you can
hold down the "shift" key on your computer when using this icon. The text
will change to "Upload using Programmer"
New
Creates a new sketch.
Open
Presents a menu of all the sketches in your sketchbook. Clicking one will
open it within the current window overwriting its content.
Note: due to a bug in Java, this menu doesn't scroll; if you need to open a
sketch late in the list, use the File | Sketchbook menu instead.
Save
Saves your sketch.
SerialMonitor
Opens the serial monitor.
New
Creates a new instance of the editor, with the bare minimum structure of a sketch
already in place.
Open
Allows to load a sketch file browsing through the computer drives and folders.
OpenRecent
Provides a short list of the most recent sketches, ready to be opened.
Sketchbook
Shows the current sketches within the sketchbook folder structure; clicking on
any name opens the corresponding sketch in a new editor instance.
Examples
Any example provided by the Arduino Software (IDE) or library shows up in this
menu item. All the examples are structured in a tree that allows easy access by
topic or library.
Close
Closes the instance of the Arduino Software from which it is clicked.
Save
Saves the sketch with the current name. If the file hasn't been named before, a
name will be provided in a "Save as.." window.
Saveas...
Allows to save the current sketch with a different name.
PageSetup
It shows the Page Setup window for printing.
Print
Sends the current sketch to the printer according to the settings defined in Page
Setup.
Preferences
Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.
Quit
Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.
Edit
Undo/Redo
Goes back of one or more steps you did while editing; when you go back, you
may go forward with Redo.
Cut
Removes the selected text from the editor and places it into the clipboard.
Copy
Duplicates the selected text in the editor and places it into the clipboard.
Copy for Forum
Copies the code of your sketch to the clipboard in a form suitable for posting to
the forum, complete with syntax coloring.
Copy as HTML
Copies the code of your sketch to the clipboard as HTML, suitable for embedding
in web pages.
Paste
Puts the contents of the clipboard at the cursor position, in the editor.
SelectAll
Selects and highlights the whole content of the editor.
Comment/Uncomment
Puts or removes the // comment marker at the beginning of each selected line.
Increase/DecreaseIndent
Adds or subtracts a space at the beginning of each selected line, moving the text
one space on the right or eliminating a space at the beginning.
Find
Opens the Find and Replace window where you can specify text to search inside
the current sketch according to several options.
FindNext
Highlights the next occurrence - if any - of the string specified as the search item
in the Find window, relative to the cursor position.
Find Previous
Highlights the previous occurrence - if any - of the string specified as the search
item in the Find window relative to the cursor position.
Sketch
Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for code
and variables in the console area.
Upload
Compiles and loads the binary file onto the configured board through the
configured Port.
UploadUsingProgrammer
This will overwrite the bootloader on the board; you will need to use Tools > Burn
Bootloader to restore it and be able to Upload to USB serial port again. However,
it allows you to use the full capacity of the Flash memory for your sketch. Please
note that this command will NOT burn the fuses. To do so a Tools -> Burn
Bootloader command must be executed.
ExportCompiledBinary
Saves a .hex file that may be kept as archive or sent to the board using other
tools.
ShowSketchFolder
Opens the current sketch folder.
IncludeLibrary
Adds a library to your sketch by inserting #include statements at the start of your
code. For more details, see libraries below. Additionally, from this menu item you
can access the Library Manager and import new libraries from .zip files.
AddFile...
Adds a source file to the sketch (it will be copied from its current location). The
new file appears in a new tab in the sketch window. Files can be removed from
the sketch using the tab menu accessible clicking on the small triangle icon below
the serial monitor one on the right side o the toolbar.
5.3 Tools
AutoFormat
This formats your code nicely: i.e. indents it so that opening and closing curly
braces line up, and that the statements inside curly braces are indented more.
ArchiveSketch
Archives a copy of the current sketch in .zip format. The archive is placed in the
same directory as the sketch.
FixEncoding&Reload
Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.
SerialMonitor
Opens the serial monitor window and initiates the exchange of data with any
connected board on the currently selected Port. This usually resets the board, if
the board supports Reset over serial port opening.
Board
Select the board that you're using. See below for descriptions of the various
boards.
Port
This menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level tools menu.
Programmer
For selecting a harware programmer when programming a board or chip and not
using the onboard USB-serial connection. Normally you won't need this, but if
you're burning a bootloader to a new microcontroller, you will use this.
BurnBootloader
The items in this menu allow you to burn a bootloader onto the microcontroller on
an Arduino board. This is not required for normal use of an Arduino or Genuino
board but is useful if you purchase a new ATmega microcontroller (which
normally come without a bootloader). Ensure that you've selected the correct
board from the Boards menu before burning the bootloader on the target board.
This command also set the right fuses.
Help
Here you find easy access to a number of documents that come with the Arduino
Software (IDE). You have access to Getting Started, Reference, this guide to the
IDE and other documents locally, without an internet connection. The documents
are a local copy of the online ones and may link back to our online website.
Find in Reference
This is the only interactive function of the Help menu: it directly selects the
relevant page in the local copy of the Reference for the function or command
under the cursor.
Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place
to store your programs (or sketches). The sketches in your sketchbook can be
opened from the File > Sketchbook menu or from the Open button on the toolbar.
The first time you run the Arduino software, it will automatically create a directory
for your sketchbook. You can view or change the location of the sketchbook
location from with the Preferences dialog.
Beginning with version 1.0, files are saved with a .ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version
1.0 and later, the software will automatically rename the extension to .ino.
Tabs, Multiple Files, and Compilation
Allows you to manage sketches with more than one file (each of which appears in
its own tab). These can be normal Arduino code files (no visible extension), C
files (.c extension), C++ files (.cpp), or header files (.h).
Uploading
Before uploading your sketch, you need to select the correct items from the Tools
> Board and Tools > Port menus. The boards are described below. On the Mac,
the serial port is probably something like /dev/tty.usbmodem241 (for an Uno or
Mega2560 or Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier
USB board), or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a
Keyspan USB-to-Serial adapter). On Windows, it's probably COM1 or COM2 (for
a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to find out,
you look for USB serial device in the ports section of the Windows Device
Manager. On Linux, it should be /dev/ttyACMx , /dev/ttyUSBx or similar. Once
you've selected the correct serial port and board, press the upload button in the
toolbar or select the Upload item from the Sketch menu. Current Arduino boards
will reset automatically and begin the upload. With older boards (pre-Diecimila)
that lack auto-reset, you'll need to press the reset button on the board just before
starting the upload. On most boards, you'll see the RX and TX LEDs blink as the
sketch is uploaded. The Arduino Software (IDE) will display a message when the
upload is complete, or show an error.
When you upload a sketch, you're using the Arduino bootloader, a small program
that has been loaded on to the microcontroller on your board. It allows you to
upload code without using any additional hardware. The bootloader is active for a
few seconds when the board resets; then it starts whichever sketch was most
recently uploaded to the microcontroller. The bootloader will blink the on-board
(pin 13) LED when it starts (i.e. when the board resets).
5.4 Libraries
Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from
the Sketch > Import Library menu. This will insert one or
more #include statements at the top of the sketch and compile the library with
your sketch. Because libraries are uploaded to the board with your sketch, they
increase the amount of space it takes up. If a sketch no longer needs a library,
simply delete its #include statements from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or through
the Library Manager. Starting with version 1.0.5 of the IDE, you do can import a
library from a zip file and use it in an open sketch. See these instructions for
installing a third-party library.
For details on creating packages for third-party hardware, see the Arduino IDE
1.5 3rd party Hardware specification.
Serial Monitor
This displays serial sent from the Arduino or Genuino board over USB or serial
connector. To send data to the board, enter text and click on the "send" button or
press enter. Choose the baud rate from the drop-down menu that matches the
rate passed to Serial.begin in your sketch. Note that on Windows, Mac or Linux
the board will reset (it will rerun your sketch) when you connect with the serial
monitor. Please note that the Serial Monitor does not process control characters;
if your sketch needs a complete management of the serial communication with
control characters, you can use an external terminal program and connect it to
the COM port assigned to your Arduino board.
You can also talk to the board from Processing, Flash, MaxMSP, etc (see
the interfacing page for details).
Preferences
Some preferences can be set in the preferences dialog (found under
the Arduino menu on the Mac, or File on Windows and Linux). The rest can be
found in the preferences file, whose location is shown in the preference dialog.
Language Support
Since version 1.0.1 , the Arduino Software (IDE) has been translated into 30+
different languages. By default, the IDE loads in the language selected by your
operating system. (Note: on Windows and possibly Linux, this is determined by
the locale setting which controls currency and date formats, not by the language
the operating system is displayed in.)
If you would like to change the language manually, start the Arduino Software
(IDE) and open the Preferences window. Next to the Editor Language there is a
dropdown menu of currently supported languages. Select your preferred
language from the menu, and restart the software to use the selected language. If
your operating system language is not supported, the Arduino Software (IDE) will
default to English.
You can return the software to its default setting of selecting its language based
on your operating system by selecting System Default from the Editor
Language drop-down. This setting will take effect when you restart the Arduino
Software (IDE). Similarly, after changing your operating system's settings, you
must restart the Arduino Software (IDE) to update it to the new default language.
Boards
The board selection has two effects: it sets the parameters (e.g. CPU speed and
baud rate) used when compiling and uploading sketches; and sets and the file
and fuse settings used by the burn bootloader command. Some of the board
definitions differ only in the latter, so even if you've been uploading successfully
with a particular selection you'll want to check it before burning the bootloader.
You can find a comparison table between the various boards here.
Arduino Software (IDE) includes the built in support for the boards in the following
list, all based on the AVR Core. The Boards Manager included in the standard
installation allows to add support for the growing number of new boards based on
different cores like Arduino Due, Arduino Zero, Edison, Galileo and so on.
ArduinoYùn
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O
and 7 PWM.
Arduino/GenuinoUno
An ATmega328P running at 16 MHz with auto-reset, 6 Analog In, 14 Digital I/O
and 6 PWM.
ArduinoDiecimilaorDuemilanovew/ ATmega168
An ATmega168 running at 16 MHz with auto-reset.
ArduinoNanow/ ATmega328P
An ATmega328P running at 16 MHz with auto-reset. Has eight analog inputs.
Arduino/GenuinoMega2560
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O
and 15 PWM.
ArduinoMega
An ATmega1280 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O
and 15 PWM.
ArduinoMegaADK
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O
and 15 PWM.
ArduinoLeonardo
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O
and 7 PWM.
Arduino/GenuinoMicro
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O
and 7 PWM.
ArduinoEsplora
An ATmega32u4 running at 16 MHz with auto-reset.
ArduinoMiniw/ ATmega328P
An ATmega328P running at 16 MHz with auto-reset, 8 Analog In, 14 Digital I/O
and 6 PWM.
ArduinoEthernet
Equivalent to Arduino UNO with an Ethernet shield: An ATmega328P running at
16 MHz with auto-reset, 6 Analog In, 14 Digital I/O and 6 PWM.
ArduinoFio
An ATmega328P running at 8 MHz with auto-reset. Equivalent to Arduino Pro or
Pro Mini (3.3V, 8 MHz) w/ ATmega328P, 6 Analog In, 14 Digital I/O and 6 PWM.
ArduinoBTw/ ATmega328P
ATmega328P running at 16 MHz. The bootloader burned (4 KB) includes codes
to initialize the on-board bluetooth module, 6 Analog In, 14 Digital I/O and 6
PWM..
LilyPad ArduinoUSB
An ATmega32u4 running at 8 MHz with auto-reset, 4 Analog In, 9 Digital I/O and
4 PWM.
LilyPad Arduino
An ATmega168 or ATmega132 running at 8 MHz with auto-reset, 6 Analog In, 14
Digital I/O and 6 PWM.
ArduinoPro/Mini(5V,16 MHz)w/ ATmega328P
An ATmega328P running at 16 MHz with auto-reset. Equivalent to Arduino
Duemilanove or Nano w/ ATmega328P; 6 Analog In, 14 Digital I/O and 6 PWM.
ArduinoNGorolderw/ ATmega168
An ATmega168 running at 16 MHz without auto-reset. Compilation and upload is
equivalent to Arduino Diecimila or Duemilanove w/ ATmega168, but the
bootloader burned has a slower timeout (and blinks the pin 13 LED three times
on reset); 6 Analog In, 14 Digital I/O and 6 PWM.
ArduinoRobotControl
An ATmega328P running at 16 MHz with auto-reset.
ArduinoRobotMotor
An ATmega328P running at 16 MHz with auto-reset.
ArduinoGemma
An ATtiny85 running at 8 MHz with auto-reset, 1 Analog In, 3 Digital I/O and 2
PWM.
The text of the Arduino getting started guide is licensed under a Creative
Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are
released into the public domain.
CHAPTER – 6
UBIDOTS EXPLORER:
6.1 Introduction
Welcome to the Ubidots REST API hardware docs. Here you would reference
how to send or retrieve data from your hardware devices using our supported
communication protocols: HTTP, MQTT and TCP/UDP.
The purpose of this section is to help you understand what happens in the
backstage when communicating with Ubidots, so you can replicate this in your
firmware. For this reason, we avoid the use of examples using libraries. However,
if you’d like to use one of our libraries (Python, C, and more), check out
our compatible devices and API clients sections.
How Ubidots Works?
Values
{"value" : 34.87654974}
Timestamps
Numerical values are not the only data type supported; you can also
store string or char data types inside what we call context. The context is a key-
value object that allows you to store not only numerical but also string values. An
example use of the context could be:
"context" : {"status" : "on", "weather" : "sunny"}
A context is commonly used to store the latitude and longitude coordinates of
your device for GPS/tracking application use cases. All Ubidots maps uses
the lat and lng keys from a dot's context to extract the coordinates of your
device, in that way you just need to send a single dot with the coordinates values
in the variable context to plot a map instead of sending separately both latitude
and longitude in two different variables. Below you can find a typical context with
coordinates values:
"context" : {"lat":-6.2, "lng":75.4, "weather" : "sunny"}
Please note that you can mix both string and numerical values in the context. If
your application is for geo-localization purposes, make sure that the coordinates
are set in decimal degrees.
Time Series
Based on the above, we can illustrate an Ubidots time series like this:
Ubidots is an agnostic platform, this means that it does not really care what
hardware device you are using, as long as you're able to interact with us through
at least one of these protocols:
HTTP
MQTT
TCP/UDP
HTTP
HTTP is the main internet protocol for information exchange in the Internet. It also
supports data encryption, which is usually called secure HTTP or HTTPs. When
you use a web browser (MS Edge, Firefox, Google Chrome, etc) you are sending
and receiving packages using HTTP or HTTPs. Because of this, it was not
surprising to see HTTPs become a popular option for data exchange within IoT.
When a developer is to implement HTTP communication, then he should look for
a RESTful Application Programming Interface, or REST API, which exposes all
the endpoints required to interact with a third party application (like Ubidots). In
this section, you can reference our REST API to understand how to send and
retrieve data from our servers.
Note: Our goal with this section is to help you understand what’s happening
behind when communicating with Ubidots, enabling you to replicate it within your
own firmware. Because of this, we avoid using our custom libraries in all the
examples.
HTTP requests
The following methods are specified within the HTTP standard:
HTTP is a request/response protocol, this means that every request that you
make is answered by the server. This response includes a number (response
code) and a body. For example, when you make a request to retrieve a file on a
webpage "(e.g. "Get me the file 'webside.html'" )", you build a GET request. If the
request is correct, the server will typically return a 200 response code, along with
the file requested (body).
Under the same logic, when a device sends a GET request to the Ubidots' server
(i.e. requesting the last value of a variable), then the server sends back a
response with the status of the request (response code), and a body, which
would be the a value with its context and timestamp.
{TOKEN}: Unique key that authorizes your device to ingest data inside
your Ubidots account.
API access can be over HTTP or secure HTTP, HTTPs, using the following
endpoints based on your Ubidots Account type.
Security Note: We strongly advise to use HTTPs to make sure your data travels
encrypted, avoiding the exposure of your API token and/or sensor data.
HTTP
Educational http://things.ubidots.com 80
Industrial http://industrial.api.ubidots.com 80
HTTPs
Ubidots supports SSL v1.1, TLS v1.2 and v1.3. You can download our root
certificates in different formats:
PEM file: A certificate chain with two root certificates from our certificate
authorities (CAs).
DER file: Same as the PEM file, with an alternative encoding.
CRT file: Same as the PEM file, with a different extension. Often referred to
as .crt, .cert or .cer.
NOTE: To avoid future inconveniences, we advise to use both certificates in
your device's auth routines. While the second is the current valid certificate, we
will use the first after 2021.
Fixed IPs
Ubidots also supports fixed IPs address for data ingestion, but we highly advise
to our users to implement their firmware routines using the dns endpoints instead
of fixed IPs, as these last ones may change in the future.
HTTP Authentication
Every request requires a token. A token is an unique key that authorizes your
device to ingest data inside your Ubidots account.
The easiest way to get yours is clicking on "API Credentials" under your profile
tab:
Also, 6 hour valid tokens can be generated using your account API-KEY. If you
desire to learn how to do it, please refer the Ubidots REST Software API
reference.
There are two ways to send a token in a request:
1. Send the token as parameter in the endpoint, setting it with
the ?token= expression. This is the easiest one to implement but the most
unsecure method to send your authentication credentials.
2. Send the token as a request header. For this, use the X-Auth-
Token header.
Security Note: While sending your token as a URL parameter can be quite
comfortable in some devices, we only advise to do this for prototyping stages. For
production stages, we strongly advise sending the token using the X-Auth-
Token header.
GET
https://industrial.api.ubidots.com/api/
Send data
Our REST API allows you send data to the platform in two different ways:
Request structure:
POST /api/v1.6/devices/{DEVICE_LABEL} HTTP/1.1<CR><LN>
Host: {Host}<CR><LN>
User-Agent: {USER_AGENT}<CR><LN>
X-Auth-Token: {TOKEN}<CR><LN>
Content-Type: application/json<CR><LN>
Content-Length: {PAYLOAD_LENGTH}<CR><LN><CR><LN>
{PAYLOAD}
<CR><LN>
Expected Response:
HTTP/1.1 200 OK<CR><LN>
Server: nginx<CR><LN>
Date: Tue, 04 Sep 2018 22:35:06 GMT<CR><LN>
Content-Type: application/json<CR><LN>
Transfer-Encoding: chunked<CR><LN>
Vary: Cookie<CR><LN>
Allow: GET, POST, HEAD, OPTIONS<CR><LN><CR><LN>
{PAYLOAD_LENGTH_IN_HEXADECIMAL}<CR><LN>
{"{VARIABLE_LABEL}": [{"status_code": 201}]}<CR><LN>
0<CR><LN>
The easiest way to send values to Ubidots is by specifying your Device label in
the request path and making a POST request to it.
Replace the {DEVICE_LABEL} with the unique label of the desired device to
send data to. If the device does not exist in your Ubidots account, it will be
automatically created. Device labels can contain any alphanumerical character,
without blank spaces, i.e weather-station, my-home, esp8266.
To set the variables values, just create a JSON data payload as below
Nº
Variables JSON structure
CONCLUSION
The smart basket helps us reduce pollution. Many times, the garbage can
over flowing and a lot of animals like the dog or the mouse enter in or near the
trash can. This creates a bad scene. Even some birds also try to remove
garbage from the trash. This project can avoid such situations. And the the
message can be sent directly to the cleaning vehicle instead of the
contractor's office. This project is also helpful in the government project of
“SWACHH BHARAT ABHIYAN”.This project can also be used in the “SMART
CITY”.
REFERENCES
[1] Daniel V., Puglia P.A., and M. Puglia (2007). “RFID-A Guide to Radio
Frequency Identification”, Technology Research Corporation.
[4] Hannan, M., A., Arebey, M., Basri, H. (2010). “Intelligent Solid Waste Bin
monitoring and Management System”, Australian Journal of Basic and
Applied Sciences, 4(10): 5314-5319, 2010, ISSN 1991-8178.
[5] Md. Liakot Ali, Mahbubul Alam, Md. Abu Nayeem Redwanur Rahaman,
(2012). “RFID based E-monitoring System for Municipal Solid Waste
Management”, International Conference on Electrical and Computer
Engineering, Pg 474-477.