• Nie Znaleziono Wyników

A TEACHING STAND FOR CONTROLLING BUILDING AUTOMATION WITH RASPBERRY PI

N/A
N/A
Protected

Academic year: 2021

Share "A TEACHING STAND FOR CONTROLLING BUILDING AUTOMATION WITH RASPBERRY PI"

Copied!
8
0
0

Pełen tekst

(1)

No 105 Electrical Engineering 2020 DOI 10.21008/j.1897-0737.2020.105.0003

___________________________________________________

* Lublin University of Technology

Maciej PŁOCHEĆ, Jacek MAJCHER

*

A TEACHING STAND FOR CONTROLLING BUILDING AUTOMATION WITH RASPBERRY PI

Building automation is a rapidly growing branch of electronics in recent years. This is due to the ever wider range of devices available on the market, as well as their decreasing prices. In addition to systems dedicated to the control of intelligent buildings such as KNX or LCN, new manufacturers are increasingly emerging to offer interesting solutions at an affordable price. As a rule, these devices are based on existing solutions, and individual manufacturers add new elements in hardware or software form. This paper presents a pro- ject of building automation controlled by Raspberry Pi. This microcomputer controls in- dividual installations to provide functionality similar to that offered by dedicated systems.

KEYWORDS: building automation, Raspberry Pi.

1. INTRODUCTION

The development of electronic devices at the turn of the twenty-first century has contributed to the use of electronic components in ever newer areas of life.

Nowadays, having phones with access to the Internet is everyday life. These de- vices have long since ceased to fulfil their original role of communicating with others, but are becoming management centres from entertainment to bank account management. This trend is observed by the manufacturers of building automation, who have extensive building management systems in their offer, so-called intelli- gent buildings.

There are many manufacturers of such systems on the European market. The systems are offered by such electronics industry tycoons as ABB or Hager, and by manufacturers operating on local markets [2, 4, 8].

Building automation systems can be divided into open systems (e.g. KNX) and closed systems (e.g. LCN). The difference between these two types of systems lies in the fact that in the case of the former, data transmission parameters or tele- gram construction are widely available. This means that it is possible to create a new module that is compatible with the whole system. In addition, if this module passes the certification process via KNX, the manufacturer will be able to place the system logo on the device [5, 9]. In the case of closed systems, only the man- ufacturer knows the parameters of signal transmission, which makes the creation

(2)

of a new module by other people much more difficult. This condition causes dif- ficulties in system development and in practice limits the user to devices from only one manufacturer.

More and more often there are also proposals to control the operation of build- ing automation by means of a PLC. Such a solution also forces the use of the controller and programming application of a given manufacturer [6, 7].

The aim of this work is to design and make a teaching stand to control individual installations in the building using a Raspberry Pi microcomputer. The simulated installations are to reflect the actual conditions occurring in a given building.

2. RASPBERRY PI MICROCOMPUTER

Raspberry Pi is a small computer that is placed on a single PCB. It was created by the Raspberry Pi Foundation and was initially designed for people who want to learn programming. The first model was created in 2012 and was equipped with a Broadcom BCM2835 chip. Currently this device is the heart of many projects, it is also used in both industrial and building automation systems [14]. Figure 1 shows the Raspberry Pi microcomputer in version 3B.

Fig. 1: Raspberry Pi version 3B microcomputer [12]

This model is equipped with a Broadcom BCM2837 chip, whose built-in pro- cessor enables operation with clock frequency equal to 1.2 GHz. This board has a built-in Wi-Fi standard allowing wireless connection with the network [1, 3].

The Raspberry Pi microcomputer is mainly operated on the Linux operating sys- tem. Due to its popularity, there are several other distributions dedicated to this de- vice, such as NOOBS, designed for beginners, or Raspbian for more advanced users (Figure 2). Linux has an open source code, so it is possible to modify the system kernel, which gives full control over the system. It is also possible to run other Linux distributions, such as Ubuntu or even install Windows 10 [10].

(3)

Fig. 2. Raspbian start desk [13]

3. DOMOTICZ SYSTEM

Domoticz software was used to control the operation of building automation.

This software is open source and is based on the GNU public license. The Domot- icz system was publicly available in 2012. This software can be run both on Linux and Windows and OS X[11,13].

The system itself was written in the C++ language. The interface is displayed using a web browser after entering the assigned IP address, adding a set port num- ber at the end, usually "8080". This interface is fully responsive. This means that the panel adjusts visually, depending on the device on which it is displayed [13].

The appearance of the user panel immediately after installation is shown in Figure 3.

Fig. 3. User panel in the Domoticz system

(4)

This panel is equipped with several tabs:

Desktop,

Switches,

Scenes,

Temperature,

Weather,

Usables,

Configuration.

The "Desktop" tab shows any indicators the user has added as favourites. This allows to configure the system in such a way as to focus on the most important elements one wants to operate.

The "Switches" tab subsumes buttons configured to start or stop certain elements.

