You are on page 1of 37

CHAPTER-1

BASICS OF INTERNET OF THINGS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

BASICS OF INTERNET OF THINGS

1.1 Definition

The internet of things describes physical objects or a group of such objects with
sensors, processing ability, software and other technologies that connect and exchange
data with other devices and system over the internet or other communication networks.

1.2 Introduction
Internet of Things (IoT) is the networking of physical objects that contain electronics
embedded within their architecture in order to communicate and sense interactions
amongst each other or with respect to the external environment. In the upcoming years,
IoT-based technology will offer advanced levels of services and practically change the
way people lead their daily lives. Advancements in medicine, power, gene therapies,
agriculture, smart cities, and smart homes are just a very few of the categorical
examples where IoT is strongly established.

Main components used in IoT:

 Low-power embedded systems: Less battery consumption, high performance are


the inverse factors that play a significant role during the design of electronic
systems.
 Sensors : Sensors are the major part of any IoT applications. It is a physical
device that measures and detect certain physical quantity and convert it into signal
which can be provide as an input to processing or control unit for analysis purpose.
 Control Units : It is a unit of small computer on a single integrated circuit
containing microprocessor or processing core, memory and programmable
input/output devices/peripherals. It is responsible for major processing work of IoT
devices and all logical operations are carried out here.
 Cloud computing: Data collected through IoT devices is massive and this data
has to be stored on a reliable storage server. This is where cloud computing comes
into play. The data is processed and learned, giving more room for us to discover
where things like electrical faults/errors are within the system.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

1.3 Architecture OF IOT

I. Sensing Layer:

The sensing layer is the first layer of the IoT architecture and is responsible for
collecting data from different sources. This layer includes sensors and actuators that
are placed in the environment to gather information about temperature, humidity, light,
sound, and other physical parameters. These devices are connected to the network layer
through wired or wireless communication protocols

II. Network Layer:

The network layer of an IoT architecture is responsible for providing communication


and connectivity between devices in the IoT system. It includes protocols and
technologies that enable devices to connect and communicate with each other and with
the wider internet. Examples of network technologies that are commonly used in IoT
include Wi-Fi, Bluetooth, Zigbee, and cellular networks such as 4G and 5G.
Additionally, the network layer may include gateways and routers that act as
intermediaries between devices and the wider internet, and may also include security
features such as encryption and authentication to protect against unauthorized access.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

III. Data processing layer:

The data processing layer of IoT architecture refers to the software and hardware
components that are responsible for collecting, analysing, and interpreting data from
IoT devices. This layer is responsible for receiving raw data from the devices,
processing it, and making it available for further analysis or action. The data processing
layer includes a variety of technologies and tools, such as data management systems,
analytics platforms, and machine learning algorithms. These tools are used to extract
meaningful insights from the data and make decisions based on that data.

IV. Application Layer:

The application layer of IoT architecture is the topmost layer that interacts directly with
the end-user. It is responsible for providing user-friendly interfaces and functionalities
that enable users to access and control IoT devices. This layer includes various software
and applications such as mobile apps, web portals, and other user interfaces that are
designed to interact with the underlying IoT infrastructure. It also includes middleware
services that allow different IoT devices and systems to communicate and share data
seamlessly. The application layer also includes analytics and processing capabilities
that allow data to be analysed and transformed into meaningful insights. This can
include machine learning algorithms, data visualization tools, and other advanced
analytics capabilities.

1.4 Future technologies of IOT:

The IOT has the potential to impact almost every single sector. From retail to
healthcare, the IOT is becoming an everyday part of our lives. The growth of IOT is
exponential and is expected to keep growing at that rate. In the next few years, it is
expected that by the year 2025,there will be almost 50 billion IOT devices connected
to the internet, that’s almost four IOT devices for every person on earth. IOT is not just
about connecting devices, but also about connecting data. It encompasses everything
from customer relationship management to logistics. The truth is, there is a lot more to
the IOT than many people realize.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

1.5 Applications of IOT:

 It can assist in the smart control of home and cities via mobile phones.it enhances the
security and offers personal protection.
 By automating activities, it saves us a lot of time.
 Information is easily accessible, even if we are away from the location, and it is
updated at Realtime.
 Electronics devices are directly connected and communicate with controller computer,
such as a mobile and resulting in efficient electric use.
 It minimizes human effort because IOT devices are connect and communicate with one
other and perform a variety of tasks without need for human intervention.
 Asset tracking, traffic or transportation tracking,invevtary control,delivary
