IP Remote Control System for a Lighting Layout 1

System for the Management of an Appliance and an Output of Lighting Using Protocols and IP Convergence”


Introduction
Electrical energy is an important resource, but a large percentage of people misuse it.Excessive energy consumption and carbon dioxide emissions are long-lasting problems that require energy efficiency upgrades [1] without forgetting factors such as population growth, an increasing number of homes, and electro-domestic demand growth, which implies higher energy spending and the probability of shortage.The role of energy efficiency is notably important to decrease demand and expense without sacrificing quality of life [2].
A study by the Unidad de Planeación Minero Energética (UPME) and Bariloche consortium shows that efficient energy for lighting presents economic advantages for residential users [3].Similarly, the Energy National Direction of Uruguay has determined that the residential sector consumes more than 20% of total energy, and lighting represents 5% of the net energy consumption [4].Domestic labor requires energy sources such as electricity, so its rational use is important.The final consumer must become an active agent who can make energy consumption decisions by monitoring the quantity of energy and the price to be paid and providing solid bases to optimize the consumption and minimize economic resources [5].Feedback information makes consumers use energy more efficiently by reducing their electricity demand, and energy savings could reach 3% [6].
This investigation is based on the design and development of a monitoring and control system prototype for lighting output.The embedded devices, protocols and IP convergence enable one to supervise, monitor and control real-time energy consumption with data such as the voltage, current and cost (kWh) over the power line.In addition, the prototype function enables everyone use it without installing any application and optimize the connection because it is made with uses the HTTP protocol.This prototype is an innovative proposal to contribute to domestic energetic efficiency and offers a proper interaction between the user and the technology because the user can easily determine their energy consumption from the "Internet of Things" [7].The Internet of Things allows objects, light bulbs or electric devices to be connected to the internet so that they can be controlled in real time and from any place.
This paper presents a prototype of a monitoring and control system for a residential lighting layout.The design and development process is described; the methodology for device selection, design and construction of the prototype is shown in section three.Section four describes the tests and the obtained results with the corresponding implementation and function of the prototype.Finally, the conclusions of the investigation are outlined.

Background
Worldwide enterprises that produce light bulbs have been attempting to substitute fluorescent, incandescent or LED lights for more efficient light bulbs by integrating them with digital systems joined to sensors and communication networks to determine final user energy consumption [8].There are restrictions, such as the price and lack of knowledge, because there are a limited number of rules and technical type restrictions, such as programming interfaces, to interoperate in a friendly manner with the end user [9].
American GreenWaveReality® Enterprise has presented a system that enables the control of light bulbs in a house using an app available in iOS or Android.This kit consists of a router that can control up to 500 light bulbs through WiFi [10].Another initiative is offered by OZOM [11], which has low-consumption light bulbs that can be individually programmed to be remotely turned on and off through an app using a smartphone or tablet, but this option does not allow for visualizing the consumption, voltage and current values.
Regarding IP light bulb applications, the Dutch manufacturer NXP© commercializes components so that light bulbs can be connected to the internet and have their own IP address, which enables them to receive individual orders [12].Likewise, Phillips© has made an alliance with the Deloitte regional in Amsterdam (Holland) to build a 14-floor building with 6,500 lamps, each with an IP address and movement sensors connected to Ethernet cables [13].

Materials and methods
This section describes the implementation of the monitor and control system prototype from selecting the required devices according to the design, development and construction.IP remote control system for a lighting layout

Device selection
The following main components were established to select the devices: hardware platform, energy meter, current sensor and actuator.The selection method is as follows:

