Smart Building Energy Management Using Machine Learning and IOT
Smart Building Energy Management Using Machine Learning and IOT
net/publication/360609636
Article in International Journal of Innovative Research in Science Engineering and Technology · May 2022
DOI: 10.15680/IJIRSET.2022.1104111
CITATIONS READS
0 1,058
9 authors, including:
A. Ospanova
Al-Farabi Kazakh National University
264 PUBLICATIONS 872 CITATIONS
SEE PROFILE
All content following this page was uploaded by A. Ospanova on 15 May 2022.
| DOI:10.15680/IJIRSET.2022.1104111 |
ABSTRACT: Energy is that the lifeblood of modern societies. Within the past decades, the
world's energy consumption and associated CO2 emissions exaggerated quickly due to the increases in population
and luxury demands of people. Building energy consumption prediction is essential for energy planning,
management, and conservation. This project work aims to develop a machine learning model, method, architecture
or appliance to reduce building energy use and emissions using a smart sensor for residential or commercial
buildings. An experienced operator can do a good job of adjusting set points and schedule. But no matter how good
they are, a human’s ability is restricted by the amount of knowledge he or she can process. Significant opportunities
exist to take advantage of external data sources including real-time occupancy sensor networks, changing space
schedules, weather forecasts, grid carbon intensity, and other environmental conditions that could help us
better predict space set-points and schedules 24x7. The sensor senses CO2 reading, ambient light, door state sensing
etc. These can be used to accurately estimate the number of occupants in each room using machine learning
techniques and this technique can be used to predict future occupancy.
KEYWORDS:Internet of Things, Machine Learning, Raspberry Pi, Cloud Server, PIR Sensor,MQ2 Sensor,DTH11
Sensor, LDR sensor.
I. INTRODUCTION
Excessive domestic energy usage is an impediment towards energy potency. Developing countries are expected to
witness an associate new rise in domestic electricity in the forthcoming decades. A large quantity of research has been
directed towards behavioral change for energy efficiency. Emission of greenhouse gases including carbon dioxide in
higher layers of the atmosphere are referred as the main cause of global warming phenomena. The plan to decrease the
quantity of green- house gases wants vital alteration in human behavior in energy consumption, producing of more
environmental friendly products and distinguishing and mitigating the causes of these undesirable gases. In traditional
buildings, households are responsible for continuously observance and controlling the installed Heating, Ventilation,
and Air Conditioning (HVAC) system. Unnecessary energy consumption might occur due to,as an example, forgetting
devices turned on, that overwhelms users because of the necessity to tune the devices manually. So,we have
| DOI:10.15680/IJIRSET.2022.1104111 |
determined to build a smart building,which are automating this method by automatically tuning HVAC systems
consistent with user preferences so as to boost user satisfaction and optimize energy consumption.
[1]KeMeng et al (2017) proposed that a challenge to organize several groups of aggregate air-conditioners for delivery
system load managing. This projected method aim to present a challenge to synchronize compound group of Virtual
Power Storage Space Scheme (VPSSS) to deal with complex load.
[2]Mario Collotta et al (2017) has proposed system present an Artificial Neural Network (ANN) as maintain for a
Home Energy Management (HEM) arrangement base on Bluetooth low energy, called BluHEMS. The objective of
infrastructure technology is to realize an extensive energy savings, in order to cut greenhouse gas emissions and to
reach effectual ecological security in more than a few contexts, counting infrastructure, developed, transport, buildings,
electricity generation and delivery.
[3]Siyun Chen et al (2017) gives a human-centric Smart Home Energy Management System (SHEM) with the intention
of mechanism at the “butler” plane.In this proposed system a human-centric smart home construction by the
combination of considerate the behaviors of person being, infer the user’s weight and utilization preference and
optimally running the energy plans in smart home. The SHE system can be comprehensive for respond to a variety of
require response signal and contribution expensive maintain for programming and result make at all levels of
usefulness based on the people-centric framework.
[4]S. L. Arun et al (2017) has deals with an Intelligent Residential Energy Management System (IREMS) for producer
of neat housing buildings are planned. The most important purpose of IREMS is decrease in electrical energy bills
whereas maintain the power require less than the maximum demand limit subjected to the variety of constraints
principal the procedure of household demand and Renewable Energy Resource (RER).
III. METHODOLOGY
In existing systems we don’t have any automatic monitoring and controlling of building. In existing system, manual
monitoring of building are required which is dangerous and it requires lots of time to monitor and controlling.Where
as in the proposed system , the various building data are collected from sensors like co2, LDR, DHT11, motion
sensors. The data collected by the IOT sensors are given to the Raspberry pi processor. Based on PIR and LDR then
lights will ON. Based on DHT11 Values the speed of fan will be change. Based on CO2 Values a DC Motor will
rotate. The values are continuously sent to the cloud server where user can continuously checks the sensors parameters.
The sensors are placed in acceptable places of buildings to gather needed features. The output of the sensors ought to
incline to the raspberry pi processor. The processor is accesed through Internet of Things from anywhere. This data is
saved to cloud through Bluetooth or Wi-Fi module. These data are collected for one month and it is to be trained by
machine learning (ML) technique using Support Vector Machine (SVM).The trained model is obtained from the input
options with tuned SVM parameters. Based on this data analysis, the daily routine and occupancy pattern of a building
is calculated. This is helpful for automatic on, off and management of electrical appliances in building utilizing relay,
switches in future. So our smart building saves energy automatically without human intervention.
| DOI:10.15680/IJIRSET.2022.1104111 |
The Figure 1 shows the Block diagram of proposed system, The various building data are collected from sensors like
carbon dioxide, infrared, sound, optical, contact, current, thermal, pressure, DHT11, RFID, motion sensors. The data
collected by the IOT sensors are given to the Raspberry pi processor.Data cleaning and Data integration is completed.
Input features and important features are identified to make training feature set.The training set is kept in cloud if
needed using Wi-Fi module.The Support Vector Machine Learning algorithm was trained based on the training
data.The trained model is employed to get output for new building data.The output from the calculated energy variable
is processed through the relay and switches and given to all home appliances.
The Table 1 shows the information about the sensors used in the project and the limits of the sensor which we have
given to the machine for prediction and operation of appliances after the prediction.
Figures shows the results of how energy is managed in a building and figure 2,3,4,5,6 shows the appliances like
light,fan and ventilator working automatically due to trained machine learning model using SVM algorithm by
collecting data from sensors continuously through Thing speak Iot platform.
(a)
The Figure.2 showsTotal setup of the raspberry pi and Sensors(a)Setup of Raspberry pi and Sensors and connections
(a) (b)
The Figure.3 shows IR sensor detection (a) IR sensor when no object is detected and here IR=0 (b) IR sensor when
object is detected and here IR=1.
| DOI:10.15680/IJIRSET.2022.1104111 |
(a) (b)
Figure.4 Temperature detection and working of fan (a)working of the DTH11 sensor whenever we place a object with
high temperature near to it.(b) Operation of Fan due to the rise in the Temperature above 33ﹾC.
(a) (b)
The Figure .5 showsOperation of Light and Ventilation based on sensor values (a) Light turning ON due to low light
intensity (b)Ventilation ON due to detection of gas/smoke
(a) (b)
(c) (d)
Figure .6 Output for interfacing sensors with Raspberry pi(a)Output for interfacing IR sensor with Raspberry pi
(b)Output for interfacing LDR sensor with Raspberry pi (c) Output for interfacing Gas sensor with Raspberry pi (d)
Output for interfacing Temperature sensor with Raspberry pi
| DOI:10.15680/IJIRSET.2022.1104111 |
V. CONCLUSION
Our project mainly focused on reducing the usage of energy and making the building to work automatically. The
significant part of making a building smart is that we can reduce the overheads and rectify a problem so that it doesn’t
occur again. It becomes tedious to resolve the issues that are repetitive and this can save human labour and also
guesswork can be avoided. Sensors are necessary to monitor every system and collect data. This data help us to
decision of allocation of resources and energy lost in every room In this paper, we have created a SB model using
machine learning and IOT.
APPENDIX-A
MAIN CODE:
#Libraries importing
import pandas as pd
fromsklearn.model_selection import train_test_split
fromsklearn.linear_model import LogisticRegression
importRPi.GPIO as GPIO
importAdafruit_DHT
import time
#sensor pin configuration
DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 4
pin_to_circuit = 3
gas = 27
ir = 17
lamp = 23
fan_output = 15
ventilator_output = 18
#Pin mode setting
GPIO.setmode(GPIO.BCM)
GPIO.setup(gas, GPIO.IN)
GPIO.setup(ir , GPIO.IN)
GPIO.setup(lamp , GPIO.OUT)
GPIO.setup(fan_output , GPIO.OUT)
GPIO.setup(ventilator_output , GPIO.OUT)
GPIO.output(lamp , GPIO.LOW)
GPIO.output(fan_output , GPIO.LOW)
GPIO.output(ventilator_output , GPIO.LOW)
#function defining for ldr sensor
defrc_time (pin_to_circuit):
count = 0
#Output on the pin for
GPIO.setup(pin_to_circuit, GPIO.OUT)
GPIO.output(pin_to_circuit, GPIO.LOW)
time.sleep(0.1)
#Change the pin back to input
GPIO.setup(pin_to_circuit, GPIO.IN)
#Count until the pin goes high
while (GPIO.input(pin_to_circuit) == GPIO.LOW):
count += 1
return count
while True:
#Light controlling
| DOI:10.15680/IJIRSET.2022.1104111 |
k = GPIO.input(ir)
p = rc_time(pin_to_circuit)
if(k == 0):
person1 = 1
else:
person1 = 0
if p < 330:
print("IR:",person1," LDR:",p)
data_L=pd.read_csv('sensor_data_light_test.csv')
X_Temp=data_L.drop(['LIGHT'],axis=1)
X_L=X_Temp
Y_L=data_L['LIGHT']
X_train,X_test,Y_train,Y_test=train_test_split(X_L,Y_L,test_size=0.3)
model=LogisticRegression()
model.fit(X_train,Y_train)
pred=model.predict(X_test)
testing=model.predict([[person1,p]])
print(testing)
if testing == 0:
print("Lights OFF")
GPIO.output(lamp , GPIO.LOW)
else:
print("Lights ON")
GPIO.output(lamp , GPIO.HIGH)
#Fan controlling
k = GPIO.input(ir)
print(k)
if(k == 0):
person2 = 1
else:
person2 = 0
humidity, temperature = Adafruit_DHT.read(DHT_SENSOR, DHT_PIN)
if humidity is not None and temperature is not None:
print("Temp={0:0.1f}C Humidity={1:0.1f}%".format(temperature, humidity))
if type(temperature) ==float:
data_F=pd.read_csv('sensor_data_fan.csv')
X_Temp=data_F.drop(['FAN'],axis=1)
X_F=X_Temp
Y_F=data_F['FAN']
X_train,X_test,Y_train,Y_test=train_test_split(X_F,Y_F,test_size=0.3)
model=LogisticRegression()
model.fit(X_train,Y_train)
pred=model.predict(X_test)
testing=model.predict([[person2,temperature]])
print(testing)
if testing == 0:
print("Fan OFF")
GPIO.output(ventilator_output , GPIO.LOW)
else:
print("Fan ON")
GPIO.output(ventilator_output , GPIO.HIGH)
#Ventilator controlling
k = GPIO.input(ir)
if(k == 0):
person3 = 1
else:
1. Кобилов, А. У., & Джурабоев, А. М. (2020). Технологии компьютерного дистанционного обучения. Academic Research in
Educational Sciences, 1 (3), 287-293.
2. Кобилов А. У., Ольховская, И. В. (2021). Инновации–форма управленческой деятельности государства и организаций. Экономика
и бизнес теория и практика, 1(1), 173-178.
3. Зияев, Т. М., Ўринович, Қ. А., Ёқуб, Д. Т. (2019). Қулай инвестицион муҳит ва фаол инвестицион сиёсат–барқарор иқтисодий
ўсиш омили. Экономика и финансы (Узбекистан), 2(10), 555-559.
4. Kobilov, A. U., Khashimova, D. P., Mannanova, S. G., Abdulakhatov, M. M. O. (2022). Modern Content and Concept of Digital
Economy. International Journal of Multicultural and Multireligious Understanding, 9(2), 375-378.
5. Kobilov, A. (2021). The concept of digital economy, its features and prospects. Архив научных исследований, 2(1), 42-48.
6. Akhmedov, B. A. (2022). Analysis of the Reliability of the Test form of Knowledge Control in Cluster Education. Psychology and
Education, 59(2), 403-418.
7. Муратов, К. (2021). Анализ сложноподчиненных предложений при изучении синтаксиса. Academic research in educational
sciences, 2(4), 1371-1378.
8. Муратов, К. К. (2020). Методика преподавания темы «словообразование» учащимся групп с узбекским языком обучения. Science
and Education, 1(Special Issue 2).
9. Курбанович, М. К. (2020). Инновационная деятельность как обязательный компонент личной педагогической системы
преподавателя. Суз санъати,(3), 219-225.
10. Муратов, К. (2021). Основы традиций и инноваций в образовательном процессе. Экономика и социум, 11(90), 974-978.
11. Dilrabo Saydakhmetova. (2020). Teaching Russian as a Foreign Language Through Stories. European Journal of Research and Reflection
in Educational Sciences, 8(5), 75-78
12. Сайдахметова, Д. Х. (2020). Международные оценочные программы (PISA, TIMSS, PIRLS) и подготовка учеников к ним. Science
and Education, 1(Special Issue 2), 112-120.
13. Сайдахметова, Х. Д. (2021). Качества обучения в системе вузовского образования. Academic research in educational sciences, 2(1),
1148-1152.
14. Khasanovna, S. D. (2021). Education of feelings with artistic words. International Engineering Journal for Research & Development, 6(4),
234-238.
15. Сайдахметова, Д. Х. (2020). Цифровая технология. Academic Research in Educational Sciences, 1(4), 85-90.
16. Сайдахметова, Д. Х. (2021). Роль заимствований в межкультурной коммуникации. Academic research in educational sciences, 2(4),
864-868.
17. Сайдахметова, Д. Х. (2022). Место и роль перевода в современной жизни. Ижтимоий фанларда инновация онлайн илмий
журнали, 2(4), 96-99.
18. Saidakhmetova, D. K. (2022). International Organization (IEA). International Journal of Innovative Research in Science Engineering and
Technology, 11(2), 1599-1602.
19. Saidakhmetova, D. K. (2022). The Concept of the Development of Modern Translation the Place and Role of Translation in Modern Life.
International Journal Of Multidisciplinary Research In Science Engineering and Technology, 5(3), 455-456.
20. Khasanovna, S. D. (2021). Semantic features of Russian borrowings in the modern uzbek literary language. Emergent Journal of
Educational Discoveries and Lifelong Learning (EJEDL), 2(05), 35-38.
21. Сайдахметова, Д. Х. (2021). Роль перевода в современной жизни. Экономика и социум, 3-2, 298-300.
22. Сайдахметова, Д. Х. (2020). Концепция развития современного переводоведения, место и роль перевода в современной жизни.
НАЗАРИЯ АМАЛИЁТ ИННОВАЦИЯ, 1(27), 90-93.
23. Сайдахметова, Д. Х. (2020). Художественный текст как единица обучения чтению. Преподавание языка и литературы, 4(8), 80-87.
24. Сайдахметова, Д. Х. (2020). Повышение эффективности качества высшего образования: проблемы и решения. ИННОВАЦИЯ ВА
ИСТИҚБОЛЛАР, 3(9), 29-31.
25. Саиджалилова, Д. Д., Уразова, Ш. Б., Мирзаева, Д. Б. (2021). Анализ генетического полиморфизма генов у женщин с
невынашиванием беременности при экстракорпоральном оплодотворении. Клиник ва назарий тиббиёт, 1(6), 104-105.
26. Акпербекова, И. С., Аюпова, Ф. М., Саиджалилова, Д. Д., Саттарова, К. А., Миродилова, Ф. Б. (2020). Роль и значение маточных
естественных киллеров в течении здоровой беременности (обзор литературы). Problemy Reproduktsii, 26(6), 15-25.
27. Бобоев, К. Т., Саиджалилова, Д. Д., Ходжаева, Д. Н., Мирзаева, Д. Б. (2020). Роль полиморфизма тромбофилических генов
гемостаза в невынашивании беременности при экстракорпоральном оплодотворении (эко). Новости дерматовенерологии и
репродуктивного здоровья, 1(2), 61-63.
28. Ayupova, F. M., Saidjalilova, D. D., Muminova, Z. A., Hodjaeva, D. N. (2020). The nature of distribution of fetal extracellular dna during
physiological pregnancy. Central Asian Journal of Medicine, 2(1), 20-28.
29. Ayupova, F., Mirzaeva, D., Saidjalilova, D. (2019). EP1062 Hyperplastic processes in hormone-dependent organs in women after IVF.
International Journal of Gynecologic Cancer, 29(Suppl 4), 559-560.
30. Ayupova, F., Mirzaeva, D., Saidjalilova, D. (2019). EP664 The effectiveness of the procedure of IVF in patients with uterine myoma.
International Journal of Gynecologic Cancer, 29(Suppl 4), 385-386.
31. Рахимов, Р. А., Муминова, З. А., Саиджалилова, Д. Д. (2019). Спектр респираторных вирусов, обусловивших тяжелое течение
острой респираторной инфекции у беременных. Журнал теоретической и клинической медицины, 1(1), 113-117.
32. Саиджалилова, Д. Д., Мирзаева, Д. Б. (2019). Изучение роли генетического исследования системы гемостаза в эффективности
экстракорпорального оплодотворения. Медицинские новости, 7(298), 60-62.
33. Ayupova, F. M., Saidjalilova, D. D., Muminova, Z. A., Hodjaeva, D. N. (2019). The Interdependence of Fetal and Maternal Extracellular
DNA in Pregnant Women with Fetal Malformations. Central Asian Journal of Medicine, 2019(3), 45-50.