9
REMOTE LAB FOR KNX BUILDING AUTOMATION SYSTEMS P. Marín, A. Brunete, R. Cedazo, L. Dávila Universidad Politécnica de Madrid (SPAIN) Departamento de Ingeniería Eléctrica, Electrónica, Automática y Física Aplicada [email protected], [email protected], [email protected], [email protected] Abstract A proposal for a remote laboratory for KNX-based building automation systems is presented in this paper. This remote lab allows students to remotely work with a real physical KNX demonstrator composed by several devices (i.e. lights, shutters, movements detectors, temperature sensors, etc.). Students will be able to program the installation to provide different services (climate control, presence detection applied to light control, energy efficiency, etc.). The novelty of this system is the development of an external system (based on Arduino) to operate the KNX installation as a person does in situ. This external system allows students to validate their applications from home. The paper presents the physical assembly of the demonstrator, the ETS design, and the software development of a control and display application in Java and Arduino languages. Keywords: Remote Labs, Building Automation, KNX 1 INTRODUCTION In the last decades, society has been overwhelmed by the progress of technologies that are already part of the daily life. Since the arrival of Internet, ICT (Information and Communication Technologies) has incredibly fast evolved. One example of this is the home and building automation sector, which has the objective of being able to control houses, buildings or even entire cities, in a comfortable and efficient way for the user. Today, even great titans in the technology market such as Apple (HomeKit) or Google (Thread) strive to develop their own building automation ecosystems. Universities have played and still play an important role in ICT education. For a good learning, these technologies have to be taught in laboratories that unfortunately have limited places, and some students cannot physically attend them. But nowadays, it is possible to improve these labs and make them remotely accessible, so students can remotely use them 24 hours a day. This paper presents the design and construction of a remote laboratory for KNX-based building automation systems. KNX is one of the most used technologies in building automation systems. The objective of this laboratory is to create a versatile remote space that provides a deep learning of building automation systems and KNX technology. It allows students to improve their learning about KNX, thanks to the fact that any design they are able to create becomes tangible and gets physical results. The remote lab allows students to work with a real physical KNX demonstrator composed by lights, heating, shutters, open/close detection, movements detection, temperature sensors, water leaks and smoke detection, and consumption monitoring. Students will be able to provide several services like climate control, presence detection applied to light control, energy efficiency, etc. The novelty of this system is that we have developed an external system to operate the KNX installation as a person would manually do. This external system allows students to validate their applications from home, watching through a video camera how the system behaves. There is a clear tendency in education for remote laboratories. This remote laboratory becomes part of a more ambitious project: a virtual lab, which integrates other remote and virtual labs. The objective of this project is to obtain a useful tool for learning about building automation and KNX. This main aim generates other secondary aims. One is the physical construction of the lab, which means the assembly of the different devices forming the demonstrator. Another aim is the development of an application with a graphical interface able to control and display the elements of the installation, and remotely interact with them. An important issue to have into account is the requirement of making the lab a versatile tool that allows the user to create and maximize their learning.

Article_v3

Embed Size (px)

Citation preview

Page 1: Article_v3

REMOTE LAB FOR KNX BUILDING AUTOMATION SYSTEMS

P. Marín, A. Brunete, R. Cedazo, L. Dávila Universidad Politécnica de Madrid (SPAIN)

Departamento de Ingeniería Eléctrica, Electrónica, Automática y Física Aplicada [email protected], [email protected],

[email protected], [email protected]

Abstract A proposal for a remote laboratory for KNX-based building automation systems is presented in this paper. This remote lab allows students to remotely work with a real physical KNX demonstrator composed by several devices (i.e. lights, shutters, movements detectors, temperature sensors, etc.). Students will be able to program the installation to provide different services (climate control, presence detection applied to light control, energy efficiency, etc.). The novelty of this system is the development of an external system (based on Arduino) to operate the KNX installation as a person does in situ. This external system allows students to validate their applications from home. The paper presents the physical assembly of the demonstrator, the ETS design, and the software development of a control and display application in Java and Arduino languages.

Keywords: Remote Labs, Building Automation, KNX

