Mini Project Report
Mini Project Report
ON
SUBMITTED BY
2021-22
T.E. (Electronics & Telecommunication Engineering)
Semester - II
Under the Guidance Of
CERTIFICATE
This is to certify that student Pandule Kumar Raosaheb, Roll No. TE276 is studying in TE
E&TC course in SEM 6 and he has successfully completed and submitted the Mini Project Report
under the subject Mini Project, entitled “Real-time Temperature and Humidity Check App Using
ESP32.”
This study is a partial fulfillment of the degree of Bachelor of Engineering in Electronics
& Telecommunication of Savitribai Phule Pune University, PUNE during the academic year 2021-
2022.
ABSTRACT
This document is meant for describing all the features and procedures that were followed
while developing the system.
This document specially mentions the details of the project how it was developed, the
primary requirement, as well as various features and functionalities of the project and the
procedures followed in achieving these objectives.
Real-Time Temperature & Humidity Check Application forms the real-time home or
room weather in your android application. We’ve setup a new Firebase project which allows any
ESP32 device to sign up anonymously and send temperature readings to the Real-time Database
every 10 seconds.
With the effective use, any industry can apply the “Real-Time Temperature & Humidity
Check Application” for getting quick weather and getting better weather results in less time.
INDEX
CHAPTER 1
INTRODUCTION
Real-time Temperature & Humidity Check application is a simple flutter app that allows
you to monitor changes in temperature, humidity received from Google Firebase Database. So we
are basically focusing on IoT Based Remote Data Monitoring System. In some of our earlier
projects, we used the IoT platforms like Thingspeak, Adafruit.io & Webpage to monitor data
remotely using ESP32. But in this project, we will Send the Real-Time Sensor Data to Google
Firebase with ESP32 & DHT11 Humidity Temperature Sensor. The data will be read using DHT11
Sensor and sent to Google Firebase Console Database.
Humidity and temperature are common parameters to measure environmental conditions.
In this Arduino based project we are going to measure ambient temperature and humidity and
display it on a Android application screen. A combined temperature and himidity sensor DHT11
is used with ESP32 to develop this Celsius scale thermometer and percentage scale humidity
measurement project. This project consists of three sections - one senses the humidity and
temperature by using humidity and temperature sensor DHT11. The second section reads the DHT
sensor module’s output and extracts temperature and humidity values into a suitable number in
percentage and Celsius scale.
It can be used for measuring humidity and temperature values in heating, ventilation and
air conditioning systems. Weather stations also use these sensors to predict weather conditions.
The humidity sensor is used as a preventive measure in homes where people are affected by
humidity. Offices, cars, museums, greenhouses and industries use this sensor for measuring
humidity values and as a safety measure.
CHAPTER 2
REQUIREMENTS
2.2.1 ESP32
ESP32 is a low-cost System on Chip (SoC) Microcontroller from Espressif Systems, the
developers of the famous ESP8266 SoC. It is a successor to ESP8266 SoC and comes in both
single-core and dual-core variations of the Tensilica’s 32-bit Xtensa LX6 Microprocessor with
integrated Wi-Fi and Bluetooth. The good thing about ESP32, like ESP8266 is its integrated RF
components like Power Amplifier, Low-Noise Receive Amplifier, Antenna Switch, Filters and RF
Balun. This makes designing hardware around ESP32 very easy as you require very few external
components.
2.2.2 DHT11
The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a
capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital
signal on the data pin (no analog input pins needed).
2.2.3 RESISTOR
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow,
adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines,
among other uses.
The Flutter framework consists of both a software development kit (SDK) and their widget-
based UI library. This library consists of various reusable UI elements, such as sliders, buttons, and
text inputs. Developers building mobile applications with the Flutter framework will do so using a
programming language called Dart. With a syntax like JavaScript, Dart is a typed object
programming language that focuses on front-end development.
JavaScript, C#, and is Strongly Typed. Since Dart is a compiled language so you cannot execute
your code directly; instead, the compiler parses it and transfer it into machine code.
JSON is an open standard file format and data interchange format that uses human-
readable text to store and transmit data objects consisting of attribute–value pairs and arrays. It is a
common data format with diverse uses in electronic data interchange, including that of web
applications with servers.
CHAPTER 3
SYSTEM ANALYSIS AND DESIGN
3.2 Explanation
3.2 EXPLANATION
The connection of DHT11 with the ESP32 board is very easy. Originally, the DHT sensor
consists of four pins. Where the first pin is the VCC pin, the second is the data pin which has to be
connected with an additional 10k ohm resistor, the third is the un-used pin and the fourth pin the
ground pin. However, on the DHT modules, only three pins are exposed to the pinout of the module
and10k ohm pull-up resistor is internally connected to pin 2. We will be using the module in our
project.
Connect the ground and the VCC of the DHT11 sensor module to the ground and 3.3V pin
of ESP32. Then connect the data pin of the DHT11 sensor module to any appropriate output pin
of the board. We have used GPIO14 in this case.
Follow the schematic diagram below for the ESP32 module and connect them
accordingly.
However, you can use Analytics for advanced messaging for free although you will have
to create an account before accessing it. One of the significant attributes of this software is that it
is beginner-friendly. It is very simple to connect your application to Google Firebase. You have to
follow each step carefully. If you have any difficulty or want to access further information, take a
look at the official Google Firebase Documentation.
You will be redirected to a new web page with the welcome message. Click the button
‘Create a Project’ as shown below.
The following page opens up. Step 1: Write the name of your project. Remember to tick
the Firebase term agreement. Now click ‘Continue’.
Step 2: Now enable ‘Google analytics for this project’ by swiping the sliding button. Click
‘Continue’ to proceed further.
Then go to ‘Database secrets.’ You will be able to view a secret key associated with your
project. This is the unique authorization key that you will save and use later on in the program
code. Keep it a secret and do not share it with anyone or your project security will be compromised.
After setting your location, check ‘Start in Lock mode’ and then click the Enable button.
Your database settings are now completed. Copy the text shown in the highlighted box below.
Save it as well. This will act as your Google Firebase host which we will incorporate in our
program code.
You will download the library as a .zip folder which you will extract and rename as
‘FirebaseESP32’ Then, transfer this folder to the installation library folder in your Arduino IDE.
Likewise, you can also go to Sketch > Include Library > Add .zip Library inside the IDE to add
the library as well. After installation of the library, restart your IDE.
We will use the Library Manager in our Arduino IDE to install the latest versions of the
libraries. Open your Arduino IDE and go to Sketch > Include Libraries > Manage Libraries. Type
each library name in the search bar and install them both.
#include <FirebaseESP32.h>
#include <WiFi.h>
#include "DHT.h"
#define DHTPIN 14
FirebaseData firebaseData;
FirebaseJson json;
void setup() {
Serial.begin(115200);
dht.begin();
WiFi.begin (WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting...");
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(300);
}
Serial.println();
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
Serial.println();
Firebase.begin(FIREBASE_HOST,FIREBASE_Authorization_key);
void loop() {
if (isnan(hum) || isnan(temp) ){
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
Serial.print("Temperature: ");
Serial.print(temp);
Serial.print("°C");
Serial.print(" Humidity: ");
Serial.print(hum);
Serial.print("%");
Serial.println();
Now, let us understand how each part of the code works. Including Libraries
Firstly,
We will include the relevant libraries which are necessary for this project. We
are using three libraries: WiFi.h, FirebaseESP32.h and DHT.h WiFi.h library is used
to connect our ESP32 module with the local WIFI network. The other libraries are
the ones that we previously installed and will be required for the Firebase and sensor
functionality.
A series of normal form tests that can be carried out on individual relation
schemas so that the relational database can be normalized to any desired degree.
Secondly, we will define the network credentials. One for the SSID and the other for the
password. These will be our network credentials which will be used to connect to our wireless
network. Replace both of them with your credentials to ensure a successful connection.
Next, we will define the Google firebase host and authorization key which we accessed and saved
previously.
The following lines of code will specify the type of DHT sensor and the GPIO pin of the
ESP32 board which we will connect with the data pin of the sensor.
#define DHTPIN 14
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
Define the FirebaseData object as ‘firebaseData.’ This will be used later on in the code to
access the sensor readings.
FirebaseData firebaseData;
SETUP() FUNCTION
Inside the setup() function, we will open a serial connection at a baud rate of 115200.
Additionally, we will initiate the connection with the DHT sensor as well.
Serial.begin(115200);
dht.begin();
The following section of code will connect our ESP32 board with the local network whose
network credentials we already specified above. We will use the WiFi.begin() function. The
arguments will be the SSID and the password which we defined earlier in the code. After the
connection will be established, the IP address of the ESP board will get printed on the serial
monitor.
Now, we will connect our ESP32 module with Google Firebase by using the
Firebase.begin() function. It takes in two parameters. The first is the Firebase host and the second
is the authorization key. Both were defined earlier on in the program code. Through correct
credentials, a successful connection will be made.
Firebase.begin(FIREBASE_HOST,FIREBASE_Authorization_key);
LOOP() FUNCTION
Inside the loop() function we will obtain the sensor readings and handle them accordingly.
Firstly, through dht.readHumidity(), the sensor reading will get saved in the variable ‘hum.’
Likewise, for temperature the sensor reading will get saved in the variable ‘temp.’
If the connection between the module and the sensor is incorrect or the values are not being
accessed properly then an error message will be printed. This will help us in debugging our circuit
or a possible issue in the initialization of the sensor.
if (isnan(hum) || isnan(temp) ){
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
Thus, we will display these temperature and humidity readings on the serial monitor.
Newer readings will continuously appear on the screen.
Serial.print("Temperature: ");
Serial.print(temp);
Serial.print("°C");
Serial.print(" Humidity: ");
Serial.print(hum);
Serial.print("%");
Serial.println();
Through Firebase.setFloat() we will update our app with the current temperature and
humidity readings. This function will take in three parameters. The first is the FirebaseData object
which we created. The second is the “project name/the name of the tag which we will set in our
MIT block.” Lastly, we will specify the variable in which we were saving our updated sensor
variables i.e., temp and hum respectively.
CHAPTER 4
The DHT11 sensor shows a linear response with the actual temperature, measured with a
commercial temperature sensor LM35 (Texas Instruments, Dallas, TX). The resolution of the
measured temperature sensor was 0.1 °C, and the standard deviation of the measurements
compared to the ideal line was 0.1 °C.
The measured and actual temperatures when the test chamber was repeatedly set at 37 °C
and 40 °C. These two set points represent the temperature for a normal and severely-infected
human plots the sensor measurements at multiple cycles, showing no observable drift. Errors in
Figs. 8 and 9 are mostly due to the uncertainties carried from the Q factor calculations. However,
we do not believe this will constitute a concern for the intended application because infection
diagnosis does not require a very fast sampling rate. Typically, it would be sufficient to measure
the internal wound temperature for a few times a day to catch the early onset of infections.
In practice, the temperature measurements can be sampled at 5–10 Hz and then averaged
to produce a single data point. This will increase the accuracy while still limit the measurement
time to within a few seconds. Furthermore, as determined by Romano et al. [20], a differential
temperature measurement of 0.9 °C on the skin surfaces is sensitive enough to identify an infection
at the site of a surgery.
With averaging, the DHT11 sensor should have sufficient accuracy for detecting infection.
It was also observed that there was a small resonance frequency shift corresponding to the
temperature change. The temperature dependency of the resonance frequency was small (∼1 kHz
out of 27 MHz per °C). This shift was due to the expansion of the inductive windings or the core
CHAPTER 5
SUMMARY
First we install our android application that developed in android studio in debug version
to test all the activities of myweather app. Open the application and first you can see the welcome
screen of our mini project which is Real-time temperature and humidity weather app. In the
welcome screen click on the “Get Started” to move further to sign in and sign up page.
In a Sign In page you actually sign in through the your Email ID and Password if you
haven’t any account or sign in credentials then you can Register a new account on clicking on
“Register” text on the sign in screen.
In Register screen you have to fill all the text field of input data which is first is your Email
Id and Secondly your password to protect your account then Re-enter the same password in second
input filed.
When you complete sign in process you actually signed in the app at main home screen. In
the app home screen you see the our real-time room temperature and humidity.
CHAPTER 6
It is evident from this project work that Temperature and Humidity Sensor Project can be
cheaply made from low-cost locally available components and be used to monitor and control the
temperature and humidity at the data center.
And better still, the components required are so small and few that they can be packaged
into a small container. The designed project was tested a number of times and certified to achieve
the aim of the project. This Temperature and Humidity Sensor Project can also be done using the
esp32 or various other sensors. Hence, this system is scalable and flexible.
The design and application of the DHT11 sensor for monitoring temperature at interference
screws are presented. The DHT11 sensor was demonstrated to be stable with temperature,
producing linear and consistent temperature with no observable measurement drift. Although the
position and orientation of the sensor with respect to the detection coil affect its performance, this
study has shown that the sensor can still produce accurate results as long as it is within 20 mm
from the coil, and the misalignment between their angles is 40° or less. Experimental results also
show the signal from the sensor can further improve with increasing number of turns and a thicker
wire in the sensor’s inductor
In the future, the extensive Arduino system can put into practice as agriculture automation
system and weather-based fertilizer flower and monitor the value of the plants' growth via the
mobile application. IoT based systems are a vital step in sympathetic, relevance growth,
accomplishment, and serve as a construction block for a numeral of practical modernization
technique controller.
IoT based system can be extended for controlling extraordinary electronic and electric
devices from remote locations. Moreover, the system also can be extended for finding the moisture
of soil and the farm monitoring for animals growth.
REFERENCES
http://www.wikipedia.org
The Definitive Guide to Firebase: Build Android Apps on Google's Mobile Platform
Paperback – Import, 12 December 2017.