For example, there are virtual buttons that support specific programs located in the computer's memory or support the functions of devices with their own LAN address.

The "Scenes" tab is dedicated to operate several elements with one button or after a specific event has occurred. For example, with the use of one virtual button we can switch on the light in the living room and close the shutters. The same effect after the appropriate configuration can be called up, for example, after dusk.

In the "Temperature" tab, all elements from the group of temperature sensors are displayed, including even a temperature sensor placed on the microcomputer board. This interface also stores all data in the form of temperature values, and on their basis generates daily, monthly or even annual charts allowing for easy anal- ysis of temperature from a given sensor measured over a certain period of time (Figure 4 ).

Fig. 4. Daily diagram generated by Domoticz system

The "Weather" tab contains data from weather sensors that measure, for exam- ple, values such as wind speed, pressure, UV radiation and rainfall. These data can come both from physical sensors added to the system and from virtual sources with data about our region.

(5)

The "Usable" tab displays mainly data coming from the Raspberry Pi micro- computer, to which the system is dedicated. These data relate to the percentage of consumption of the processor, memory or even disk, which is most often a mi- croSD card.

The tab called "Configuration" is very extensive. It makes it possible to add devices, configure hardware, add users, change location settings and many other options. In this tab there are also buttons allowing remote restarting of the whole microcomputer or switching it off completely. It is also possible to add a tab called

"Room plan", which enables placing selected buttons and sensors on the plan of a given room or building in the form of a picture and presenting their functions in a graphic way.

The Domoticz system permits cooperation with devices of many leading man- ufacturers of electronic devices such as: Xiaomi, Logitech, Fibaro or Philips.

These devices are added via the "Equipment" tab located in the main "Configura- tion" tab. It is also possible to work with some of the elements using the Z-Wave protocol and devices using wireless Wi-Fi or those connected directly to the LAN.

Some of them need an external controller to operate, as is the case with devices using the Z-Wave protocol. These controllers are mostly cheap and are available from a wide range of locations. The system allows easy configuration of devices that connect using protocols supported by the board. With a few clicks it is possi- ble to add to the panel sensors using 1-wire protocol or extensions of outputs com- municating via I2C interface.

In Domoticz software it is possible to create scripts in several languages, e.g.

Python, Lua or dzVents. For users who do not know high level programming lan- guages, the "Blockly" tool is convenient. Writing scripts with this tool comes down to dragging appropriate blocks from the left panel. Figure 5 shows a simple script created with this tool, which allows simultaneous control of the roller shut- ter and the light in the room after a certain time of day, in this case at sunset.

Fig. 5. Example of a script made with the "Blockly" tool

4. CONSTRUCTION OF THE SITE

The basic design assumption was to create a laboratory stand simulating the work and operation of the system designed for house management based on the

(6)

Raspberry Pi microcomputer and the "Domoticz" software. The completed labo- ratory stand is shown in Figure 6.

Fig. 6: Teaching stand using Raspberry Pi

Diodes are controlled in 2 ways. One of them is the use of unipolar connectors placed on the stand. These are connected to successive inputs of the expander with pull-up resistors. Switching the connectors on or off causes a change of voltage value on one of the pins. This information is given from the expander via the I2C bus to the Raspberry Pi microcomputer, which performs the appropriate operation according to the written program. The program checks the logical state of the ex- pander input and the current position of the switch stored in the logical variable.

The use of this variable is required due to the use of single-pole switches in the stand and the possibility of controlling the stand from the application level. If one of the circuits is switched on by the browser, the program must change the func- tions of both positions of the switch so that this time the switch which is on dis- connects the circuit and the one which is off turns it on. In this way the operation of all circuits placed in the model is realised.

In addition to lighting control, the model also simulates an access control cir- cuit by using a two-colour LED, loudspeaker and bell switch. When the bell switch is pressed, the diode changes colour from red to green and a sound of one and a half seconds is produced from the loudspeaker. After this time, the LED changes back to red. This action is intended to simulate the opening of a gate or front door for one and a half seconds.

In addition to the control ability via single-pole switches on the front panel, the stand also has the ability to control via the Internet. For this purpose, from the

(7)

level of a browser opened on any device with Internet access, one must enter the IP address of the device and its port, which was previously assigned to it. The browser will display the configured user panel shown in Figure 7.

Fig. 7. Control of the stand from the level of the Domoticz application

The user panel also allows the reading of parameters from a sensor placed on the stand. The controls inside the electrical box have been designed to connect 10 temperature sensors that can be connected seamlessly via a 1-wire interface. The most popular sensor operated by means of this interface is the DS18B20 digital sensor and it has been placed on the stand.

In the "Switches" tab there is also a configured button allowing control of a roller blind placed on the stand. Roller blind control is also possible through a roller blind switch located on the stand. The program permitting control from the browser level is fully compatible with the roller shutter switch. This means that if the roller blind is started in any direction from the browser level, it is pos- sible to stop it after pressing one of the two buttons of the roller blind switch.

