Abstract — This paper focuses on the integration of Digital Addressable Lighting Interface (DALI) devices in wireless sensor networks. Since different manufacturers usually deal with one aspect of building automation – e.g. heating ventilation and air conditioning, lighting control, different kinds of alarms, etc. – final building automation system has different subsystems which are finally taken to an integrated building management system. The cost of this process is consequently increased due to additional hardware investment. Our main purpose is to provide the end consumer with an economical fully centralized system in which home appliances are managed by
A building automation (BA) system (BAS) deals with monitoring and control of building services, such as heating, ventilation and air conditioning (HVAC), lighting, alarms, etc. Not only is it the system bound to operate in HVAC appliances and lamps, but HVAC and lighting control can also be obtained by more natural and efficient ways, e.g. starting a motor to open blinds.
BAS were initially developed to control HVAC systems. Through time we have gone through several kinds of controllers, e.g. pneumatics, analog circuits, microprocessors, etc. At the time of its beginning, BA’s purpose was the comfort of end consumers and afterwards (early 1970s), energy efficiency criteria were also considered . Even though other home systems like lighting should also use automation, they are usually installed in a different system than HVAC. This division of the two subsystems increases the end consumer cost due to additional investment in communication hardware and software for integrating HVAC and lighting in a single control point.
As it was previously stated, building services are usually controlled separately, making BA the set of control and communication technologies which link those different subsystems and make them work from a centralized monitoring and control center . The main purpose of having a single control point which provides access to all building services is the costs reduction. A remote monitoring allows the quick detection of failing devices without needing long searches and wasting personal time. This continuous monitoring enables a preventive, or predictive as well, maintenance, which results in a reduction of operational and maintenance costs. Since it is estimated that the operational cost of a building is about seven times the initial investment, taking into consideration the global life-cycle an additional initial cost is worth the effort .
The need of a centralized monitoring control center makes necessary the integration of all BA applications. The number of proprietary solutions has increased since the beginning of BA, but now we have several open standards (BACnet, LonWorks, KNX, DALI, ZigBee…) which make the integration process easier.
Our work focuses on the development of a prototype to be used in a wireless sensor network (WSN) which also integrates DALI protocol. Since DALI is a well-established standard and it has been adopted by major electronic ballasts’ suppliers it is very easy to find DALI compliant devices. Despite it is designed for lighting control, DALI has also been adapted to other applications, such as motor or fan controllers, proximity alarms, etc. . Adapting the standard to a WSN allows integrating DALI devices as a part of the WSN, expanding the traditional DALI bus and removing wires (DALI devices require a dedicated bus for data transmission), which results in a reduction of installation costs. A WSN as part of a home automation system is also known as a wireless home automation network , it allows monitoring and control applications for home end user and energy efficiency.
Section II provides a short review of different standards and protocols (wired and wireless) which are being applied nowadays. Some contributions in this field are also indicated. A description of the implementation of our system can be found in section III. Section III also stated how the system was tested and the significance of tests. Finally, section IV provides a conclusion.
This section contains an overview of actual wired and wireless solutions which are used in BAS. Different standards and protocols have been classified into wired and wireless technologies. This section also references some recent works in the BA field and explains the decision of the use of DALI protocol along with WSNs.
A. Wired Technologies
X-10, which was developed in the 1970s, is considered to be the first home automation standard . The standard uses the power line system to send and receive signals (although not all types of X-10 devices support two -way communication). X-10 sends a 120 KHz carrier to send data over 50/60 Hz power lines. Its main advantage is the low cost of the installation system. Since X-10 devices are power line controlled expensive wire installations are avoided. The main drawbacks are the limited instruction set (e.g. it cannot send a direct dim level), the higher cost of two-way devices and controllers and its susceptibility to noise disturbances.
Nowadays, the main BA fieldbus systems are BACnet, LonWorks and KNX.
The development of BACnet began in 1987 and ended in 1995, when it became an ASHRAE/ANSI standard. BACnet stands for Building Automation and Control networks. It was developed for BAS, in particular for HVAC. In 2003 it was adopted as a standard by the International Organization for Standardization (ISO 16484). It is also an international standard in more than 30 countries, including all EU countries . Different devices of the same BAS can share data between them. Every BACnet device contains virtual objects which control or present the device, e. g. value, schedule, input, output, etc. BACnet includes a set of standard objects, however, manufacturer can add optional properties to this standard objects. This option allows the development of new applications within the standard. Nevertheless, this improvement of the flexibility may result in an incompatibility issue between different manufactures . BACnet is compatible with a wide range of networking standards and supports almost any kind of wire. It is also IP compatible, so BACnet devices can be controlled with standard Web browsers. Main BACnet disadvantages are that it is a very complex protocol and it results expensive in applications with a large number of devices. Control devices are also expensive to implement .
LonWorks consists of several processors called “Neuron chips” which implement the LonTalk communication protocol. Neuron chips are developed by Echelon but LonTalk protocol is available for general-purpose processors. The communication protocol was accepted as an ANSI standard (ANSI/EIA-709) in 1999 and as a European standard (EN 14908) in 2005 . A LonWork network is formed by devices (nodes) which support the LonTalk protocol and can communicate between them and with the central control
system using network variables (NVs). Those NVs define some parameters about the device, in a similar way to BACnet’s objects. LonWorks data can also be displayed in Web browsers. LonWorks disadvantages are the cost, complexity and the incompatibility between manufacturers who design LonWorks-based devices without strictly following the standard .
KNX (Konnex) resulted from the merger of three bus systems, the European Installation Bus (EIB), BatiBUS and European Home System (EHS) in order to create a single European standard . It was adopted as a European Standard (EN 50090) in 2003, and it became an International Standard (ISO/IEC 14543-3) in 2006. It is also a Chinese Standard (GB/Z 20965) and a US Standard (ANSI/ASHRAE 135), . KNX supports twisted-pair, power line, wireless (KNX RF) and IP (KNXnet/IP) communications. A KNX -network usually follows a two-tier model. Field networks keep the communication with sensors, actuators and controller to perform control and monitoring tasks. On the other hand, management nodes are connected to these field networks by a common backbone, having a global view of the entire network . According to KNX surveys, KNX is the most used technology for home and building control. In the literature we can find energy efficiency proposals using KNX  and a wireless integration system designing a KNX-ZigBee gateway .
A comparison of the three main systems can be found in . It states that KNX is the best solution in home automation, whereas the best solution for buildings where a more solid approach is required, e.g. building offices, BACnet is the most flexible solution.
Finally, Digital Addressable Lighting Interface (DALI) standard focuses on a single aspect of BA, lighting control. Section III describes thoroughly the DALI bus implementation. It was originally defined in annex E.4 of IEC 60929-2003 Standard as a digital control for tubular fluorescent lamps. It became an independent standard (IEC 62386) in 2009 and it expanded it application range to high intensity discharge (HID) lamps, LEDs, incandescent lamps, etc. Several manufacturers have developed some DALI-compliant devices including controllers for motors and fans and proximity alarms . We opted to use DALI to implement out system because it is a very simple and easy to build standard, moreover, it allows a two-way communication which provides us with feedbacks about the status of individual DALI devices. The main DALI drawback is the initial separation of lighting control from other BA services. However, there are some proposals in order to integrate the DALI bus with general purpose sensors in order to have a single network for lighting, HVAC, alarms and environmental monitoring .
B. Wireless Technologies
Installation costs can be reduced applying wireless technologies, which reduce the work spent on sensor cabling. Wireless nodes must be able to work for a long period of time
(years) running on batteries. BA does not require high traffic load, so we must consider the energy consumption to the detriment of data-rate. As a consequence, Wi-Fi (IEEE 802.11) and Bluetooth are not suitable for home automation at the field level .
IEEE 802.15.4 deals with low-rate wireless personal area networks; its aim is the standardization of the two lower layers of OSI protocol stack – physical (PHY) and Medium Access Control (MAC) layers. As it does not define the network layer it does not include any routing mechanism, so the only available network topologies are star and peer-to-peer. This last issue becomes a problem in large buildings, where a single point can reach every node due to the presence of obstacles and the coexistence with other wireless network (Wi-Fi, Bluetooth…). Last IEEE 802.15.4 Standard version dates from 2011.
IEEE 802.15.4 PHY and MAC layers are used by the ZigBee Alliance to develop the ZigBee wireless technology, adding the network (NWK) layer and the application (APL) layer. A ZigBee node can have three different roles, coordinator, router or end device. ZigBee NWK layer allows IEEE 802.15.4 networks to form tree and mesh topologies. As for APL profiles regarding BA, there exist the ZigBee Home Automation Application Profile (focusing on lighting, HVAC and security) and the ZigBee Smart Energy Profile (focusing on energy demand response and load management) . Co-existence and interoperability of ZigBee and Wi-Fi (they both work in the 2.4 GHz ISM band) has been studied and tested. A ZigBee home automation system in which ZigBee is implemented in the field level whereas Wi-Fi is used in the management level is shown in . Another work ,  applies ZigBee standard to automatically manage consumer devices, making them part of a self-configured, self-organized sensor network in order to make home automation more comfortable.
IEEE 802.15.4 layers are also used as a base for the transmission of IPv6 packets with the open standard 6LoWPAN (released in 2007). The choice of either 6LoWPAN or ZigBee is decided by the need of IP interoperability and packet size. Since 6LoWPAN performs fragmentation ZigBee can achieve better performance in small packet size applications .
A comparison between the two IEEE 802.15.4-based standards and other wireless technologies (Z-Wave, INSTEON and Wavenis) can be found in .
Our system makes use of IEEE 802.15.4 networks to control DALI devices. We decided to implement an IEEE 802.15.4-based WSN instead of using ZigBee  to work directly over PHY and MAC layer of IEEE 802.15.4. The main ZigBee disadvantage is that it is not an interoperable protocol among different manufacturers. As we needed at least a tree network topology we opted to implement our own network layer working with an IEEE 802.15.4 network. The development of our own ZigBee-based routing mechanism provides us with a proprietary network layer which can be implemented with fully IEEE 802.15.4-compliant devices from several manufacturers, achieving interoperability. Next section describes our system.
SYSTEM COMPONENTS AND METHODS
A. Implementing the DALI WSN Controller
DALI is based upon the master-slave principle; the master sends messages (frames) to any slave device in the system. Those messages contain an address and a command, thus only the addressed ballast will react to the message. A message sent by the master is called a forward frame; it consists of 19 bits at 1200 bps using a bi-phase encoding (Manchester Differential). The first bit is a start bit, the next 8 bits are the slave address and the next 8 are the command. There last two stop bits are not in Manchester code. There are query commands that make the DALI device enter into active mode and send a backward frame to the master, this is an 11 bits frame with the same characteristic than the forward frame, one start bit, 8 bits with the data response (status, actual level, etc.) and two stop bits. In the address byte of the forward frame only six bits are used for individual addressing.
The address byte has the following structure (each letter represents a single bit): YAAAAAAS, where Y takes the value ‘0’ when a short address is used and the value ‘1’ for a group address or broadcast; A is the significant address bit and S is ‘0’ when the command is a direct level command (e.g. a dimming value or a speed rate) or ‘1’ when it is a DALI command. A master can only have 64 slaves as it can only address 64 directions (six A bits).
This last concern can increment DALI installation cost in large buildings, since we need different loops to control more than 64 devices individually.
Our approach consists of implementing a DALI master controller using an IEEE 802.15.4-based WSN. Nodes which compose the WSN have a microcontroller unit (MCU) and an IEEE 802.15.4-compliant transceiver. The DALI communication protocol is implemented in the MCU. In our system we have the DALI devices as slaves and the nodes as masters, controlled by the personal area network PAN coordinator attached to a PC host. The coordinator accesses to any DALI device using the node MAC (8 bytes) or network (2 bytes) address instead of the DALI slave address, enhancing the number of connected devices. With this process we also skip the long DALI address allocation process.
Our first attempt was focuses on street lighting, developing a WSN to control DALI outdoor ballasts . We used an 868 MHz transceiver with a transmission power of +25 dBm. The transceiver was controlled using a commercial Arduino-based development board. Having a long rage and strong RF penetration was a primary issue in street lighting. The system was very easy to develop but the cost was too high and, moreover, we were limited to the board’s manufacturer.
Since DALI devices manufacturers have created more DALI devices expanding the initial only-lighting protocol we decided to take the previous idea to BA in order to achieve a WSN- based centralized control and monitoring for in home and in building lighting system. Future works will integrate this system along with HVAC, security, etc. at minimum cost. The selected wireless module integrates the STMicroelectronics STM32W108 system-on-chip, which integrates a 2.4 GHz, IEEE 802.15.4- compliant transceiver, an ARM Cortex-M3 microprocessor and other peripherals to design 802.15.4-based systems. The module can be ordered with different configuration, such as a power amplifier to achieve a transmission power of +20 dBm, three protocol stacks, ZigBee-Pro, RF for Consumer Electronics (RF4CE) and a proprietary stack which only contains a simple IEEE 802.15.4 PHY and MAC layers. As stated in last paragraph of section II we opted to use the last protocol stack to develop our own system over IEEE 802.15.4. Changing from an 868 MHz to a 2.4 GHz frequency band we made our system to be used worldwide (868 MHz band is only allows in Europe, whereas 2.4 GHz is universally accepted).
A DALI control interface voltage level must consider a voltage between 9.5 V and 22.5 V a high signal, whereas a voltage in the ±6.5 V interval is taken as a low signal. As the microcontroller digital outputs are CMOS (0–3.3 V) it is necessary to design an interface circuit to take the 3.3 V to the corresponding interval of a high signal. Our intention is to make a circuit as small and cheap as possible, so we only use 12 V to supply the DALI ballast control interface, Fig. 1 shows the adapting level circuit (DI1 and DO1 are digital inputs and outputs). and is stored in the PC host memory. This table contains the MAC address of the node and every router that is in the way of the node. Another field of this table is the child number that the node represents for its father. The table stored in any node contains only the MAC addresses of its children in an order given by the coordinator. This way of creating the network allows the coordinator to use a source routing packet transmission, in which the coordinator put in the packet the addresses of the nodes where the message must pass, but instead of the full address we use only the number of the child, so it can be used as an index by the nodes to select the next hop.
The node reacts depending on whether the received message is a DALI message or network message according to the flowchart showed in Fig. 2.
Fig. 1. Bidirectional interface circuit between MCU and DALI.
B. Network Topology
The RF module only supports point-to -point and point-to multipoint communications, so the only network topology allowed is the star configuration.
In a control lighting system is essential that the PAN coordinator could reach to any node, this requirement makes the star topology completely useless, so we needed to modify the network layer only a bit to ensure a tree topology.
The network layer created is very simple, it consists of storing two tables in the coordinator and in any node of the network. The coordinator contains information of any node
Fig. 2. Microcontroller program flowchart
We implemented a graphical user interface (GUI) in order to test the wireless sensor network and control the lighting. The GUI is installed in the computer host where the coordinator is plugged in via USB. The user can send commands to the PAN coordinator using this GUI; allowing the user to switch on and off the lamps, dim and check some lamp parameters like the dimming level, lamp status, control gear or lamp failures, etc. Fig. 3 shows the GUI.
Fig. 3. GUI used for DALI lighting control with WSN
Although it was designed for lighting purposes it does not suppose any effort to use is as a general BAS. In other words, up and down commands or direct levels can be also used for setting a fan speed or a blind position.
System under test included several nodes with or without a DALI ballast connected to them. We used ballast for 70 W HID lamps with DALI control interface.
The system has been tested in laboratories of our facilities. The overall performance shows a good coexistence in such a hostile environment (2.4 GHz ISM band is crowded with Wi-Fi and Bluetooth networks).
The number of DALI devices under control was significantly increased, not only could we have a single DALI device with any sensor node, but a node could also control up more than one ballasts by making use of its MAC or network address and also the DALI short addresses.
A new remote management system for buildings lighting automation has been presented. With the use of wireless sensor networks we could be able to extend DALI initial capacity of 64 devices to a number big enough to be used in real scenarios such as residential areas and large buildings without additional investments in different DALI loop. The control through the PAN coordinator of the wireless sensor network also enables a centralized control system.
The use of DALI devices with wireless sensor network allows a half-duplex communication which can provide many parameters about the lighting and lamp status, this is very useful for saving energy and maintenance purposes, as it can detect any single lamp fault allowing a predictive maintenance and group replacement or schedule power consumptions rules enabling the integration of the lighting system in home and buildings into Smart Grid approaches, since we can monitor and act over them.
The tree network topology implemented over fully IEEE 802.15.4 -compliant modules is able to cover a wide area. Both common frequency bands (868MHz and 2.4GHz) have been implemented and tested. Interoperability is assured implementing the developed NWK layer in other MCUs which control any IEEE 802.15.4 transceiver. The implemented routing mechanism is very robust and supports easy and quick reconfiguration of the network.
Future system development will be focus on the integration of the other BA services in the DALI -WSN system. HVAC and security DALI -compliant solutions can be acquired in the market. Since they are based on IEC 62386 and are controller by normal DALI bus they are also applicable to our system, but we can applied other sensors and actuators in the free ports of the nodes’ MCUs. The use of these low-cost radio devices with their processing units and the integration of different sensors and DALI protocol may result in the single chips solution for BASs commented in .
Future work will include a comparative study between the proposed system and other wired system, focusing on energy
efficiency, Smart Grid capabilities and installation and maintenance costs. We will take also into consideration the higher flexibility of wireless systems against wired systems.
Further implementations will be done in order to extend the proposed system to other standards or technologies of lamps, luminaries or lightning communication and control protocols.
Finally, the application or User Interface may be developed in deep in order to support functionality for Smart Grid at home and buildings, for energy saving and for its integration into a broad Home Automation or Building Automation scenario, pursuing also the improvement of the user experience.
 W. Kastner, G. Neugschwandtner, S. Soucek, and H. M. Newmann, “Communication systems for building automation and control,” Proc. IEEE,
