You are on page 1of 20

ACMEGRADE IoT INTERNSHIP PROGRAM

PROJECT REPORT
ON

“Design a Weather Monitoring System”


Submitted by

Name: Krishnan Rathan Nair (1st Year)


Branch: ECE
College: Rajagiri School of Engineering and Technology
Name: Vyshnavi Grandhi Sri (2nd Year)
Branch: Electrical
College: University College of Engineering -JNTUK,Kakinada
Name: Maan Garg (4TH Year)
Branch: Mechatronics
College: Manipal University Jaipur
Name: Aditi Tijare (4th Year)
Branch: ECE
Colllege: K. K. Wagh Institute of Engineering Education and
Research, Nashik

Trainer Name: Swati Chitta


Institute: Acmegrade Pvt. Ltd.
ABSTRACT

The IoT Weather-Based Monitoring System (IoT-WBMS) represents a cutting-


edge application of the Internet of Things (IoT) in the realm of environmental
monitoring. Leveraging a network of interconnected devices and sensors, the
system collects real-time weather data from diverse sources, such as
meteorological stations and satellites, to provide comprehensive and up-to-date
environmental information. Through advanced analytics and cloud-based
storage, the IoT-WBMS enables users from various sectors, including agriculture,
transportation, and disaster management, to make informed decisions, optimize
resource allocation, and enhance overall operational efficiency in response to
dynamic weather conditions. Despite its potential benefits, challenges related to
data security and scalability must be addressed to fully realize the transformative
potential of this IoT-enabled monitoring system.
In conclusion, the IoT Weather-Based Monitoring System represents a powerful
fusion of IoT technologies and weather data, offering real-time insights and
actionable information across industries. With its ability to enhance decision-
making, resource optimization, and risk mitigation, this system is poised to play
a pivotal role in shaping a more resilient and sustainable future. By addressing
security and scalability concerns, stakeholders can unlock the full potential of
IoT-WBMS, driving innovation and positive impact in a rapidly evolving world
Block Diagram

Fig: Block Diagram of Weather monitoring system

This block diagram consists of microcontroller like Arduino UNO and ESP8266
which acts as the main processing unit for entire system and where all the
sensors like humidity and temperature sensors, pressure sensors, air quality are
used to monitor factors and devices are connected which is displayed on the
LCD display.

Components
1. 5V power supply
2. Arduino UNO
3. 16x2 display
4. DHT11 temperature and humidity sensor
5. MQ-135 sensor air quality sensor
6. BMP180 Barometric sensor
7. Light depend resistor (LDR)
8. Generic ESP8266 Wi-Fi Module
Description of Components

1. 16 x 2 LCD display

We are utilizing a 16 x 2 LCD display to showcase sensor data locally and it can
display 16 alphanumeric characters in 2 rows.

An I2C display module is used in this project to reduce the number of wires that
connect from microcontroller to LCD display to four; otherwise we need to
connect 16 wires.

I2C display module operates on I2C bus and has the following four pins:

 SDA – Serial data.


 SCL – Serial clock.
 Vcc – 5V.
 GND – ground.

The Vcc pin connects to 5V of the power supply module and GND connects to
GND of the supply, the SDA connects to A4 of Arduino and SCL connects to
A5.

The I2C module has backlight control, by removing the jumper we can turn off
the backlight and vice-versa. You can adjust the display contrast by rotating the
potentiometer (blue colour on the module) using a small screw driver.
2. DHT11 temperature and humidity module:

DHT11 is a digital sensor responsible for collecting temperature and humidity


data from your surroundings. It has three terminals namely:

 Vcc
 GND
 Data

Vcc connects to 5V supply, GND connects to GND and data pin connects to A0
of Arduino. The DHT11 is a compact and cost-effective temperature and
humidity module commonly used in various applications. This sensor module
integrates a humidity sensor, temperature sensor, and a signal processing circuit
on a single chip. It provides accurate and reliable measurements of ambient
temperature (in Celsius) and relative humidity (in percentage). With its digital
output interface, the DHT11 is easy to interface with microcontrollers and
Arduino boards, making it an ideal choice for DIY projects, weather stations,
indoor climate monitoring, and other IoT applications where monitoring and
controlling environmental conditions are essential.
3. BMP180 barometric sensor:

The above illustrated module is a barometric sensor which is capable of


measuring atmospheric data; it can give out data like, atmospheric pressure at
ground level, atmospheric pressure at sea level and altitude.

We will be only extracting atmospheric pressure data at ground and sea level to
display it on the LCD, but we will be sending only the atmospheric pressure data
at ground level to Thingspeak server, which is the relevant data for your locality.

It has the following pins:

 SDA – Serial data.


 SCL – Serial clock.
 Vcc – 3.3V.
 GND – ground.

Care must be taken while connecting the supply to this module as it operates on
3.3V DC and 5V will kill the module. It operates on I2C bus, same as I2C display
adapter module.
4. MQ-135 air quality sensor module:

MQ-135 is an analog air quality sensor which takes air samples from your
surroundings and gives out an analog voltage at its output terminal. MQ-135 can
detect the following gases:

 NH3
 NOx
 Alcohol
 Benzene
 Smoke, CO2 etc.

The operating voltage of MQ-135 is 5V and consumes around 160mA, the sensor
has built-in heater for heating the sensor for its normal operation and if the sensor
is exposed to strong wind we may get incorrect readings. The sensor takes
typically around 3 to 5 minutes to reach optimum temperature depending on
surrounding air flow.

The sensor has good sensitivity to detect the above mentioned gases, but the
disadvantage is it cannot differentiate which gas or gases have been detected.
5. Generic ESP8266 module:

The Generic ESP8266 module is a compact and versatile Wi-Fi-enabled


microcontroller board, widely used in the world of IoT and DIY
electronics. Powered by the Espressif Systems' ESP8266 chip, this module
offers seamless connectivity to Wi-Fi networks, making it ideal for various
applications. Its small size and low power consumption make it perfect for
embedding in smart home devices, wearables, and remote sensors. The
module's GPIO pins allow interfacing with other components easily, while
its programmability through Arduino IDE or MicroPython enables
developers to create custom functionalities. With its affordability and
adaptability, the Generic ESP8266 module remains a popular choice for
IoT enthusiasts and professionals alike.
Pin Diagram of ESP8266

6. Light depend resistor – LDR:

LDR is responsible for collecting data about the intensity of light at your
surroundings and it is a passive analog sensor.The LDR is essentially a
resistor that is sensitive to the light, when higher intensity light falls on the
photosensitive surface its resistance drops and when less light is received
its resistance increases.
In other words, the resistance is inversely proportional to the intensity of
the light on the photosensitive surface of LDR.
7. Arduino UNO

The Arduino UNO is a widely acclaimed open-source microcontroller board


that has become a cornerstone of the DIY electronics and maker community.
Developed by the Italian company Arduino, the UNO boasts a user-friendly
and versatile design, making it accessible to both beginners and experienced
enthusiasts. It is built around the ATmega328P microcontroller, featuring
numerous digital and analog input/output pins that facilitate seamless
interaction with a variety of sensors, actuators, and components.

The Arduino UNO's strength lies in its simplicity and extensibility. With its
easy-to-use Integrated Development Environment (IDE) and a vast array of
libraries and tutorials, even those new to electronics can quickly grasp the
basics of programming and prototyping. Its compatibility with shields –
expansion boards that provide additional functionality – further extends its
capabilities, enabling users to create projects ranging from basic blinking LED
experiments to complex home automation systems and robotics.

As a powerful and affordable platform, the Arduino UNO continues to inspire


countless inventors, educators, and hobbyists, driving innovation and
creativity in the ever-expanding world of electronics and IoT applications.
Circuit Diagram

Fig: Circuit Diagram for IoT based weather monitoring system


Code

1. Program code for arduino

