Weather Monitoring System Using NodeMCU
Weather Monitoring System Using NodeMCU
A PROJECT REPORT
ON
“IoT Based Weather Monitoring System using NodeMCU”
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD
OF
DIPLOMA IN
ELECTRONICS AND TELECOMMUNICATION ENGINEERING
SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI
SUBMITTED BY
Name Of Students Enrollment No.
GUIDED BY
Smt. Pathan J.J.
Government Polytechnic, Awasari (Kh)
2019-2020
March 2022
Submitted by
Name Of Students Enrollment No.
In partial fulfillment of
Diploma in
Electronics and Telecommunication Engineering
Guided by
Smt. Pathan J.J.
CERTIFICATE
This is to certify that the project report entitled “Coin Insertion Based
Mobile Charging System” was successfully completed by student of sixth
semester Diploma in Electronics and Telecommunication Engineering
Dighe Atul Sambhaji
Borkar Prathmesh Balu
Bangar Sushant Manjaba
Revgade Abhishek Punjaram
In partial fulfillment of the requirements for the award of the Diploma in
Electronics and Telecommunication Engineering of Government
Polytechnic, Awasari (Kh.) work carried out during a period for academic
year 2021-2022 as per curriculum.
Dr. D. R. Nandanwar
External Examiner Principal
March 2022
ACKNOWLEDGEMENT
This project done as final year project title “Coin Insertion Based
Mobile Charging System” in partial fulfillment of the requirements for the
award of the Diploma in Electronics And Tele-communication Engineering.
We are really thankful to the Principal Dr. D. R. Nandanwar, and the
Head of Department Dr. P. S. Sharma, Electronics and Telecommunication
Engineering Department, Government Polytechnic, Awasari (Kh.) for their
valuable guidance and assistance without which the accomplishment of the
project would have never been possible.
We also thank Smt. Pathan J. J. for guiding and giving this opportunity
to explore into the real world, realize the interrelation without which a project can
never progress. We are also grateful to parents, friends and all staff of
Electronics and Telecommunication Engineering Department, for providing
us relevant information, and support.
ABSTRACT
This project was developed because to help user access data about
station and weather forecast. The weather forecast is to predict the weather
according for a given location and time. Weather forecasts are made by collecting
Meanwhile, real-time weather station is a device that collects data related to the
facility that can use for measuring atmospheric conditions like temperature,
humidity and air pressure to provide information for weather forecasts and to
study the weather and climate. Due to the fact that without weather station, user
can’t be alerted of the strong winds, heat waves or any other weather-related
emergency. This means that we need weather station to make forecasts and
collects data related to the weather. To overcome the problems faced, there are
techniques that can be implemented to assist this project. This project will use
Internet of Things with sensors to build weather station. The weather station can
Content
______________________________________________
CHAPTER 1 - INTRODUCTION….…………………………..….1
CHAPTER 2 -BLOCK DIAGRAM………………………………..3
2.1 Block Diagram …………………………………....………………4
2.2Component Used In Block Diagram…………......………………..5
2.3 Block Diagram Description………………………………….……6
CHAPTER 3 – Circuit Diagram…………………………......……..8
3.1 Circuit Diagram………………………..………………….………9
CHAPTER 4- INTRODUCTION OF NodeMCU…………………..10
4.1Introduction……………………………………………………..…11
4.2Pin Diagram………………………………………………………..17
4.3 Features……………………………………………..……………..19
CHAPTER 5 –HARDWARE DESCIPTION…………………..…..20
5.1 Power Supply………………………….........................………....21
5.2 MQ135 Sesnor…………......……………………………………..27
5.3 Relay Module .........……………………..…………………..…....30
5.4 BMP280……….……………………………………………….…32
5.5 Rain Drop Sensor……………………………………………….…..34
5.6 LED……….……………………………………………………....39
CHAPTER 6- PROGRAMMING………………………………...….41
6.1 Algorithm…………………………………………………….....…..42
6.2 Flowchart……………………………………………………….…..43
6.3Program……………..………….…………………………..……….44
CHAPTER 7 – RESULT, CONCLUSION AND FUTURE SCOPE
7.1 Result………………………………………………………………..52
March 2022
7.2 Conclusions…………………………………………….…………...54
7.3 Future scope………………………………………….……………..54
CHAPTER 8 – REFERENCES…………………………….…….......55
8.1 Books……………………………………………………………….56
8.2 Websites……………………………………………….…………....56
CHAPTER 9 –APPENDIX………………………………………........57
List of Component with Price……………..…………………….…..….58
March 2022
CHAPTER 1
INTRODUCTION
March 2022
A weather station is a device that collects data related to the weather and
environment using many different sensors. Weather station is also a facility that
can use for measuring atmospheric conditions to provide information for weather
forecasts and to study the weather and climate. The measurements taken include
precipitation amounts. Weather stations are also called weather centers, personal
weather stations, professional weather stations, home weather station and weather
forecaster. There are a difference between real-time weather station and weather
forecast. The weather forecast is to predict the weather according for a given
determine how the weather will change in the future. Meanwhile, real-time
weather station is a device that collects data related to the weather and
environment using many different sensors and get accurate weather readings in
real time. Therefore, Weather Station using Internet of Thing is proposed to help
user access data about weather anywhere in real-time. User can collect the
or tablet. This means that whenever user want to know what the temperature is,
CHAPTER 2
BLOCK DIAGRAM
March 2022
In this block diagram I will shows how to work the project in a simple method.
In this project the main part is controller that is ESP12-E based nodemcu. I will
Relay Module, Rain Drop Sensor, MQ135 Air Quality Sensor, Led, etc. This
Weather Station project only involves user to view the data of weather such as
temperature, humidity, air pressure, dew point, altitude, rainfall, and air quality. In
this project, BMP280 Sensor, Rain Drop Sensor, MQ135 Air Quality Sensor will be
used to build weather station. Last, weather station also require an internet
1. Nodemcu
2. DC Power Adapter.
3. BMP280 Sensor
6. LED
7. Header Strips
8. Relay module
9. Diode
10. Resistor
March 2022
CHAPTER 3
CIRCUIT DIAGRAM
3 .1 CIRCUIT DIAGRAM :-
March 2022
March 2022
CHAPTER 4
INTRODUCTION TO NodeMCU
This is not a weakling like the Arduino's, with 512kb of memory and a processor
at 40Mhz there is not a shortage of sources. This sign is extremely suitable for
slightly different than normal, with the API that looks like NodeJS, this module
receives the commands through the LUA scripts that are uploaded.
This concerns version 3 of the NodeMCU series, which is somewhat wider than
the previous version and therefore no longer fits neatly on a breadboard. To make
this right, an I / O shield has been designed to fit this NodeMCU perfectly. This
version contains the CH340G version to save costs instead of the CP2102 serial
chip.
4. 2 PIN DIAGRAM:-
March 2022
Properties
Wireless 802.11 b / g / n standard
Supports STA / AP / STA + AP
Standard on 9600 baud
Built-in TCP / IP protocol stack to support multiple TCP Client connections (5
MAX)
D0 ~ D8, SD1 ~ SD3: used as GPIO, PWM, IIC, etc., port driver capability
15mA
AD0: 1 channel ADC
Power input: 4.5V ~ 9V (10VMAX), USB powered
Current: continuous transmission: ≈70mA (200mA MAX), Standby: <200uA
Transfer rate: 110-460800bps
Support UART / GPIO data communication interface
March 2022
4.3 FEATURES:-
Microcontroller: Tensilica 32-bit RISC CPU Xtensa LX106
Operating Voltage: 3.3V
Input Voltage: 7-12V
Digital I/O Pins (DIO): 16
Analog Input Pins (ADC): 1
UARTs: 1
SPIs: 1
I2Cs: 1
Flash Memory: 4 MB
SRAM: 64 KB
Clock Speed: 80 MHz
USB-TTL based on CP2102 is included onboard, Enabling Plug n Play
PCB Antenna
Small Sized module to fit smartly inside your IoT projects
March 2022
CHAPTER 5
HARDWARE DESCRIPTION
Bridge rectifier:
A bridge rectifier can be made using four individual diodes, but it is also available
in special packages containing the four diodes required. It is called a full-wave
Rectifier because it uses the entire AC wave (both positive and negative sections).
1.4V is used up in the bridge rectifier because each diode uses 0.7V when
conducting and there are always two diodes conducting, as shown in the diagram
below. Bridge rectifiers are rated by the maximum current they can pass and the
maximum reverse voltage they can withstand (this must be at least three times the
supply RMS voltage so the rectifier can withstand the peak voltages
Smoothing:
Voltage regulator:
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or
variable output voltages. They are also rated by the maximum current they can pass.
Negative voltage regulators are available, mainly for use in dual supplies. Most
March 2022
The +12 volt power supply is based on the commercial 7812 voltage
regulator IC. This IC contains all the circuitry needed to accept any input voltage
from 15 to 24 volts and produce a steady +12 volt output, accurate to within 5%
(0.25 volt). It also contains current-limiting circuitry and thermal overload
protection, so that the IC won't be damaged in case of excessive load current; it
will reduce its output voltage instead.
The advantage of a bridge rectifier is you don’t need a center tap on the
secondary of the transformer. A further but significant advantage is that the ripple
frequency at the output is twice the line frequency (i.e. 50Hz) and makes filtering
somewhat easier.
March 2022
The use of capacitor c1 and c2 is to make signal ripple free. The capacitor
used before the regulator is to make ac signal ripple free and then later which we
are using is for safety, if incase there is a ripple left after regulating, then c2nwill
remove it.
The drop out voltage of the regulator is 2V As per the data sheet)
Vdc = 2Vm/Pi
=12 x 3.14)/2
=18.84V
Vm= 18.84V
=18.84+1.4= 20.24V
Vim=20.24V
Vrms = Vim/sqrt(2)
= 20.24/sqrt(2)
March 2022
= 14.31V
Vrms = 14.31V
Similarly
Im=Idc x pi/2
Im=700m x 3.14/2
= 1.099A.
Irms= Im/sqrt(2)
= 1.099A/sqrt(2)
` = 777.11mA
Irms = 777.11mA
2. Rectifier Design:
Im= 628mA
BRIDGE RECTIFIER –
R = Vdc/Idc
March 2022
= 15 / 400m
= 37.5Ohms.
Vr = 2(Vim – Vdc)
= 2(20.24 – 12)
= 8.24V
C = Vdc/ (FxRxVr)
= 12/ (100x17.5x8.24)
= 832.17uF
So the power supply made from the above mentioned components gives the
output of 12V.
The MQ-135 Gas sensor can detect gases like Ammonia (NH3), sulfur (S),
Benzene (C6H6), CO2, and other harmful gases and smoke. Similar to other MQ
March 2022
series gas sensor, this sensor also has a digital and analog output pin. When the
level of these gases go beyond a threshold limit in the air the digital pin goes
high. This threshold value can be set by using the on-board potentiometer. The
analog output pin, outputs an analog voltage which can be used to approximate
the level of these gases in the atmosphere.
The MQ135 air quality sensor module operates at 5V and consumes around
150mA. It requires some pre-heating before it could actually give accurate results.
The MQ135 is one of the popular gas sensors from the MQ series of sensors that
are commonly used in air quality control equipment. It operates from 2.5V to
5.0V and can provide both digital and analog output.
Raindrop Sensor is a tool used for sensing rain. It consists of two modules, a rain
board that detects the rain and a control module, which compares the analog
value, and converts it to a digital value. The raindrop sensors can be used in the
March 2022
Working voltage 5V
Output format: Digital switching output (0 and 1), and analog voltage
output AO
Potentiometer adjust the sensitivity
Uses a wide voltage LM393 comparator
Comparator output signal clean waveform is good, driving ability, over
15mA
Anti-oxidation, anti-conductivity, with long use time
With bolt holes for easy installation
Small board PCB size: 3.2cm x 1.4cm
5.5 LED:-
WORKING PRINCIPLE:-
A light-emitting diode is a two-lead semiconductor light source. It is a p–n
junction diode that emits light when activated. When a suitable voltage is applied
to the leads, electrons are able to recombine with electron holes within the device,
releasing energy in the form of photons. This effect is called electroluminescence,
and the colour of the light (corresponding to the energy of the photon) is
determined by the energy band gap of the semiconductor.
March 2022
FEATURES:
Energy Saving:- The LEDs are extremely efficient low energy light sources.
Light gains:- In 2005 the white LEDs reached outputs of over 30 lumens /
Watt and coloured versions 50 lumens / Watt.
Long operational life:- up to 50,000 hours.
Compact light source:- no other lamp possesses such small dimensions for a
comparative light output.
No radiation:- the LEDs do not emit ultraviolet (UV) or infrared (IR)
radiation.
Durable lamps:- The LEDs are durable against impact and vibration.
Dimmable LEDs:- the LEDs can be dimmed.
Coloured lamps:- Coloured light can be produced effectively – over 16
million colours.
from a micro controller. When activated, the electromagnet pulls to either open or
A simple relay consists of wire coil wrapped around a soft iron core, or
solenoid, an iron yoke that delivers a low reluctance path for magnetic flux, a
movable iron armature and one or more sets of contacts. The movable armature is
hinged to the yoke and linked to one or more set of the moving contacts. Held in
place by a spring, the armature leaves a gap in the magnetic circuit when the relay
March 2022
is de-energized. While in this position, one of the two sets of contacts is closed
field that in turn activates the armature. This movement of the movable contacts
makes or breaks a connection with the fixed contact. When the relay is de-
energized, the sets of contacts that were closed, open and breaks the connection
and vice versa if the contacts were open. When switching off the current to the
coil, the armature is returned, by force, to its relaxed position. This force is
usually provided by a spring, but gravity can also be used in certain applications.
Products is the industry leader in high power relay module design and
manufacturing.
endless options such as terminal position assurance available for wire retention,
5.4 DC ADAPTER
voltage. Power supplies are devices that deliver electric power to one or several
loads. They generate the output power by converting an input signal into an
Features:-
Excellent Quality
No Minimum Load
It's plug design is for Indian power socket so, no plug converter is required
High Reliability
Specifications:-
Output Type - DC
CHAPTER 6
PROGRAMMING
6.1 ALGORITHM:
March 2022
1) Start
7) End
6.3 PROGRAM:
void setup() {
pinMode(relay, OUTPUT);
digitalWrite(relay, LOW);
Serial.begin(115200);
bool status;
March 2022
void loop(){
rain = analogRead(A0);
rain = map(rain, 0, 1023, 100, 0);
delay(5000);
digitalWrite(relay, HIGH);
delay(5000);
MQ135 gasSensor = MQ135(A0);
air = gasSensor.getPPM();
delay(5000);
digitalWrite(relay, LOW);
client.println("<table><tr><th>MEASUREMENT</th><th>VALUE</th></tr>");
client.println("<tr><td>Temp. Celsius</td><td><span
class=\"sensor\">");
double Temperature = bme.readTemperature();
client.println(Temperature);
March 2022
client.println(" *C</span></td></tr>");
client.println("<tr><td>Temp. Fahrenheit</td><td><span
class=\"sensor\">");
client.println(1.8 * bme.readTemperature() + 32);
client.println(" *F</span></td></tr>");
client.println("<tr><td>Humidity</td><td><span class=\"sensor\">");
double Humidity = bme.readTemperature()/100*160;
client.println(Humidity); //humidity
client.println(" %</span></td></tr>");
client.println("<tr><td>Pressure</td><td><span class=\"sensor\">");
client.println(bme.readPressure() / 100.0F);
client.println(" hPa</span></td></tr>");
client.println("<tr><td>Approx. Altitude</td><td><span
class=\"sensor\">");
client.println(bme.readAltitude(SEALEVELPRESSURE_HPA));
client.println(" m</span></td></tr>");
client.println("<tr><td>Rainfall</td><td><span class=\"sensor\">");
client.println(rain);
client.println(" %</span></td></tr>");
client.println(air); //humidity
client.println(" PPM</span></td></tr>");
client.println("</body></html>");
// DewPoint Calculation
double DewPointFast(double celsius, double Humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(Humidity * 0.01);
double Td = (b * temp) / (a - temp);
return Td;
}
March 2022
CHAPTER 7
RESULT, CONCLUSION AND
FUTURE SCOPE
March 2022
7.1 RESULT:
After detecting the data from different sensor devices, which are positioned in particular
area of interest. The sensed data will be automatically sent to the webserver, when a proper
connection is recognized with server device. The webserver page which will allow us to
monitor the data. By clicking on the received link on telegram we will get the equivalent web
page. The web page gives the information of the weather parameters in that particular region,
7.2 CONCLUSION:
March 2022
User can collect the measurements by the sensors at any time. This means that
whenever user want to know what the weather is, user can have access to
information in real time. Then, real-time alerts which allow the user to plan the
day accordingly. Having insights into these alerts can help avoid emergency
situations.
In the technological future, there are many features that can be improved upon in
The weather station can provide data for forecasts. Once a weather station
CHAPTER 8
REFERENCES
March 2022
8.1 BOOKS:
8.2 WEBSITES:
1. https://www.arduino.cc/
2. Steps to Setup Arduino IDE for NODEMCU ESP8266 : 14 Steps -
Instructables
3. What is a Gas Sensor? | Fierce Electronics
4. Rain Sensor : Working, Pin Configuration and Applications
(elprocus.com)
March 2022
CHAPTER 9
APPENDIX
March 2022
2 Dc Jack - 10 1 10
5 Relay 5V 10 1 10
6 Resistors 220Ω 5 2 10
7 Diode 1N4007 1 5 5
8 LED 3.3V/20mA 5 2 10
12 Copper Clad - 60 1 60
PCB
- TOTAL - - - 1945