Hardware platform
A hardware platform is required to develop this prototype.The existing platforms in the market were analyzed to establish the most appropriate development system, such as Arduino® Uno, Yun, Leonardo, Due, Mega and Nano, which offer benefits depending on the type of microcontroller, port, memory, etc.According to the demands of the presented prototype, it was determined that the most proper platform was the Arduino Nano® [14], because of its compact size, low cost, 32kB memory and SPI (Serial Peripheral Interface) [15] communication with other devices.
An attachable Ethernet card with Arduino® is necessary to assign the IP prototype address.For this case, the Ethernet Shield card [16] and ENC28J60 card [17] were evaluated.The first is based in an Ethernet Wiznet W5100 chip with a network (IP) that simultaneously supports up to four socket connections to Arduino® [16].The second option has 8Kbytes of transmission/reception of double-port packages and a compact size [18].However, this card only works for simple applications, so it is not recommended to implement in this prototype.Because of its advantages, the Ethernet Shield was selected.

Energy meter
Analog Devices© Enterprise offers a range of IC meters, such as the ADE7751, ADE7755, ADE7763, etc.To achieve the prototype's objective, we decided to use the ADE7763 measuring IC because this digital integrated chip enables the development of an interface with the current sensor, which is not easily done by other meters.It consists of two channels (current and voltage), each with a programmable gain amplifier, digital calibration of voltage and phase, and a serial interface compatible for SPI communication with a tension supply of 5V [19].

Current sensor
The actual market offers different types of sensors for this measure such as "Shunt" Resistance, which enables an accurate and direct current measurement [20]; Current Transformer (TC), which transforms the primary current into a secondary current of lower price [21]; Hall Effect Sensor, which is based on the voltage fall through a conductor [22]; and Rogowski Coil, which consists of a rolled coil in the nucleus of a nonmagnetic material [21].For this application, a Hall Effect Sensor was selected because the objective is to use as little space as possible, which is not possible with the Rogowsky Coil or Current Transformer, and the Shunt Resistance can affect measurements when it heats.
The selected current sensor is located on the ACS714 [23] card because it offers different current measuring ranges, such as ±5, ±20, and ±30 amperes.In addition, it improves the precision detection of the system, works with a 5-V simple source, and has a voltage output proportional to either direct or alternating current.

Actuator
To control (turn on and off) the lighting layout, it is necessary to implement an actuator to control the amplification and conversion signals provided by Ardu-ino®.One of these actuators is an electromechanical relay, which is a distance interrupter that turns into the repose position when the drive force stops acting on it.In addition, it electrically isolates the installation [24].Other types of actuators that can be used include a solid-state relay construction implemented with an opto coupler and a triac dimmer, which is also an alternative for the proposed system.
After analyzing this information, we decided to use an electromechanical relay TQ2-5V because of its simplicity, low cost, nominal 5-V voltage, size and few components.

Power Line Communication (PLC)
This technology can transmit data through the electrical network.Thus, it can be extended to a local area network (LAN) or share an internet connection though electric outlets with the installation of specific units.This signal can be received by any PLC receptor in the same network [25].
Many electricity companies have implemented this type of technology for their communication processes because many suppliers and devices are offered in the market.Delimiting and orienting the search to low-price PLC device communication adapters that provide constant communication with nice data transfer speed show that the best adapter is the "Powerline AV500 Nano" [26], because of its versatility, low cost and high data transfer speed.The transfer speed is sufficient for the prototype, and it provides the possibility of being a Plug and Play [27] system, which makes for easy operation and functioning.

Design
Figure 1 shows the implemented diagram of the prototype, which consists of a component to receive the current and voltage signals, a component to assure their adequacy, an energy meter, the Ethernet Shield, an actuator in the lighting layout using the PLC (power line communication) and the home router, which supplies the network level connectivity to send and receive data packages among the sub networks.Remote access to the lighting from any computer with an internet connection is provided to remotely control the on and off status.It is also important to note that the user monitors the energy consumption, voltage and current in real time from the web application.