1 INTRODUCTION In the last decades, society has been overwhelmed by the progress of technologies that are already part of the daily life. Since the arrival of Internet, ICT (Information and Communication Technologies) has incredibly fast evolved. One example of this is the home and building automation sector, which has the objective of being able to control houses, buildings or even entire cities, in a comfortable and efficient way for the user. Today, even great titans in the technology market such as Apple (HomeKit) or Google (Thread) strive to develop their own building automation ecosystems.

Universities have played and still play an important role in ICT education. For a good learning, these technologies have to be taught in laboratories that unfortunately have limited places, and some students cannot physically attend them. But nowadays, it is possible to improve these labs and make them remotely accessible, so students can remotely use them 24 hours a day.

This paper presents the design and construction of a remote laboratory for KNX-based building automation systems. KNX is one of the most used technologies in building automation systems. The objective of this laboratory is to create a versatile remote space that provides a deep learning of building automation systems and KNX technology. It allows students to improve their learning about KNX, thanks to the fact that any design they are able to create becomes tangible and gets physical results. The remote lab allows students to work with a real physical KNX demonstrator composed by lights, heating, shutters, open/close detection, movements detection, temperature sensors, water leaks and smoke detection, and consumption monitoring. Students will be able to provide several services like climate control, presence detection applied to light control, energy efficiency, etc.

The novelty of this system is that we have developed an external system to operate the KNX installation as a person would manually do. This external system allows students to validate their applications from home, watching through a video camera how the system behaves.

There is a clear tendency in education for remote laboratories. This remote laboratory becomes part of a more ambitious project: a virtual lab, which integrates other remote and virtual labs. The objective of this project is to obtain a useful tool for learning about building automation and KNX. This main aim generates other secondary aims. One is the physical construction of the lab, which means the assembly of the different devices forming the demonstrator. Another aim is the development of an application with a graphical interface able to control and display the elements of the installation, and remotely interact with them. An important issue to have into account is the requirement of making the lab a versatile tool that allows the user to create and maximize their learning.

Page 2: Article_v3

The paper is structured as follows. In Section 2, the state of the art on remote labs and KNX labs is summarized. In Section 3 a description of the KNX demonstrator and its components is given. In Section 4 the external system based on Arduino is explained. Section 5 describes the ETS programming whereas the Java application is presented in Section 6. An example of a practical exercise is given in Section 7. Conclusions are drawn in Section 8.

2 RELATED WORK Over the last years a great number of universities have developed their own remote labs to make practises from different subjects. In general, remote laboratories are related to engineering subjects [1], especially the electronics one. There are labs for power electronics, motors control, automation and control systems, robotics, microprocessors or embedded systems. They are possible due to tools such as MatLab, LabView, Java interfaces, PLCs and web servers.

Today lots of universities have web portals to enter their remote lab catalogue. Some of them are well known, for instance Northern Illinois University [2] or Massachusetts Institute of Technology [3]. Universidad Politécnica de Madrid also has its own and the GSITAE (Grupo de Sistemas Telemáticos Aplicados a la Educación) is improving it.

The remote laboratories subject generates a lot of projects carried out by professors, researchers and students. In Spain, a framework prototype for remote labs was designed and developed in 2011 at the Universidad Carlos III de Madrid (UC3M) [4]. Or in 2013, at Universidad de Deusto, a student build a remote lab for testing the Arquimedes principle through a distributed asynchronous architecture [5].

Regarding building automation, universities keep on adding spaces dedicated to their study. In 2009 and 2013, Universidad Politécnica de Cartagena [6] and UC3M [7] respectively, have elaborated lab positions and prototype models based on KNX (without being remotely accessible). In 2014, the Universidad Autónoma de Madrid constructed a remote lab for building automation applications based on ZigBee [8]. As remote lab based on KNX antecedent, in 2013 the University of Salento (Italy) developed its own, controlled by an Android app [9].

As mentioned in the introduction, the novelty of our system the development of an external system to operate the KNX installation as a person would do in situ. This external system allows students to validate their applications from home or any Internet connected device. The external system is based on an Arduino board that controls the installation though servomotors and relays.