vol. 93, no. 6, pp. 1178-1203, Jun. 2005.
 D. Snoonian, “Smart buildings,” IEEE Spectr., vol. 40, no. 8, pp. 18-23, Aug. 2003.  M. Moeck, “Developments in digital addressable lighting control,” J. Light & Vis. Env., vol. 28, no. 2, pp. 104-106, Aug. 2004.
 C. Gomez, and J. Paradells, “Wireless home automation networks: a survey of architectures and technologies,” IEEE Commum. Mag., vol. 48, no. 6, pp. 92-101, Jun 2010.
 V. Chunduru, N. Subramanian, “Effects on power lines on performance of home control system,” Proc. Int. Conf. on Power Elec., Drives and Energy Systems (PEDES), Dec. 2006.
 Lighting Research Center, Rensselaer Polytechnic Institute, “Reducing barriers to the use of high-efficiency lighting systems,” Feb. 2002.
 M. Aliberti, “Green networking in home and building automation systems through power state switching,” IEEE Trans. Consumer Electron., vol. 57, no. 2, pp. 445-452 May 2011.
 D. Lechner, W. Granzer, and W. Kastner, “Security for KNXnet/IP,”
Konnex Scientific Conf., Nov. 2008.
 W. S. Lee, S. H. Hong, “Implementation of a KNX-ZigBee gateway for home automation,” 13th IEEE Int. Symp. on Consumer Electron. (ISCE), pp. 545-549, May 2009.  F. Ferreira, A. L. Osorio, J. M. F. Calado, and C. S. Pedro, “Building automation interoperability – A review,” 17th Int. Conf. on Systems, Signals and Image Process (IWSSIP), Jun. 2010.  Y. Ma, and D. Wobschall, “A sensor network for buildings based on the DALI bus,” IEEE Sensors Applic. Symp. (SAS), Feb. 2007.
 K. Gill, S. H. Yang, F. Yao, and X. Lu, “A ZigBee-based home automation system,” IEEE Trans. Consumer Electron., vol. 55, no. 2, pp. 422-430, May 2009.
 D. M. Han, and J. H. Lim, “Smart home energy management system using IEEE 802.15.4 and ZigBee,” IEEE Trans. Consumer Electron., vol. 56, no. 3, pp. 1403-1410, Aug. 2010.
 D. M. Han, and J. H. Lim, “Design and implementation of smart home energy management systems based on ZigBee,” IEEE Trans. Consumer Electron., vol. 56, no. 3, pp. 1417-1425, Aug. 2010.
 C. Buratti, A. Conti, D. Dardari, and R. Verdone, “An overview on wireless sensor networks technology and evolution,” Sensors, vol. 9, no. 9, pp. 6869-6896, Sep 2009.
 F. J. Bellido-Outeirino, J. M. Flores-Arias, F. Domingo-Perez, A. Gil-de-Castro and A. Moreno-Munoz, “In-Building Lighting Management System with Wireless Communications”, Proc. International Conference on Consumer Electronics ICCE Las Vegas, January 2012.
 F. Domingo-Perez, A. Gil-de-Castro, J. M. Flores-Arias, F. J. Bellido-Outeirino, and A. Moreno-Munoz, “Low-rate wireless personal area networks applied to street lighting,” Lighting Res. & Techn., prepublished Dec. 14, 2011, DOI: 10.1177/1477153511431129.
 D. Dietrich, D. Bruckner, G. Zucker, and P. Palensky, “Communication and computation in buildings: a short introduction and overview”, IEEE Trans. Ind. Electron., vol. 57, no. 11, pp. 3577-3584, Nov. 2010.