Figure1. Prototype design diagram
Source: authors' own elaboration Figure 2 shows the design and adequacy of the voltage and current taps in detail.The design was made according to the test circuit provided by the manufacturer of the energy meter, which had some modifications for the maximum value of voltage to be measured and the type of sensor.Therefore, the resistive dividers were varied.In addition, the SPI connection between the energy meter, the Arduino® and the electromechanical relay connection with the commuter interrupter were varied.It is important to note that the ACS714® circuit adaptation process to be replaced with the current transformer, which is recommended by the ADE7763 manufacturer, was the object of many work hours at the lab to establish component values that enabled its operation with acceptable error margins in measuring the voltage, current and energy.This work minimizes the size of the prototype so that it can be integrated into a smaller, easily adaptable component for each lightning output.

Development
Figure 3 shows the logical process that the prototype develops to take measurements, verify the SPI connection between Arduino® and ADE7763®, assign the IP address, visualize the measured data on the web page and the graphic interphase for the user to control the turning on and off of the lighting layout.
The prototype implementation uses ADE7763 to take measurements and the current sensor ACS714 with the aforementioned software algorithm.The four methods offered by the SPI library of Arduino® must be considered.In mode zero (0), the MOSI (Master Out Slave In) signal begins at a high level, and the clock begins at a low level; additionally, the MOSI is advanced with respect to the clock.In mode one (1), both signals begin at a low level.In mode two (2), both signals begin at a high level.Finally, in mode three (3), the clock signal begins at a high level, and the MOSI signal begins at a low level.Considering the datasheet of ADE7763 [28], which has SPI communication serial times established where the clock must start at a low level and MOSI can start at a high or low level, mode one (1) is selected.The developed algorithm for this prototype establishes the bit order by starting with the most significant bit and assigning mode one (1) to send data.Then, the SPI divisor clock is initialized to act over PIN11, which activates ADE7763.Later, after a 4-microsecond pause in the program, a zero (0) is sent to read the bytes of the 17th register, which has the measured voltage.Finally, PIN11 is activated at high status to deactivate ADE7763 with a 100-millisecond pause in the program.The manufacturer recommends a maximum voltage of 500mV.Thus, a resistive divisor is used for the voltage and current input signals.The developed computational algorithm is shown below.In this last part of the algorithm, the Ethernet Shield's MAC address is located, which is a physical 48-bitaddress that only corresponds to the card of one device.With this unique identification, the wireless network [29] access is registered and filtered.This address has a tag under its plaque to assign an IP address to Arduino® and create a web server with port 80, which is the HTTP port by default.Arduino's® connection with the Ethernet plaque is made through SPI communication, which assigns a different selector from the one used with ADE7763.Then, the Ethernet has an assigned IP address in the network to develop the graphic interface of the page with an "HTTP" protocol, where the voltage, current and energy(kWh) measurements are visualized.The plaque of the Ethernet Shield is connected through an RJ45 cable with a PLC in a home electric network.Likewise, a home router is connected to another PLC to visualize information in the local network.To observe the measured data from any computer connected to the internet outside the local area, the router must connect with a public IP address.To open the used port, another option is to buy a public IP and directly assign it to Arduino®.
Finally, an Arduino® digital "pin" signal output was adequate to activate the relay coil and control prototype.A2N2222 [30]transistor was added so that the current was appropriate for the actuator.

Tests and Results
The tests were developed in the laboratories at District University.First, the voltage and current levels were changed in different time periods with a 53-W saver halogen bulb from Philips®.Table 1 shows the voltage values measured with the network analyzer for the network (PQA824) [31] parameter register and a visible interval in the serial Arduino® monitor.Initially, the monitor indicates dimensionless values.Thus, a linear regression was made by comparing the values obtained from Arduino® and PQA for the calibration.Figure 4 shows the voltage data with a maximum error of 3% at 70V and a minimum error of 1.6% for values higher than 113.3V, which indicates that the error decreases with higher voltage values.Source: authors' own elaboration Figure 5 shows that with higher current levels, the error decreases, and the maximum and minimum errors are 2.3% and 0.9%, respectively.Because the ADE7763 measures energy but not power, it is necessary to measure the energy at the lighting point (53-W halogen bulb) at different hours of the day for calibration.Then, a linear regression is developed.According to the obtained data in Table 3, an errorless measurement is obtained for the measurement equipment of PQA reference.Hence, the prototype is nicely calibrated.