5. SUMMARY

The Raspberry Pi microcomputer can be used as a monitoring unit for individ- ual installations in the building. The didactic model shown simulates the operation of the lighting circuit and roller shutter control. The system can be extended with further installations, such as HVAC control or access control.

An unquestionable advantage of the presented solution is the possibility of re- mote control of the system’s operation. It is possible not only to generate enforc- ing signals, but also to read the operating status of the system.

(8)

The model in question has full functionality provided by professional building automation systems. The cost of installing the system using Raspberry Pi is sev- eral times lower than in the case of ready-made solutions.

LITERATURE

[1] Agrawal N., Singhal S., Smart drip irrigation system using raspberry pi and arduino.

In International Conference on Computing, Communication & Automation (pp. 928- 932). IEEE, 2015

[2] Gunge V.S., Yalagi P.S., Smart home automation: a literature review. International Journal of Computer Applications, 975, 8887. 2016

[3] Hadwan H.H., Reddy Y.P., Smart home control by using raspberry pi and arduino uno. Int. J. Adv. Res. Comput. Commun. Eng, 5(4), 283-288, 2016.

[4] Horyński M., Majcher J.: Wykorzystanie systemu otwartego do kontroli mikrokli- matu w pomieszczeniach gospodarczych. Inżynieria Rolnicza 7(125)/2010. s. 67-73, (in Polish).

[5] Horyński M., Majcher J.: Zdalny nadzór nad inteligentnym budynkiem. Poznan Uni- versity of Technology Academic Journals. Electrical Engineering - 2014, nr 79, s.

181-188, (in Polish).

[6] Hulewicz A., Krawiecki Z., Dziarski K., Distributed control system DCS using a PLC controller. In ITM Web of Conferences (Vol. 28, p. 01041). EDP Sciences, 2019.

[7] Jędrychowski R., PLC-based survellance system for electrical installations in build- ings .Computer Applications in Electrical Engineering.- 2014, vol. 12, s. 196-205 [8] Majcher J., Automatyka budynkowa: modny gadżet czy podstawowy element infra-

struktury technicznej budynku. Poznan University of Technology Academic Jour- nals. Electrical Engineering - 2016, nr 87, s. 37-46, (in Polish).

[9] Majcher J.: Koncepcja sterowania urządzeniami elektrycznymi w przydomowym ogrodzie za pomocą inteligentnych instalacji. MOTROL. Motoryzacja I Energetyka Rolnictwa - 2014, nr 1, vol. 16, s. 73-76, (in Polish).

[10] Monk S., Raspberry Pi Przewodnik dla programistów Pythona. Wydawnictwo He- lion, 2014. (in Polish).

[11] Rao P.B., Uma S.K., Raspberry Pi home automation with wireless sensors using smart phone. International Journal of Computer Science and Mobile Computing, 4(5), 797-803. 2015.

[12] Richardson M., Shawn P. Wallace. Getting Started with Raspberry Pi, Third Edition.

Maker Media Inc, 2016.

[13] Sałuch M., Tokarski D., Grudniewski T., Chodyka M., Nitychoruk J., Woliński P., Adamczewski G., Raspberry PI 3B+ microcomputer as a central control unit in intel- ligent building automation management systems. In MATEC Web of Conferences (Vol. 196, p. 04032). EDP Sciences, 2018.

[14] Upton E, Halfacree G., Raspberry Pi Przewodnik użytkownika. Wydawnictwo He- lion, 2013.

(Received: 13.02.2020, revised: 09.03.2020)

Cytaty

Powiązane dokumenty

Rozpoznawanie cyfr napisanych odręcznie przy użyciu biblioteki

Instalowanie i testowanie GPIO w języku

Głównym celem niniejszego opracowania jest określenie funkcjonalności komputera Raspberry Pi 3B w teście penetracyjnym prowadzonym w ramach audytu

Dostrzega związek pomiędzy posiadaną wiedzą a możliwościami rozwiązywania problemów, potrafi podać kilkanaście przykładów.. Bejgier W., Ochrona osób i mienia,

Brzęczyk znajduje się po prawej stronie płytki Joy-Pi i można go łatwo rozpoznać po głośnym dźwięku, który wydaje po aktywacji!. Kiedy używasz Raspberry Pi po raz

Student definiuje wszystkie wymagane ogólne zasady prawa unijnego dotyczące stosowania prawa UE przez organy administracji publicznej, ale nie potrafi ocenić.. konsekwencji

Mając jednak na uwadze dość szeroki zakres tego pojęcia, wielu pedagogów i psychologów badających związki kultury szkoły z procesami i zachowaniami uczniów i

LoRa GPS HAT (Rysunek 5) jest to moduł rozszerzają- cy Raspberry Pi o moduł GPS oraz moduł radiowy dalekiego zasię- gu (LoRa ang. Long Range) działającym