3 DESCRIPTION OF THE KNX SYSTEM KNX is a standard for building control. The standard is approved as European Standard CENELC EN 50090 and CEN EN 13321-1, International Standard ISO/IEC 14543-3, Chinese Standard GB/Z 20965 and North American Standard ANSI/ASHRAE 135 [5]. This standard is based upon more than 24 years of experience in the market, amongst others with predecessor systems to KNX: EIB, EHS and BatiBUS. Via the KNX medium to which all bus devices are connected (twisted pair, radio frequency, power line or IP/Ethernet), they are able to exchange information. Bus devices can either be sensors or actuators needed for the control of building management equipment. This technology also uses a software tool, the ETS (Engineering Tool Software) that permits the configuration and programming of the devices of an installation.

The lab is actually a demonstrator, which includes different KNX-type components and others that are not. They are described as follows:

§ Modular enclosure: Contains DIN rails where the KNX devices are placed. § Power supply and coil: Generates the 24V needed to the KNX installation. § Router IP/KNX: Operates as line coupler or backbone coupler. In both cases, LAN acts as

backbone. Besides, the router is used as KNX interface. It is possible to access the bus from any point in LAN.

§ Hybrid actuator ACTinBOX: Multifunction actuator, which combines 4 binary outputs, 6 inputs, a thermostat and a 5-logic-multioperation-function module. In this project the device has been configured in this way:

• Output channel A (no. 1 and no. 2) for shutter control. Motor DC connected in order to move the shutter.

Page 3: Article_v3

• Outputs no. 3 and no. 4 connected to 6V ON/OFF lamps. • Inputs 1-4 are binary and are connected to relays (to simulate buttons). • Input no. 5 connected to temperature probe. • Input no. 6 connected to motion detector.

§ Universal Dimmer: Proportional actuator that regulates halogen lightning. Connected to halogen 50 W lamp.

§ Input device connected to: • Flood leaks detector (Input A). • Open/close detector (Input B). • Relays (Input C and D) (to simulate buttons).

§ Energy economizer KES: Compatible with Single Phase or Three Phases, offers information about consumption thanks to its current probe.

The connections between the devices in the installation are represented in Fig. 1.

Besides, a PCB has been designed to power the flood detector (12v) and the shutter DC motor (6v). It contains voltage regulators (L7806CV and L7812CV), H-Bridge (DRV8833) and connectors.

An image of the actual demonstrator can be seen in Fig 2. Additionally, an IP camera focused on the demonstrator allows students to remotely view the changes in the demonstrator.

4 DESCRIPTION OF THE EXTERNAL SYSTEM Sensors must be triggered to interact with the system. This is usually done by the students directly in the demonstrator in the lab. But this is not possible in a remote lab. For that purpose we have designed an external system to operate the demonstrator.

This external system is composed by a microcontroller that controls relays and motors. The relays simulate the actuation of digital signals (i.e. wall switches), and the servomotor simulates movements to trigger the motion detector and water leaks (moving a metal stick that touches both ends of a water probe). In this case we have used the following components:

Figure 1. Demonstrator connections.

Page 4: Article_v3

(a) (b)

Figure 2. KNX demonstrator (a) and PCB for power and motor control (b).

§ Arduino Mega 2560: Microcontroller with 54 digital i/o pins, 16 analogic input pins, 4 UARTs, a 16 MHz crystal oscillator, USB connection, jack connection, header ICSP and reset button. Its function is to control the relays and the servomotor depending on the information received and later managed.

§ Arduino Ethernet Shield: Board that offers Arduino Mega an IP connection. It can be TCP or UDP and supports up to 4 simultaneous connections by socket. It is connected to Arduino Mega via its SPI port.

§ 8-Relays Module: Each relay is connected to the actuator and the KNX input devices. They enable simulating activity in the inputs of the KNX devices. They work in the same way as buttons would do.

§ Servomotor: Digital servomotor with a torque of 10 Kg. Its function is to trigger with its movement the activation of the motion sensor and the activation of the flood detector (contacting its terminals).

The connections regarding the external system can be viewed in Fig. 3.

5 ETS PROGRAMMING As it was commented before, ETS is a software tool for configuring and programming the KNX devices. It allows creating your own project and designing your installation and programming the devices.

In this remote lab it is given a default ETS project as an example. It is a closed and finished design with physical addresses, group addresses and communication objects defined. This design includes all characteristics potentially controllable and displayable.

Page 5: Article_v3

Table 1. Group addresses in the provided example

Group Address Description 1 Lab 1/1 Illumination 1/2 Climate 1/3 Shutters 1/4 Security 1/5 Scenes 1/6 Power consumption 1/6/1 Energy consumption 1/6/2 Instant power