Source: authors' own elaboration
With the lighting point prototype implementation, Figure 6 shows a result of the graphic interface of the webpage, which enables the user to monitor the signals of voltage, current, energy and price.It also provides the possibility of controlling the on and off status in real time through its respective buttons.The prototype is configured with the HTTP protocol, which enables all users to use it without installing any app on his/her cellphone or computer.Thus, it María Alejandra Clavijo Camargo, Nicolás Enrique Herrera Aguilar, Adriana Marcela Vega Escobar, Álvaro Espinel Ortega optimizes communication.In addition, with the power line, there is no barrier that limits the answers of requirements requested by the user from the page.Regarding signal supervision, graphics were selected to visualize the tendencies.The user has three options to graph the voltage, current or energy.As an example, Figure 7 shows the voltage consumption of a lighting output graphic.The user can configure the time range in which he wants to observe the consumption.The storage capability is limited to 5 years, after which this value is overwritten.

Conclusions
The designed prototype with the proposed interphase enables the interaction between the residential user and the web platform to monitor the current, voltage, energy and price.In addition to controlling the operation status of the lighting output, it can change from on to off from a local or external network through the internet.This function offers a great advantage compared with other products in the market, which do not consider economic aspects that sensitize the user to efficiently use energy.Compared to other commercialized systems, such as OZOM® [11], the implemented system does not require signal repeaters for wireless protocols such as Wi-Fi or Zigbee to be implemented because the built prototype properly uses the home electrical installation cabling.
Commercial systems focus all their functionalities in specific applications with proprietary technologies, which prevent the user from obtaining information about the voltage, current and power values through standard protocols such as IP or HTTP, which is a main characteristic of the proposed system.A software application was designed to install in the Arduino® card to establish communications with the data acquisition system.The resulting system is user friendly, and this prototype can be considered part of the "Internet of Things." An important input of the present investigation is the Hall ASC714® effect sensor integration with the ADE7763® meter because it enables one to replace the current transformer to a reduced-size sensor, thus allowing the system to be used in smaller spaces.In future work, we plan to integrate only the fundamental components of each element from the prototype in only one card to consider the probability of placing it inside a typical lighting box with the standard measurements of 100 × 100 × 47 mm without changing the electrical installations.This integration will enable low-cost energy efficiency project development in both domestic and industrial electric installations.
An outstanding characteristic of the implemented prototype is that the measurement system is based on an integrated circuit, which is widely recognized worldwide for the construction of commercial energy meters such as the ADE7763.Thus, this system is trustworthy.For the prototype's current, voltage and energy calibrations, which are indispensable for monitoring, linear regressions were applied after developing rigorous tests at the lab to compare with high-precision instruments.
The prototype's cost may vary from the plaque type used for its construction.In this case, the prototype was implemented in Bakelite with handmade welds.Nevertheless, it can be designed with PCB plaques depending on its layers.
Additionally, this cost is directly affected by the variation in dollar price because some components are imported.
This device is expected to be used to manage any type of domestic electric installation output.Its purpose is to form a management system to improve home energy efficiency.

Figure 2 .
Figure 2. Current and voltage signal

Figure 3 .
Figure 3. Development diagram of the prototype implementation

Figure 4 .
Figure 4. Error measure voltage light bulb

Figure 5 .
Figure 5. Error current light bulb

Table 1 .
Voltage values

Table 2
shows the current values measured with the PQA and the interval in Arduino®'s serial monitor.A linear regression was made before the calibration.

Table 2 .
Current values

Table 3 .
Energy values