surveillance, individual order tracking and costumer management can all be made-more
cost effective with right tracking system.

1.6 Advantages of IOT:

 Real time asset/resource visibility.


 Low /affordable cost.
 Improved operational efficiency.
 Data-driven insights of quick decision making.
 End-to-end, remote monitoring and management of assets/resources.

Dept., of ECE., SITAMS


CHAPTER-2
LITERATURE SURVEY
IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

LITERATURE SURVEY

2.1 Existing survey:


The existing weather monitoring systems generally use weather stations that use
multiple instruments such as thermometers, barometers, wind vanes, rain gauge etc. to
measure weather and climate changes. Most of these instruments use simple analog
technology which is later physically recorded and stored in a data base. This
information is later sent to news reporting stations and radio stations where the weather
report .

2.1.1 Limitations of Existing system:


 Existing weather monitoring systems that are used in the field generally consist of
unconventional and heavy machinery that consists of numerous moving parts that
require constant maintenance and need to be manually monitored and changed
frequently.
 Power requirements are one of many major constraints as these instruments are
generally sited far from main power supply. This adds to the cost of using such
instruments.
 The use of thermometers to measure external temperature; however accurate is still
outdated and constantly needs to be manually checked for any change in
temperature.
 Data that is collected by the instruments needs to be manually transferred from the
logger to a laptop or computer via a cable.
 Existing systems consist of large and heavy instruments that occupy a lot of space
hence making it difficult to install them in remote location and places which have
limited space.
 The instruments used in the existing systems are expensive and add up to the
already high cost of installation and maintenance.

2.2 Proposed System:

In today’s world many pollution monitoring systems are designed by different


environmental parameters. Existing system model is presented IOT based Weather

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

monitoring and reporting system where you can collect, process, analyses, and present
your measured data on web server. Wireless sensor network management model
consists of and device, router, gateway node and management monitoring centre. End
device is responsible for collecting wireless sensor network data, and sending them to
parent node, the data are sent to gateway node from parent node directly or by router.
After receiving the data from wireless sensor network, gateway node extracts data after
analysing and packaging them into Ethernet format data, sends them to the server. Less
formally, any device that runs server software could be considered a server as well.
Servers are used to manage network resources. The services or information provided
through the Internet that are connected through LAN and made available for users via
smart phones, web browser or other web browser devices to make the system more
intelligent, adaptable and efficient.For 24-hour weather surveillance, several high-end
schemes are now possible to. But these systems are being plotted to monitor real-time
weather for a particular place on a broad scale. This weather monitoring system uses
three sensors to measure variations in the atmosphere and the climate, such as
temperature, humidity, pressure and rain level. The values are then sent to the website;
these values are received data and marked a as statistics in graphic form. Uploaded data
from the system introduced can be accessed online from every part of the world. The
model proposed is an innovative weather forecasting solution that makes its real-time
data readily available over a very wide range using IoT. For Our system we would be
usings the dataset that would be exported from thing speak server. The system proposed
is an advanced solution for weather monitoring that uses IoT to make its real time data
easily accessible over a very wide range. The system deals with monitoring weather and
climate changes like

 Temperature, humidity by using the DHT11 sensor


 Carbon monoxide levels in the air using MQ135.
 BMP-180 for pressure.
 Rain sensor for detecting rainfall.

Dept., of ECE., SITAMS


CHAPTER-3
HARDWARE DECRIPTION
IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

HARDWARE DECRIPTION
In this present chapter we will discuss the technical details of the hardware components
used in this project.

3.1 NODEMCU
The nodeMCU is a low-cost Wi-Fi chip with full TCP/IP stack and MCU
stands for micro controller unit and capability produced by shanghai based Chinese
manufacture, Espressif systems. The small module allows microcontrollers to connect
to a Wi-Fi network and make simple TCP/IP connections and uses micro python for its
instruction farming .The first came to attention of western makers in August 2014 with
in the ESP-01 module, made by third party manufacture, AI thinker.

This small module allows microcontrollers to connect to a wifi network and make
simple TCP/IP connections using Hayes-style commands.

Fig.3.1: NODEMCU

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

Processor:

L06 32-bit RISC microprocessor core based on the Tensilica Xtensa Diamond
standerd 106 micro running at 80MHz.

 64 KB of instruction RAM , 96 KB of data RAM.


 External QSPI Flash: up to 16 MB is supported (512 KB to 4 MB typically included).
 IEEE 802.11 b/g/n Wi-Fi .
 Integrated TR switch.balun,LNA,power amplifier and matching network.
 WEP or WPA/WPA2 authentication,or open networks.
 16 GPIO pins.
 Supports SPI protocol.
 I2C software implementation.
 I2S interfaces with DMA (sharing pins with GPIO).
 UART on delicated pins , plus a transmit only UART can be enabled on GPIO2.
 10 bit ADC (successive approximation ADC).
 NodeMCU is a microcontroller with TCP/IP protocol stack.The MCU can be
programmed perform small activities like reading sensor data. The networking
capability of ESP8266 enables a data uplaoding and doenloading from the cloud. Thus
it find its major application in IOT project. It can be programmed with C,Python and
Java.It acts as aWi-Fi and hotspot based on the configuration. ESP8266 is configured
through commands. We use micro python to program on the chip.

 As Arduino.cc began developing new MCU boards based on non-AVR processors like
the ARM/SAM MCU used in the Arduino Due, they needed to modify the Arduino
IDE so it would be relatively easy to change the IDE to support alternate toolchains to
allow Arduino C/C++ to be compiled for these new processors. They did this with the
introduction of the Board Manager and the SAM Core. A “core” is the collection of
software components required by the Board Manager and the Arduino IDE to compile
an Arduino C/C++ source file for the target MCU’s machine language. Some ESP8266
enthusiasts developed an Arduino core for the ESP8266 Wi-Fi SoC, popularly called
the “ESP8266 Core for the Arduino IDE. This has become a leading software
develop

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

platform for the various ESP8266-based modules and development boards, including
NodeMCU.

3.2 DHT11 SENSOR (DIGITAL HUMIDITY AND TEMPERATURE SENSOR)

Fig: 3.1

DHT11 is a basic ,ultra-low cost digital humidity and temperature sensor. It uses a
capacitive humidity sensor and a thermistor to measure the surrounding air, and split
out a digital signal on the data pin. It fairly easy to use, but requires careful timing to
grab data. The real down side of this sensor is you can only get new data from it once
every 2 seconds.

Specifications:

S.No PIN DECRIPTION

1 VCC Power supply 3.5V to


5.5V

2 Data Outputs both


temperature and
Humidity through serial
Data.
3 Ground(GND) Connected to the ground
of the circuit

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

3.3 BMP-180 SENSOR

The BMP180 barometric pressure sensor from Bosch is used to predict the weather, detect
altitude, and measure vertical velocity. It can be used to measure environmental temperature,
absolute & relative pressure & estimated altitude.

The atmospheric pressure which is also called Barometric pressure is the pressure caused by the
weight of air pressing down on the Earth. The air in the atmosphere has mass, so gravity causes
the weight of that column to exert pressure on the surface. The BMP180 outputs pressure
readings in Pascals which is its SI unit. We can also measure the pressure in hectopascals (hPa)
or millimetre of mercury (mm of Hg).

SPECIFICATIONS:

S.No PIN DECRIPTION

1 VCC Power supply 3.5V to


5.5V

2 SDL Serial Data Line

3 SCA Serial Clock LINE

4 GROUND(GND) Connected to the ground


of the circuit

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

SDL: the process of sending data one bit at a time, sequentially, over a communication channel
or computer bus.

SCL: the Serial Clock line. It carries the clock signal generated by the master. Like other similar
protocols I2C is a serial communication protocol.

3.4 RAIN SENSOR

A rain sensor is a device that detects rainfall and is used in two main applications. The
first is a water conservation device connected to an automatic irrigation system that
causes the system to shut down in the event of rainfall. The second is a device used to
protect the interior of an automobile from rain and to support the automatic mode of
windshield wipers. The rain sensor works on the principle of total internal reflection.
An infrared light beams at a 45-degree angle on a clear area of the windshield from the
sensor inside the car. When it rains, the wet glass causes the light to scatter and a lesser
amount of light gets reflected back to the sensor.

SPECIFICATIONS:

S.No PIN DECRIPTION

1 VCC Power supply 3.5V to


5.5V

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

2 A0 This pin gives an analog


signal between the
voltage supply from 5V to
0V

3 D0 This pin gives digital


output for internal
comparator and can be
connected to Arduino
board

4 GROUND(GND) Connected to the ground


of the circuit

3.5 MQ-135 Sensor