#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#include <dht.h>
#include <Wire.h>
#include <BMP180.h>
dht DHT;
LiquidCrystal_I2C lcd(0x27, 16, 2);
SoftwareSerial mySerial(10, 11);
BMP180 myBMP(BMP180_ULTRAHIGHRES);
#define DHT11_PIN A0
#define mq135_pin A2
#define LDR A1
void ReadDHT(void);
void ReadBMP(void);
void ReadAir(void);
void send_data(void);
bool BMP_flag = 0;
bool DHT_flag = 0;

void setup()
{
mySerial.begin(115200);
pinMode(mq135_pin, INPUT);
pinMode(LDR, INPUT);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print(" IoT Weather ");
lcd.setCursor(0, 1);
lcd.print("Monitor System");
delay(1500);
}

void loop()
{
ReadDHT();
ReadBMP();
ReadAir();
Readlight();
send_data();
}

void ReadDHT(void)
{
lcd.clear();
int chk = DHT.read11(DHT11_PIN);
switch (chk)
{
case DHTLIB_OK:
DHT_flag = 1;
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(DHT.temperature, 1);
lcd.print(" *C");
lcd.setCursor(0, 1);
lcd.print("Humi: ");
lcd.print(DHT.humidity, 1);
lcd.print(" %");
break;
case DHTLIB_ERROR_CONNECT:
lcd.setCursor(0, 0);
lcd.print("NO DHT11 SENSOR");
lcd.setCursor(0, 1);
lcd.print(" FOUND! ");
break;
case DHTLIB_ERROR_CHECKSUM:
case DHTLIB_ERROR_TIMEOUT:
case DHTLIB_ERROR_ACK_L:
case DHTLIB_ERROR_ACK_H:
default:
DHT_flag = 0;
lcd.setCursor(0, 0);
lcd.print(" DHT11 SENSOR ");
lcd.setCursor(0, 1);
lcd.print(" ERROR ");
break;
}
delay(2000);
}
void ReadBMP(void)
{
lcd.clear();
if (myBMP.begin() != true)
{
lcd.setCursor(0, 0);
lcd.print(" BMP180 SENSOR ");
lcd.setCursor(0, 1);
lcd.print(" NOT FOUND ");
BMP_flag = 0;
delay(2000);
}
else
{
BMP_flag = 1;
lcd.setCursor(0, 0);
lcd.print("Pa(Grnd):");
lcd.print(myBMP.getPressure());
lcd.setCursor(0, 1);
lcd.print("Pa(sea) :");
lcd.print(myBMP.getSeaLevelPressure(115));
}
delay(2000);
}

void ReadAir(void)
{
int airqlty = 0;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("AIR QUALITY:");
airqlty = analogRead(mq135_pin);
lcd.print(map(analogRead(mq135_pin), 0, 1024, 99, 0));
lcd.print("%");
lcd.setCursor(0, 1);
if (airqlty <= 180)
lcd.print("GOOD!");
else if (airqlty > 180 && airqlty <= 225)
lcd.print("POOR");
else if (airqlty > 225 && airqlty <= 300)
lcd.print("VERY BAD");
else
lcd.print("TOXIC");
delay(2000);
}

void Readlight(void)
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("LIGHT :");
lcd.print(map(analogRead(LDR), 0, 1024, 0, 99));
lcd.print("%");
lcd.setCursor(0, 1);
lcd.print("****************");
delay(2000);
}

void send_data()
{
mySerial.print('*'); // Starting char
if (DHT_flag == 1)
{
mySerial.print(DHT.temperature, 0); //2 digit data
mySerial.print(DHT.humidity, 0); //2 digit data
}
else
{
mySerial.print("0000"); // Send dummy data
}
if (BMP_flag == 1)
{
mySerial.print(myBMP.getPressure()); //5 digit data
}
else
{
mySerial.print("00000");// Send dummy data
}
mySerial.print(map(analogRead(LDR), 0, 1024, 0, 99)); //2 digit
data
mySerial.print(map(analogRead(mq135_pin), 0, 1024, 99, 0)); //2
digit data
mySerial.println('#'); // Ending char
}
2. Program code for ESP8266

#include "ThingSpeak.h"
#include <ESP8266WiFi.h>

//------- WI-FI details ----------//