Figure 3. External system’s connections.

The group addresses are defined as follows: the main group represents the location (in this case, the laboratory), the intermediate group represents the application area that is controlled (lightning, shutters control, etc.), and the subgroup defines the particular action within each application area (Table 1).

The demonstrator is ready to program the following functionalities:

• Lightning control: ON/OFF and dimmer regulation, thanks to the button inputs. Besides, automatic switch on and off of the lights can be done depending on the brightness of the room if there is someone in it.

• Temperature control: it is constantly measured, and the heating is programmed to switch on if the temperature is less than 21ºC (considered comfort value for the thermostat). The actuator uses a PI control method and also controls the switching on with PWM.

• Shutter control: It is possible to raise and lower entirely or by steps the shutter. It is also possible to set a precise position from the application. The shutter is programmed to raise or lower automatically if the scene selected is At home or Out respectively.

• Alarms: an alarm will set off if the flood detector activates or if motion is detected when the scene is Out. The scenes are set with button inputs or remotely with the application. Besides, the energy consumed and the instant power are monitored.

In addition to the example, students can elaborate their own design in ETS. The only restriction is the hardware, because the installation and the connections are fixed. But they can connect any input (buttons) with any output (lights, shutter, etc.). The student can create, design, program and

Page 6: Article_v3

implement their project. They can validate it remotely thanks to the configurable Java application explained in the next section.

The ETS files as well as the main application are available under email request.

6 CONTROL AND MONITORING APPLICATION A Java application has been developed in the Eclipse environment, in order to control and display the different states of the elements in the installation. The graphical interface uses AWT and Swing libraries. It allows:

§ To interact with the lab programmed with the example design. Requires the Router KNX’s IP.

§ To interact with the lab programmed with the user’s design and therefore test it (or the devices), try its functionality and validate it. Requires the Router KNX’s and the Arduino IP and the group addresses needed.

The application establishes a communication with the demonstrator thanks to the Calimero library, which enables the access to KNX systems. It consists of a collection of APIs fundamental for workstation based KNX applications [6].

The communication is possible with the class ProcessCommunicator, an interface that provides communication with KNX networks. It uses high-level interactions based on Java type data and offers writing and reading functions.

Telegram reading is provided by a KNX bus listener. It has a method that is called when detecting a sent telegram. This telegram is a CEMILData, that is, a message with data of the cEMI interface (Common External Message Interface).

Telegram writing is made by the ProcessCommunicator’s method write() that sends information to the bus.

On the other hand, it is possible to trigger tlegrams with the external system. In this case, the application establishes a TCP/IP socket communication with the Arduino board. As it was described in Section 4, the board controls the relays and the servomotor that acts on the inputs of the KNX system, so their activation will trigger the KNX devices.

Regarding the Arduino code, a web server is created thanks to SPI.h and Ethernet.h libraries. After this creation, a client is accepted and the board is prepared to receive commands. These are read, stored and analysed to execute an action. The program is able to distinguish between different orders (short and long push of buttons, activation of motion or flood detector) through an encoding of the messages sent from the Java application.

7 EXAMPLE OF A LAB EXERCISE An example of how to work with the remote lab is given in this section. Before working with the Java application and ETS programming together, it is recommendable to familiarize first with the graphical interface. As it was said before, the example mode of the application is associated to a closed design in ETS. Beginning with the example makes it easier to understand the performance of the application without caring about KNX or ETS.

After operating the example mode, the user is capable of working with their design in ETS. The steps are the following:

§ Create a database. § Add the devices’ catalogues in the database. § Create a new project. § Configure the devices’ parameters. § Create group addresses. § Program the devices.

When everything is prepared, the user can validate their design with the Java application (Fig. 4 and 5). It will be necessary to type the KNX and Arduino IP addresses, but also the group addresses used in their ETS design. There should be one group address for each function (light on/off, shutter up/down, etc.). At this point, the student can work with the application, control the states of the

Page 7: Article_v3

elements in the installation, send commands to the system, trigger artificial detections for the sensors, etc.

Figure 4. Application’s configuration window.

Figure 5. Application’s main window.

Page 8: Article_v3