The MQ-135 air quality sensor is a semiconductor air quality check sensor suitable for
monitoring applications of air quality. It is highly sensitive to NH3, NOx, CO2,
benzene, smoke, and other dangerous gases in the atmosphere. It operates at a 5V
supply with 150mA consumption. Preheating of 20 seconds is required before the
operation, to obtain the accurate output. The MQ-135 gas sensor applies SnO2 which
has a higher resistance in the clear air as a gas-sensing material. When there is an
increase in polluting gases, the resistance of the gas sensor decreases along with that.
To measure PPM using MQ-135 sensor we need to look into the (Rs/Ro) v/s PPM
graph taken from the datasheet.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

SPECIFICATIONS:

S.No PIN DECRIPTION

1 VCC Power supply 3.5V to


5.5V

2 A0 Analog Pin

3 D0 Digital Pin

4 GROUND(GND) Connected to the ground


of the circuit

Dept., of ECE., SITAMS


CHAPTER-4
SOFTWARE DESCRIPTION
IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

SOFTWARE DESCRIPTION

4.1- SOFTWARE REQUIREMENTS:


Now that you are a proud owner of an Arduino, or an Arduino clone, it might
help if you know what it was and what you can do with it.

In its simplest form, an Arduino is a tiny computer that you can program to
process inputs and outputs going to and from the chip.

The Arduino is what is know as a Physical or Embedded Computing platform,


which means that it is an interactive system, that through the use of hardware and
software can interact with its environment.

For example, a simple use of the Arduino would be to turn a light on for a set
period of time, let’s say 30 seconds, after a button has been pressed (we will build this
very same project later in the book). In this example, the Arduino have a lamp
connected to it as well as a button. The Arduino would sit patiently waiting for the
button to be pressed. When you press the button it would then turn the lamp on and
start counting. Once it had counted 30 seconds it would then turn the lamp off and then
carry on sitting there waiting for another button press. You could use the set-up to
control a lamp in an under-stairs cupboard for example. You could extend this example
to sense when the cupboard door was opened and automatically turn the light on,
turning it off after a set period of time.

The Arduino can be used to develop stand-alone interactive objects or it can be


connected to a computer to retrieve or send data to the Arduino an then act on the data
(e.g. Send sensor data out to the internet). The Arduino can be connected to LED’s. Dot
Matrix displays, LED displays, buttons, switches, motors, temperature sensors, pressure
sensors, distance sensors, webcams, printers, GPS receivers , Ethernet modules.

The Arduino board is made of an Atmel AVR Microprocessor, a crystal or


oscillator (basically a crude clock that send time pulses to the microcontroller to enable
it to operate at the correct)

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

To program the Arduino (make it do what you want it to) you also use the Arduino
IDE ( Integrated Development Environment), which is a piece of free software, that
enables you to

program in the language that the Arduino understands. In the case of the Arduino the
language is C. The IDE enables new to computer program, which is set of step -by- step
instructions that you then upload to the Arduino. Then your Arduino will carry out
those instructions and interact with world outside. In the Arduino world, programs are
known as sketches.

The Arduino hardware and software are both Open Sources, which means the code, the
schematics, design, etc. are all open for anyone to take freely and do what they like
with it. This means there is nothing stopping anyone from taking the schematics and
PCB designs of the Arduino and making their own and selling them. This is perfectly
legal, and indeed the whole purpose of Open Source, and indeed the Fredonia that
comes with the Earthshine Design Arduino Starter Kit is a perfect example of where
someone has taken the Arduino PCB designs made their own and are selling it under
the Fredonia name. You could even make your own Arduino, with just a few chip
components, on a breadboard.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

The only stipulation that the Arduino development team put on outside
developers is that the Arduino name can only be used exclusively by them on their own
products and hence the clone boards have names such as Fredonia, Boarding, Borodino,
etc.

As the design are open source, any clone board, such as the Fredonia, is 100%
compatible with the Arduino and therefore any software, hardware, shields, etc. will all
be 100% compatible with a genuine Arduino. The Arduino can also be extended with
the use of shields which are circuit boards containing other devices ( e.g. GPS
receivers, LCD Displays, Ethernet connections, etc.) that you can simply slot into the
top of your Arduino to get extra functionality. You don’t have to use a shield if you
don’t want to as you can make the exact same circuitry using breadboard, some
Veroboard or even by making your own PCB’s.

