Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Indoor Comfort Index Monitoring System using KNN algorithm
1. Indoor Comfort Index Monitoring
System using KNN algorithm
Faisal Mehmood
AM20186805
Mobile Computing Lab
Department of Computer Engineering
Jeju National University, South Korea
2019-05-22
2. Table of Content
S.No Topic Page
1. Hardware Requirement and Cost 3
2. Introduction to Raspberry Pi and GPIO 4
3. Hardware Configuration 5
4. Installation of Raspbian Operating System 8
5. Introduction to Project: Indoor Comfort Index Monitoring System using KNN algorithm 19
6. Implementation Stack 20
7. Source Code Online GitHub 21
8. Pre-Requisite Libraries 22
9. Dataset on Kaggle and Kernel Link 23
10. Dataset Pre-processing 26
11. Experimental Environment 27
12. Results Visualization 28
13. KNN Classification 37
14. Performance Evaluation 38
15. Conclusion 39
3. Hardware Requirement
S.No Hardware Device Description Cost
1. Raspberry Pi Raspberry Pi 3 Model B 35 USD
2. BME280 Sensor BME280 Sensor is used to get Temperature, Humidity, and
Pressure values
7 USD
3. 16 GB SD Card SD Card is used to install Raspbian Operating System, store
data, and run program
4 USD
4. Card Reader Card Reader is used to burn the Operating System on the
SD Card.
7 USD
4. Raspberry Pi 3 Model B General Input Output Pins (GPIO)
Raspberry Pi has 40 GPIO. The details of
GPIO are given in this figure. These pins
are used for different purposes e.g.
Ground pin is used for neutral, Power pin
is used to provide voltage. There are 3
volts and 5 volts pins, GPIO pins are used
for input and output.
The Raspberry Pi is a low cost, credit-card sized computer that
plugs into a computer monitor or TV, and uses a standard
keyboard and mouse. It is a capable little device that enables
people of all ages to explore computing, and to learn how to
program in languages like Scratch and Python. Raspberry pi is
used for Internet of Things (IoT) projects.
5. Hardware Configuration
Step 1: Insert 16 GB Memory Card into Raspberry Pi
• In step 1. Insert the 16 GB SD Card into
the Raspberry Pi. Note that the
Raspbian Operating system is installed
on the SD Card. In Next slides, I will
guide you how to Install the Raspbian
Operating System on the SD Card.
6. Hardware Configuration
Step 2: Configuration of BME280 Sensor
Wire with Raspberry Pi
The configuration of the BME280 Sensor can be
done by taking help from the figure 2.
In this figure, we can see that there are four wires
in BME280 Sensor. Brown, Yellow, Red, and Orange.
1. Brown Wire is connected with GND (Ground). It
is attached with 6 number on the Raspberry Pi.
2. Yellow Wire is connected with 3V3 (volts). It is
attached with GPIO 1 on the Raspberry Pi.
3. Red Wire is connected with SDA1 12C. It is
attached with GPIO 3 on the Raspberry Pi.
4. Orange Wire is connected with SCL1 12C. It is
attached with GPIO 5 on the Raspberry Pi.
7. Hardware Configuration
Step 3: Power On the Raspberry Pi
• In Step 3, Insert the power cable
into the Raspberry pi as shown
in the figure.
8. Raspbian Installation
Step 1: SD Memory card formatter
• If you are using windows, then download SD Memory Card Formatter
from the following link
• https://www.sdcard.org/downloads/formatter_4/eula_windows/inde
x.html
• Accept the terms and condition and download
• Install SD Memory Card Formatter
9. Raspbian Installation
Step 2: format the memory card
• Insert SD Card into the Card
Reader and Plug In to Your
Computer
• Select the Drive of SD Memory
Card
• Now Format The SD Memory
Card using SD Memory Card
Formatter
10. Raspbian Installation
3: Download raspbian noobs
• Download Raspbian Noobs Zip File from the following link
• https://www.raspberrypi.org/downloads/noobs/
• Extract the Zip File
• Copy all the content of the folder into the SD Memory Card
11. Raspbian Installation
Step 4: Install Raspbian noobs
• Now insert the SD Memory Card in Raspberry PI
• Power ON Raspberry Pi and follow the instructions
14. Raspbian Installation
Step 4: follow instructions
• Click Install (Left Top Corner)
• You will get warning, Click YES
15. Raspbian Installation
Step 4: follow instructions
• Now Installation begins, Wait for
the installation to complete
• It will take 10 to 15 minutes to
complete.
16. Raspbian Installation
Step 4: follow instructions
• When Installation is complete,
you will get a notification OS
Installed Successfully
• Click OK and Let it Reboot
18. Video Tutorial for Raspbian Installation
• Please Follow my YouTube Account for video tutorials.
• http://www.youtube.com/c/FaisalMehmoodAvan
• If you have any difficulty in installation, you can contact me on
Youtube
19. Introduction
• In this study, we will implement the indoor comfort index monitoring
system by using BME280 sensor.
• BME280 sensor is capable of monitoring temperature, pressure, and
humidity of the environment. The purpose of this study is to apply
machine learning algorithm to classify the current status of indoor
comfort index. We used KNN to classify the indoor condition i.e. normal
or hot.
20. Implementation Stack
Software/Hardware Description
Raspberry PI Raspberry Pi 3 Model B
BME280 Sensor BME280 sensor for temperature, pressure, and
humidity
Operating System for Raspberry Pi Raspbian OS
Integrated Development Environment Thonny
Programming Languages Python
Platform Kaggle
21. Download the Source Code
• Download the Source Code from the following GitHub Account.
• https://github.com/faisalavan/bme280
22. Install Pre-Requisite Libraries
• We have used different libraries. To run the project we have to install libraries
first.
Open the Command Terminal and Run the Following commands
• sudo apt-get update
• sudo apt-get install build-essential python-pip python-dev python-smbus git
• git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
• cd Adafruit_Python_GPIO
• sudo python setup.py install
Following command will install pandas library used to handle big data.
• sudo apt-get install python-pandas
Following Command is used to perform mathematics on the dataset.
• sudo pip install numpy
23. Dataset
• I have uploaded the Dataset on
Kaggle. Following is the link
• https://www.kaggle.com/faisalawan/
bme280sensordata
• https://www.kaggle.com/faisalawan/
kernel905a723b08/edit/run/145006
55
• I collected 100,000 records for
experiment.
24. Dataset Details
• This figure represents the count of
the dataset, mean, standard
deviation, minimum and maximum
values for each column
25. Dataset Details
• This figure represents the details of
the columns such as data type,
count, null or non-null values
26. Data Pre-Processing
• As the data collected from BME280 sensor is unlabeled data. Pre-
processing includes labeling of the dataset.
• We classified the dataset into two different classes i.e. normal or hot
based on the collected data
• If the temperature is between 70 and 78 Fahrenheit, then the room
temperature is normal. If temperature is greater than 78 Fahrenheit,
then the room temperature is hot.
27. Experimental Environment
• In this experiment, I used BME280
sensor for indoor monitoring.
• BME280 sensor is used to sense
temperature, humidity, and
pressure
28. Temperature
• This figure represents the
visualization of Temperature data
gathered from the BME280 sensor
34. Source Code- Import Required Libraries
• This figure represents the snapshot
of the source code used to import
required libraries.
35. Source Code - Reading BME280 Sensor Values
• This snapshot of source code shows
the sensing value of BME280 sensor
36. Source Code – Reading Dataset
• This figure represents the reading
dataset and storing in pandas
dataframe
37. K-NN Classification
• In this figure, we can see that
Accuracy of Testing Data is high
when value of K is 1.
• Accuracy of Testing Data is low when
value of K is 8
39. Conclusion
• In this study we implemented a Indoor Comfort Index Monitoring
System using KNN algorithm. We come to conclusion that the
accuracy of KNN algorithm is high when the value of K is equal to 1.
By using KNN classification, we can predict the hot and normal
condition of the indoor.