A good example to work with is the control of the lightning. The student will have to configure the devices to be able to switch it on and off, but also dimmer it. In this particular case, it will be necessary to work with two devices: the actuator or the button interface (because of buttons needed) and the dimmer. Then, in ETS they will have to associate 4 buttons to 4 actions: switch on, switch off, increase brightness, and decrease brightness. It is possible to do it thanks to group addresses relationships between communication objects of the actuator (for instance) and the dimmer. Besides, to control the outputs of the lightning, it will be necessary to create 2 more group addresses: one for the state of the lightning and one for the percentage of brightness.

After programming the devices with this design and configuration, the student will have to type these 2 group addresses mentioned before (in addition to the IP addresses) in the initial window of the application (Fig. 4). Now he or she can interact with the KNX installation from the application, sending commands to Arduino to activate the relays (buttons associated to inputs) and the state of the parameters that will be displayed on the window (Fig. 5).

8 CONCLUSION AND FUTURE WORK In this paper we have presented a prototype for a remote lab for KNX building automation systems. The use of building automation is increasing in the recent years, and universities have to face the need for demonstrators where students can interact with these systems. However, building automation demonstrators are quite expensive because they integrate many sensors, actuators and gateways. The proposed solution is to use a remote lab demonstrator that can be shared by many students along the day.

One of the interesting characteristics of these demonstrators is to interact with the sensors and inputs to produce a result in the outputs and actuators. But this cannot be done remotely. For this reason we have proposed an external system (based on Arduino) that student can use to interact with the building automation system as if they were there.

In the paper we have explained the design of the demonstrator and the external system, and the application to interact with them. The application developed is a versatile tool for any ETS design. An example project has been added to the application, which eases the understanding of the interface. The result obtained is a remote lab for KNX-based building automation systems.

Future work will focus on the evaluation of the performance of the system, the study of the number of students that can use the system at the same time, and the average time that a student needs to be connected to complete the tasks.

A step forward would be to create a network of remote demonstrators. It would enlarge the learning possibilities of the students. Also enlarging the hardware installation with more devices would offer more possible combinations in the designs and increase their complexity. It would be great to scale the project in order to control and interact with bigger installations such as buildings with several floors.

REFERENCES [1] David Borge Díez. “Laboratorio remoto de eficiencia energética integrado en redes de

generación distribuida.” Universidad Nacional de Educación a Distancia (España). Escuela Técnica Superior de Ingeniería Informática. Departamento de Ingeniería Eléctrica, Electrónica y de Control. 2012.

[2] http://www.niu.edu/remotelab/remotelab/index.shtml. Accessed: October, 2015

[3] http://icampus.mit.edu/projects/ilabs/. Accessed: October, 2015

[4] Carlos Antonio Rodríguez Mecha. “Diseño y desarrollo de un prototipo de framework para laboratorios remotos: implementación de las primeras herramientas y funcionalidades.” Universidad Carlos III de Madrid. Departamento de Ingeniería de Sistemas y Automática. 2011.

[5] Gustavo Martín Vela. “Diseño e implementación de laboratorio remoto para la experimentación con el principio de Arquímedes mediante arquitectura asíncrona distribuida.” Universidad de Deusto, Facultad de Ingeniería. 2013.

Page 9: Article_v3

[6] Miguel Ángel Giménez Sánchez. “Diseño de un prototipo para el ensayo de instalaciones domóticas con tecnología EIB/KNX.” Universidad Politécnica de Cartagena, Escuela Técnica Superior de Ingeniería Industrial. 2009.

[7] María Bajo Fernández. “Sistema de control y visualización para una vivienda basado en KNX.” Universidad Carlos III de Madrid. Departamento de Ingeniería de Sistemas y Automática. 2013.

[8] Mario Rodríguez Cerezo. “Sistema de control remoto para aplicaciones domóticas a través de Internet.” Universidad Autónoma de Madrid, Escuela Politécnica Superior. 2014.

[9] G. De Luca et al. “KNX-Based Home Automation Systems for Android Mobile Devices.” SMART 2013 : The Second International Conference on Smart Systems, Devices and Technologies, 2013, pp 20 – 23, ISBN: 978-1-61208-282-0

[10] http://www.knx.org/es/. Accessed: October, 2015

[11] http://calimero.sourceforge.net/. Accessed: October, 2015