There are many different variants of the Arduino available. The most
common one is the Diecimila or the Duemilanove. You can also get Mini, Nano and
Bluetooth Arduino’s. New to the product line is the new Arduino Mega with increased
memory and number of I\O pins. Probably the most versatile Arduino, and hence the
reason it is the most popular, is the Duemilanove. This is because it uses a standard 28
pin chip, attached to an IC Socket. The beauty of this system is that if you make
something neat with the Arduino and then want to turn it into something permanent
(e.g. Or under- stairs cupboard light), then instead of using the relatively expensive
Arduino board, you can simply use the Arduino to develop your device, then pop the
chip out of the board and place it into your own circuit board in your custom device.
You would then have made a custom embedded device, which is really cool.

Then, for a couple of quid or bucks you can replace the AVR chip in your
Arduino with a new one. The chip must be pre-programmed with the Arduino with a
new one. The chip must be pre-programmed with the Arduino Bootloader to enable it to
work with the Arduino IDE, but you can either burn the Bootloader yourself if you
purchase an AVR programmer, or you can buy these pre-programmed from many
suppliers around the world. Of course, Earthshine Design provide pre-programmed
Arduino chips in it store for a very reasonable price.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

If you do a search on the Internet by simply typing ‘Arduino’ into the search box of
your favourite search engine, you will be amazed at the huge amount of websites
dedicated to the Arduino. You can find a mind boggling amount information on
projects made with the Arduino and if you have a project in mind, will easily find
information that will help to get your project up and running easily.

4.1.1 CRITERIA OF IMPLEMENTING

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.

4.1.2 USAGE PROCESS

The Arduino Integrated Development Environment - or Arduino Software (IDE) -


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 and
Genuino hardware to upload programs and communicate with them. 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 right hand corner of the window displays the configured board and serial port.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

The toolbar buttons allow you to verify and upload programs, create, open, and save
sketches, and open the serial monitor.

Verify:

Checks your code for errors compiling it.

Upload:

Compiles your code and uploads it to the configured board.

See upload 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

Save:

Saves your sketch

Serial Monitor:

Open the serial Monitor.

4.1.3 Writing sketches file :

• NEW

Creates a new instance of the editor, with the bare minimum structure of a sketch
already in place.

OPEN

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

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 saving 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

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

• Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

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 boot loader on the board; you will need to use Tools > Burn
Boot loader 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.

Tools:

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

• 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.

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 hardware 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.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

• BURNBOOTLOADER

The items in this menu allow you to burn a boot loader onto the microcontroller on an
Arduino board. This is not required for normal use of an Arduino or Genuine board but
is useful if you purchase a new ATmega microcontroller (which normally comes
without a boot loader). Ensure that you've selected the correct board from the Boards
menu before burning the boot loader 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.

Sketch box:

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.

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. 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. Once
you've selected

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

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 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.

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.
THIRD-PARTY HARDWARE
Support for third-party hardware can be added to the hardware directory of your
sketchbook directory. Platforms installed there may include board definitions (which
appear in the board menu), core libraries, boot loaders, and programmer definitions. To
install, create the hardware directory, then unzip the third-party platform into its own
sub-directory. (Don't use "arduino" as the sub-directory name or you'll override the
built- in Arduino platform.) To uninstall, simply delete its directory

SERIAL MONITOR :

Displays serial data being sent from the Arduino or Genuine board (USB or serial
board). 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 that matches the rate passed to Serial.
Begin in your sketch. Note that on Windows, Mac or Linux, the Arduino or Genuine
board will reset (rerun your sketch execution to the beginning) when you connect with
the serial monitor.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

4.2 THINGSPEAK

ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize
and analyze live data streams in the cloud. ThingSpeak provides instant visualizations
of data posted by your devices to ThingSpeak.

ThingSpeak is an IoT analytics platform service from MathWorks, the makers of


MATLAB and Simulink. ThingSpeak allows you to aggregate, visualize, and analyse
live data streams in the cloud. ThingSpeak provides instant visualizations of data posted
by your devices or equipment. Execute MATLAB code in ThingSpeak, and perform
online analysis and processing of the data as it comes in. ThingSpeak accelerates the
development of proof-of-concept IoT systems, especially those that require analytics.
You can build IoT systems without setting up servers or developing web software. For
small- to medium-sized IoT systems, ThingSpeak provides a hosted solution that can be
used in production.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

Capabilities of ThingSpeak:

1. Easily configure devices to send data to ThingSpeak using popular IoT protocols.
2. Visualize your sensor data in real-time.
3. Aggregate data on-demand from third-party sources.
4. Use the power of MATLAB to make sense of your IoT data.
5. Run your IoT analytics automatically based on schedules or events.
6. Prototype and build IoT systems without setting up servers or developing web software1.

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

ThingSpeak is an open data platform for the Internet of Things. Your device or application
can communicate with ThingSpeak using a RESTful API, and you can either keep your data
private, or make it public. In addition, use ThingSpeak to analyse and act on your data.
ThingSpeak enables sensors, instruments, and websites to send data to the cloud where it is
stored in either a private or a public channel. ThingSpeak stores data in private channels by
default, but public channels can be used to share data with others. You can use MATLAB to
help you make sense of data. You can convert, combine, and calculate new data. You can
schedule calculations to run at certain times. You can visually understand relationships in
data using built-in plotting functions. You can combine data from multiple channels to build
a more sophisticated analysis.

Dept., of ECE., SITAMS


CHAPTER-5
PROJECT IMPLEMENTATION
IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

PROJECT IMPLEMENTATION
In this chapter we will see the implementation of a the project .The prime goal of this
project is to regularly monitor the weather parameters like Temperature,Humidity,Air
Quality,Rain,Pressure. The monitored data sent through the internet to Thingspeak
server and private ledger that the stores the individual data and handles the emergency
situation. The data stored in ledger is used in artificial intelligence powered programs.
The entire process include three steps as shown below.

• Connections
• Monitoring
• Updating and Graphing

5.1 Connections

5.1.1 Interfacing between Nodemcu and DHT11

Pin Configuration:

S.No Pin NodeMCU


1 VCC 3.3V

2 DATA A0

3 GND GND

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

5.1.2 Interfacing between Nodemcu and BMP-180

Pin Configuration:

S.No Pin NodeMCU


1 VCC Vin

2 SDA A1

3 SCL A2
4 GND GND

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

5.1.2 Interfacing between Nodemcu and MQ-135

Pin Configuration:

S.No Pin NodeMCU

1 VCC Vin

2 A0 A0

3 D0 NULL

4 GND GND

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

5.1.2 Interfacing between Nodemcu and Rain Sensor

Pin Configuration:

S.No Pin NodeMCU

1 VCC Vin

2 A0 NULL

3 D0 D0

4 GND GND

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

5.2 Implementation

5.2.1 Block Diagram

• The implemented system consists of Nodemcu (ESP8266)which is used as a main


processing unit for entire system and all the sensor and all the sensor and devices can
be connected with a microcontroller.
• The sensor can be operated by the microcontroller to retrieve data from them and it is
processed and analysis with sensor data.
• All sensors are read data from the sensors in the form of analog and displayed it as digital.
• After collecting data from the sensors, it send data to the cloud and we can access data
through thingspeak.
• The processed data can be uploaded and stored in a cloud to function as a database
using nodeMCU and Live data and predicted data displayed on a Thingspeak.
5.2.2 Monitoring
Weather monitoring refers to the process of collecting and analysing data about weather
conditions in a specific location over a period of time. It involves the use of various
technologies and instruments, such as weather stations, satellites, radars, and other

Dept., of ECE., SITAMS


IOT BASED REALTIME WEATHER MONITORING SYSTEM USING NODEMCU AND THINGSPEAK

sensors to measure and record data on temperature, humidity, precipitation, wind


direction, wind speed, air pressure, and other relevant weather parameters. The data
collected from weather monitoring helps meteorologists and other experts to make
accurate weather predictions, issue weather alerts and warnings, and develop weather
forecasts that are critical for public safety, transportation, agriculture, and many other
sectors. Weather monitoring is essential in understanding climate patterns and how they
change over time, and it helps governments and organizations to make informed
decisions about emergency response plans, resource allocation, and infrastructure
development.
5.2.3 Updating and Graphing
here are sensors all around—in our homes, smart phones, automobiles, city
infrastructure, and industrial equipment. Sensors detect and measure information on all
sorts of things like temperature, humidity, and pressure. And they communicate that
data in some form, such as a numerical value or electrical signal. Sensors, or things,
sense data and typically act locally. ThingSpeak enables sensors, instruments, and
websites to send data to the cloud where it is stored in either a private or a public
channel. ThingSpeak stores data in private channels by default, but public channels can
be used to share data with others. Once data is in a ThingSpeak channel, you can
analyze and visualize it, calculate new data, or interact with social media, web services,
and other devices.

Dept., of ECE., SITAMS

You might also like