char ssid[] = "SSID"; //SSID here
char pass[] = "PASSWORD"; // Password here

//----------- Channel details ----------------//


unsigned long Channel_ID = 123456; // Your Channel ID
const char * myWriteAPIKey = "ABC123CDE456"; //Your write
API key

const int Field_Number_1 = 1;


const int Field_Number_2 = 2;
const int Field_Number_3 = 3;
const int Field_Number_4 = 4;
const int Field_Number_5 = 5;
String value = "";
int value_1 = 0, value_2 = 0, value_3 = 0, value_4 = 0, value_5 =
0;
WiFiClient client;
void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
internet();
}
void loop()
{
internet();
if (Serial.available() > 0)
{
delay(100);
while (Serial.available() > 0)
{
value = Serial.readString();
if (value[0] == '*')
{
if (value[14] == '#')
{
value_1 = ((value[1] - 0x30) * 10 + (value[2] - 0x30));
value_2 = ((value[3] - 0x30) * 10 + (value[4] - 0x30));
value_3 = ((value[5] - 0x30) * 10000 + (value[6] - 0x30) *
1000 + (value[7] - 0x30) * 100 + (value[8] - 0x30) * 10 + (value[9]
- 0x30));
value_4 = ((value[10] - 0x30) * 10 + (value[11] - 0x30));
value_5 = ((value[12] - 0x30) * 10 + (value[13] - 0x30));
}
}
}
}
upload();
}
void internet()
{
if (WiFi.status() != WL_CONNECTED)
{
while (WiFi.status() != WL_CONNECTED)
{
WiFi.begin(ssid, pass);
delay(5000);
}
}
}
void upload()
{
ThingSpeak.writeField(Channel_ID, Field_Number_1, value_1,
myWriteAPIKey);
delay(15000);
ThingSpeak.writeField(Channel_ID, Field_Number_2, value_2,
myWriteAPIKey);
delay(15000);
ThingSpeak.writeField(Channel_ID, Field_Number_3, value_3,
myWriteAPIKey);
delay(15000);
ThingSpeak.writeField(Channel_ID, Field_Number_4, value_4,
myWriteAPIKey);
delay(15000);
ThingSpeak.writeField(Channel_ID, Field_Number_5, value_5,
myWriteAPIKey);
delay(15000);
value = "";
}
Simulation
Conclusion

In conclusion, the IoT Weather Monitoring System project has successfully


demonstrated the immense potential of integrating cutting-edge technology with
weather monitoring for enhanced data collection and analysis. By combining
Internet of Things (IoT) devices, cloud computing, and data analytics, the system
has provided real-time and accurate weather information, enabling better decision
making and resource management in various sectors.
Throughout the project, we have designed and implemented a network of
interconnected weather sensors, capable of collecting a wide range of
environmental data such as temperature, humidity, wind speed, and precipitation.
The data collected is securely transmitted and stored in the cloud, where advanced
analytics tools process and interpret it for meaningful insights.
The project's success lies in its ability to offer a cost-effective and scalable
solution, making weather monitoring accessible to a broader audience.
Furthermore, the system's user-friendly interface allows stakeholders to easily
access and interpret the data, fostering a more informed approach to weather-
related challenges.
Overall, the IoT Weather Monitoring System holds the potential to revolutionize
weather monitoring practices, paving the way for safer and more efficient
operations across industries and contributing to a more sustainable and resilient
future.

Limitations
 It might have low accuracy.
 It has high power consumption with increase in cost.
 Data is transferred manually
References
1. https://electronics-project-hub.com/iot-based-weather-monitoring-
system-using-arduino/
2. https://srituhobby.com/iot-based-weather-monitoring-system-using-
nodemcu-and-thingspeak/
3. https://www.hackster.io/rajeshjiet/iot-based-weather-monitoring-system-
using-arduino-d3337b
4. https://ieeexplore.ieee.org/document/7988038
5. https://www.ijraset.com/research-paper/iot-based-weather-monitoring-
system
6. https://www.airtel.in/blog/business/iot-use-cases-in-real-time-weather-
monitoring-system/

You might also like