Professional Documents
Culture Documents
PROJECT REPORT
ON
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:
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:
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:
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.
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:
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'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.
#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>
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/