You are on page 1of 6

Scheme and Creation of a Prototype for the

Supervision of Lights and Electronic devices with a


PBX, using a WLAN solution based on IoT
Leonel Hernandez#, Maria Ospina#
# Engineering Faculty, ITSA Institución Universitaria, Carrera 45# 48-31, Barranquilla, Colombia
E-mail:lhernandezc@itsa.edu.co, mospina@itsa.edu.co

Abstract—This project exposes the guidelines and activities this drags. The significance of this project lies in the
carried out for the design and implementation of a prototype for technological advance implemented for its realization, by
the supervision and monitoring of lights and electronic devices having open-source platforms such as Raspberry Pi and
through a PBX, using a wireless solution based on IoT, which Arduino that will help in its implementation. With this design,
serves as a base for the search of technological solutions using
platforms of access and development as Arduino and Raspberry,
resources can be managed remotely from a PBX.
obtaining energy and economic savings. Likewise, seeks to At present, all companies have to comply with the
optimize the variables of time, cost and benefit that can provide the standards and characteristics that differentiate them from
communities the use of domotic systems, the use of the necessary others, which make them better regarding service standards
resources provided by data networks and telecommunications to and quality. The same organizations develop these activities
perform actions remotely. For this, VoIP systems are used, with the firm intention of being better every day. For this
converting the Raspberry card into a PBX plant with software on reason, you would not have a contrary implementation, much
a server based on Asterisk. With respect to IoT, its four pillars more knowing that it will help to have very relevant monetary
(People, Processes, Data and Things) have created the need to savings. This exciting project describes the current structure
have a society that empowers the new generations of digital of the connections, and the prototype design will solve the
citizens who understand the emerging technologies offered by IoT,
problems presented. Likewise, its operation and what it
the impact it has on the community, the widespread adoption of the
same and the correct application of the information captured. For represents for home and business will be exposed, to improve
the prototype we have used components (sensors) that can work, the efficient use of resources and thus offer a more effective
or that can act as a starting point for an IoT solution such as solution to the management of lights and electronic devices.
LoRaWAN, since the traffic that must be sent does not require The main benefit of this implementation is the care of the
wide bandwitdhs. For the development of the project, the authors environment, this in its effect will bring results with
used the methodology of descriptive and applied research. economic and social impact. This will be carried out with the
support of Raspberry Pi and Arduino electronics prototyping
Keywords—control; home automation; VoIP; Raspberry Pi platforms, since these allow to program, for the site, the
3; asterisk; PBX; Arduino required needs, and will have monitoring sensors to control
consumption, motion sensors for control of the lights, by
I. INTRODUCTION means of which it is determined according to specific
The management and efficient use of resources are parameters or Patterns. When it must be turned off
increasingly essential in companies, universities, homes and concerning the time of inactivity and to program schedules of
everyday life in general, they no longer belong to a select on and off according to the day of the week; all this
group of people, but are necessary for many human beings programming can be managed in the elements using a PBX
around the world. At present, in most situations, lights and remotely that will help to implement the home automation of
electronic devices are used independently and without any the place.
management that allows their efficient use, but above all
pointing to the saving of resources that is also very linked to II. THE MATERIAL AND METHOD
the monetary factor. Global trends in saving resources have
A. Description of the Problem
the first place so it is beneficial to connect the lights and
electronic devices in this approach, since they are critical The population increase and multiplication of needs have
points of daily consumption and that by managing them reflected greater consumption of natural resources, making
efficiently you can have significant savings. Electronic the production of electric energy one of the fundamental
platforms such as Raspberry Pi and Arduino will implement priorities of the human being. Without taking into account
the management of these resources, which will be the basis of that the indiscriminate use of electricity deprives a natural
the prototype since with them you can have a simple wall that has been handed over to humanity for its survival.
administration managed remotely from a PBX, which will Including that the economic scourge that is affected with all
add a lot of friendliness to its use. the activities that derive from it as industrial activity, the
The purpose of this project is to implement a device to degradation of the elements in ecosystems, the multiple uses
manage the efficient management of resources in lights and of soils and another without the number of operations that
electronic devices in a home and corporate environment. This limit the free environmental development. If only the use of
proposal seeks to improve the use of resources, which is an luminosity in homes is defined, it is easy to observe how
excellent point of great importance at present both for the care unnecessary spending causes cultural, social and
of the environment, as well as for the monetary savings that psychological changes in each belonging to the geographic
core. The traditional management provided by this practice hospitals or care centers for the elderly. The second part
without feeling belonging to know new technologies that consisted of the constant monitoring of the variables of
protect and improve the quality of life in people generates temperature and heart rate of the patients to whom the
high costs in homes, they contribute to environmental application sense, with the aim of sending an alert to medical
damage, expenses in electronic accessories that can even personnel, in case any of the variables mentioned above are
cause incidents in the infrastructures. outside of the established range. Barahona and Huilcapi [3]
The implementation of the domotic economic system in their research "Design and Implementation of a Domotic
allows users to have control of the use of energy through the Control System Supervised by a Mobile Phone Using the
prototype designed that reveals that electronic devices are on Asterisk" showed the design and implementation of a home
or off, and which should remain in that state. The energy automation control system supervised by a mobile phone by
saving is considerable in this way, which contributes to using Asterisk. The system allows access to a menu by voice
environmental care and generates awareness of the or interactive voice response (IVR) by making a call to an
appropriate use that must be given to maintaining the natural extension to access a series of actions which are executed by
balance of ecosystems. The prototype reduces the probability pressing a key on the mobile phone. Rueda and Vargas [4] in
of fires caused by short circuits because it controls the state their project "Design and implementation of a domotic
of electronic devices at times when the electrical conditions system for home security controlled via central Asterisk and
are not optimal for its operation. Likewise, it will contribute Arduino hardware interface." made the design and
to the economic saving of households that pay excessive bills implementation of a home automation system based on the
due to the misuse of electrical energy, for example, by free technologies of Asterisk and Arduino, for the
controlling the intensity of the bulbs. It is worth mentioning development of an alternative in the security of the home.
that the use of new technologies that limit the electrical This system would serve as a base for the search of
demand allows researchers and scientists to find appropriate technological solutions from platforms of free access and
techniques for energy. Finally, monitoring the consumption development. Hernandez et al. [5] designed a prototype based
of the equipment allows the customer to measure the energy on sensors to measure environmental conditions of a data
savings achieved with the system, motivating the efficient use center. For this, they used the DTH11 sensor, which this
of electrical networks and combating the environmental project will implement. There are several investigations about
deterioration caused by the high generation of fuels for the Internet of Things. The studies carried out by Etzion [6],
electric power. Gubbi [7] support this work. For PBX configuration with
Currently, there are intelligent systems for the control of Asterisk, the investigations made by Mohammad [8] and
devices using, PIC, microcontrollers, PLC, among others. Maksimov [9].
This project seeks to use new tools for the implementation of The Internet has evolved in ways that we could never have
home automation, which leads to research new technologies imagined. In the beginning, advancements occurred slowly.
such as the use of free hardware interfaces such as Raspberry Today, innovation and communication are happening at a
PI and Arduino by coupling the cards to the concept of remarkable rate. Fifty billion things provide trillions of
wireless interconnection as the Internet of Things. Create an gigabytes of data (estimated number of devices connected to
efficient demotic system achieving economic, social and the Internet in 2020) [15]. There are a lot of applications and
environmental benefits, which allows people to efficiently technologies that can work with IoT. Lee in his research [11]
manage their electronic devices and luminaires through PBX, explains five techniques for the development of IoT. Bauer in
without having to get up to push a button or have to be at his study [12] shows the IoT reference model, which provides
home to be able to turn off or turn on a light bulb because IP several concepts and definitions. IoT has positively impacted
telephony will do the communication. All this focused on several productive sectors. Hernandez et al. [13] in their
saving electricity, the comfort of individuals and the help this research highlight the importance for higher education
project can provide to people with mobility problems. institutions of the development of IoT projects, their
participation in the industry and their influence in today's
society.
B. Domotic Systems and IoT. A Literature Review

The goal of home automation is to meet specific needs C. Research Methodology


such as comfort, security, communication or savings, these
are the main pillars, and they depend on a home automation This detailed study will be developed using the
system to be successful. There are essential investigations on documentary and descriptive research methodology, since for
this subject, mentioned in this bibliographical review. Tomala the elaboration of this project it is necessary to consult a series
[1] in his thesis "Voice Controlled Domotic System for of documents and collect information through data collection
People with Disabilities in Upper Extremities, using techniques, to reinforce concepts and terms in the different
Raspberry Card" developed a domotic system controlled by stages in the optimal development of the object of study [10].
voice to facilitate daily tasks, using as a central module the The type of research design to be used is the
Raspberry Pi 3 card which connects to several actuators that qualitative/experimental since it is going to analyze the level
they control devices or objects such as doors, windows, light or current state of variables defined throughout the work and
bulbs, etc. The voice control is performed by a wireless several tests will be run to adjust the sensors of the prototype
microphone which registers the orders programmed on the accurately to obtain the desired result.
card [1]. Itzel et al. [2] in their research "Scalable Domotic
System based on Raspberry" presented a domotic system III. PHASES OF THE PROJECT. DESIGN AND
composed of two parts; The first is the management of OPERATION
variables such as light, air conditioning, curtains, etc. in In Fig. 1 the different stages of the project are shown:
popular board format, and the Raspberry Pi 3 B model has
a more powerful processor, ten times faster than the first
generation Raspberry Pi. It also adds wireless LAN and
connectivity Bluetooth, so it is the ideal solution for robust,
connected designs, features that allow you to completely
orient the project to the internet of things, so this equipment
is chosen with complete integration of components used for
the construction of the prototype. To allow the entire
connection of the components, the prototype will use the
Raspberry Pi 3 as the central server and PBX, from the calls
of the direct users as the database that will trigger the
Arduino as a bridge that will control the lights and electronic
devices.

C. Electronic Relay
The Relay is an electronic device that functions as a
switch controlled by an electrical circuit in which,
employing a coil and an electromagnet, a set of one or
several contacts is activated that allow opening or closing
Fig. 1. Phases of the Project other independent electric circuits. The project used a
wireless relay, which is an adaptive RF receiver codec with
The topology of the network to develop is similar to that a single channel relay. This component helps in the smooth
exposed by Serkov et al. [14] in their research, shown in Fig. implementation of wireless AC control technology for
2. The author configured an Asterisk server to connect to a electrical appliances. This device will allow the control of
Wireless Access Point, and through the Wireless network electrical flow for equipment that allows on and off through
control attacks from external devices, be these Wireless it including connected equipment that is not used and thus
phones or laptops unauthorized. avoid waste of energy.

D. Humidity and Temperature Sensor


The DTH11 sensor is a module that allows us to measure
the relative humidity and environmental temperature. This
sensor has a resolution of 1 ° C and a working range of 0 ° C
to 50 ° C for the temperature, and resolution of 1% and a
working range from 20% to 95% relative humidity. The
sensor works with a voltage of 3.3 V to 5 V. This sensor
allows monitoring of the temperature of the air conditioners
and thus be able to control it to the desired taste of the user.
The first activity was the installation of the operating
Fig. 2. Example of the network topology
system and the PBX on the Raspberry Pi 3, the Raspbian
operating system on which FreePBX was preinstalled whose
According to the research carried out to determine the
integration is called RasPBX. Raspbian is the recommended
sensors and electronic devices to be used, it was necessary to
operating system for Raspberry Pi (being optimized for its
list the leading causes of energy expenditure: equipment in
hardware), based on a GNU / Linux distribution called
poor condition, wasting energy from connected but not used
Debian. FreePBX is a web-based open source GUI (graphical
devices and poor administration of the electric flow.
user interface) that controls and manages Asterisk (PBX), an
For the reasons mentioned, it was possible to identify the
devices and sensors that efficiently allow the control of lights open source communication server. FreePBX is licensed
and electronic devices that generate greater electrical under the GNU General Public License (GPL), an open
consumption: source license. FreePBX can be installed manually or as part
of the pre-configured FreePBX distribution that includes the
system's operating system, Asterisk, FreePBX GUI and
A. Arduino. various dependencies.
It is an open-source electronic prototype platform based At the time of installing the OS and the PBX on the card,
on flexible and easy-to-use hardware and software; the the work area was adapted, with the help of a monitor for
Arduino will control the switching on, off and regulation of reading the console and a keyboard to enter the basic
lights and electronic devices that the user wishes to manage. configuration. The Raspberry Pi has no internal storage or
built-in boot code, so it requires a MicroSD card configured
to boot the OS. This project used a 16GB MicroSD class 10
B. Raspberry Pi 3
to install the Raspbx image. This card needed the installation
The Raspberry PI It is a computer the size of a credit of Win32 Disk Imager to copy the image of rasPBX on the
card. It consists of a motherboard on which a processor, a MicroSD; Win32 is a simple open source application that
graphics chip and RAM are mounted. The Raspberry Pi 3 records CD or DVD images in a USB memory or SD card,
Model B is the third generation of Raspberry Pi. It keeps the creating a virtual disk reader.
It is necessary to decompress the Win32 program since it
does not require installation and the image and the device on
which the OS mounts were selected on the hard disk. Then
the Raspberry Pi 3 is turned on, and via HDMI cable it is
entered into console mode; The following basic configuration
is performed: Once the RasPBX successfully started, the
raspbx-upgrade command was executed in the console to
install the latest additions and improvements, then after the
update with the passwd command we determine a secure
password for the system. Next, When entering the PBX, it is
necessary to assign an Ip address to the Raspberry so we will
enter the configuration file:
Fig. 4. Zoiper account creation
sudo nano /etc/dhcpcd.conf
Since the Raspberry Pi 3 has a wireless connection, this
To assign the IP address to Raspberry Pi, use the communication is entirely wireless, using a Mikrotik Wap
command "static ip_address =" followed by the desired IPv4 Wall Ap Outdoor. The AP is connected directly to the
address and the suffix "/ 24" (an abbreviation of the subnet Modem that provides the internet service. In the
mask 255.255.255.0). At this point it is important to make configuration of the AP, DHCP is activated to deliver the IP
sure that the address is not configured for any other: to the PBX server, as shown in Fig. 5:

purpose.interface eth0
static ip_address=192.168.0.4/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

And reboot the system with the command sudo reboot. It


is entered into the PBX through the fixed IP assigned on the
Raspberry Pi 3, and create a user administrator of the PBX
(user: Admin, Password: itsa), as shown in Fig. 3:

Fig. 5. AP – GUI

The Raspberry is entered again by the console, and the


command is executed:

sudo nano /etc/network/interfaces

On which we enter the following code to perform the


wireless configuration of the Raspberry:

Fig. 3. Free PBX Home Web Page auto lo


iface lo inet loopback
We proceed to create two SIP extensions and two IAX iface eth0 inet dhcp
extensions. To facilitate the VoIP communication of the allow-hotplug wlan0
extensions, it is necessary to install the Zoiper software. This auto wlan0
process is carried out on two different computing devices. iface wlan0 inet dhcp
Zoiper is a multiplatform software (works on Windows, wpa-ssid "ssid"
Linux or MAC OS X computers, Android phones, or Apple wpa-psk "password"
iPhone phones), designed to work with your IP
communication systems, as shown in Fig. 4: Connected to our Wifi network, we proceeded to mount
the server to connect to an external network. It is necessary
to download and install the server. After that, Running the
file / usr / local / bin / noip2 updates the hostname record in
non-ip. A script was created that runs after each reboot. The IV. RESULTS AND DISCUSSION
file is created in init.d:
It was possible to establish communication from different
$ sudo nano /etc/init.d/noip2 extensions on various communication protocols such as SIP
one and IAX2. Communication between devices was completely
################################ wireless. In Fig. 8 is shown the devices connected. Fig. 9
2 #! / Bin / sh shows the interactions between extensions:
3 #. / Etc / rc.d / init.d / functions #
decompose / modify for your killproc
4 case "$ 1" in
5 start)
6 echo "Starting noip2 ..."
7 / usr / local / bin / noip2
8 ;;
9 stop) Fig. 8. Raspberry Pi and AP Connection
10 echo -n "Shutting down noip2 ..."
11 killproc -TERM / usr / local / bin /
noip2
12 ;;
13 *)
14 echo "Use: $ 0 {start | stop}"
15 exit 1
16 esac
17 exit 0
18
################################

We save and proceed to give execution permissions to the


script as well as update the boot configuration with this script: Fig.9. Communication between extensions
$ sudo chmod 755 /etc/init.d/noip2 In Table I are shown the expected results of this project:
$ sudo update-rc.d noip2 defaults
TABLE I. EXPECTED RESULTS
The Raspberry was restarted, and its operation was bought
with the ps aux command | grep noip2.
Expected Results Description
The operation of the prototype would consist of the user
making a call through the internet from anywhere by
connecting to a PBX that indicates the managed devices and Monitoring of electricity It is supposed to provide the user,
consumption through an application and register in the
allows him to select a number for the control of ignition, PBX, information on the consumption of
shutdown or regulation of the same, whose server it connects the power lines of the equipment
to a database that is managed by the Raspberry Pi 3 to connect connected to the power, to minimize the
use and identify that equipment that
to the Arduino and physically execute the desired action. In generates the greatest consumption
Fig. 6 is shown the schematic of the prototype:
Telephone communication It is expected firstly to carry out the
via WiFi and cellular for the control and monitoring via the Internet;
control of lights and nevertheless, the integration of the cell
electronic devices phone on the PBX is considered in depth
to cover the population area that does not
have access to the network and still have
control over their equipment and devices
Energy Saving
The main achievement of the prototype
is to generate energy savings in the
environments that decide to establish
Fig. 6. Schematic of the prototype this system, decreasing the demand for
electricity flow by producers, using
In Fig. 7 are shown the variables studied in the project: correctly the devices and equipment of
homes, offices, universities or any area
that does not have the direct control over
the energy expenditure that the
equipment causes without necessity and
offering opportunities to the societies to
improve the efficiency of the processes
Economic Saving
Energy saving is linked hand in hand
with economic savings since less energy
is consumed more economically will be
direct user both at the level of bills and
Fig. 7. Variables expenses charged for components that
reach the end of its useful life. Also, for congestion, that a solution of this kind can generate. There are
large companies may usefully use this
prototype to get international tools such as Opnet Modeler that allow this type of research,
certifications about the workspace, creating a network model that simulates the performance of a
without leaving behind that the energy real topology.
producers will not have to generate the
same amount of energetic watching over
the care of the ecosystems that surround REFERENCES
them
[1] D. Tomala, “Sistema Domótico Controlado Por Voz Para
Environmental Care Personas Con Discapacidad En Extremidades Superiores,
Nature is the factor that has allowed the Utilizando Tarjeta Raspberry Pi,” Universidad Politécnica
development of man; however, its Salesiana, 2018.
indiscriminate use has missed the long- [2] L. Itzel, J. Montiel, and S. Roldan, “Sistema Domótico
term benefits that can offer to humanity, Escalable basado en Raspberry,” Escuela Superior de
therefore, the XXI century has focused on Cómputo, 2015.
eradicating the bad habits of previous
generations to have a more friendly [3] E. R. Barahona Padilla and D. G. Huilcapi Ruiz, “Diseño e
environment. For them this type of Implementación de un Sistema de Control Domótico
technologies allow us to reduce Supervisado por un Teléfono Móvil Mediante la Utilización de
consumption that destroys part of the Asterisk.,” Escuela Superior Politécnica de Chimborazo, 2015.
ecosystems and resources considering
that it offers technological development
[4] D. Rueda and S. Vargas, “Diseño e implementación de un
and the possibility of providing other sistema domótico para la seguridad del hogar controlado vía
projects that contribute to its growth central asterisk e interfaz de hardware Arduino,” Universidad
without directly affecting to the territory Distrital Francisco Jose De Caldas, 2015.
with the exploitation of their lands and [5] L. Hernandez, A. Pranolo, I. Riyanto, Y. Calderon, and H.
finding different forms of energy Martinez, “Design of a System for Detection of Environmental
production that do not change the Variables Applied in Data Centers,” in 2017 3rd International
environment Conference on Science in Information Technology (ICSI Tech
2017), 2017, pp. 389–395.
The relation between the components of the prototype is [6] O. Etzion, F. Fournier, and S. Arcushin, “Tutorial on the
Internet of Everything,” in Proceedings of the 8th ACM
shown in Fig. 10: International Conference on Distributed Event-Based Systems
- DEBS ’14, 2014, pp. 236–237.
[7] J. Gubbi, R. Buyya, S. Marusic, and M. Palaniswami, “Internet
of Things (IoT): A vision, architectural elements, and future
directions,” Futur. Gener. Comput. Syst., vol. 29, no. 7, pp.
1645–1660, 2013.
[8] M. A. Khan and K. M. Shahriar, “ASTERISK Based Open
Source IP-PBX System for Accountable Customer Support
Service,” in Proceedings - 2015 3rd International Symposium
on Computational and Business Intelligence, ISCBI 2015,
2016.
[9] V. V Maksimov, N. S. Panasyuk, and S. A. Chmyhun,
“Development of interactive voice response models based on
IP-PBX Asterisk,” in 2013 23rd International Crimean
Conference “Microwave & Telecommunication Technology,”
2013.
[10] R. Hernandez Sampieri, C. Fernandez Collado, and M. del P.
Fig. 10. Connection diagram between the components of the Baptista Lucio, Metodología de la investigación. 2010
prototype [11] Lee, I., & Lee, K. (2015). The Internet of Things (IoT):
Applications, investments, and challenges for enterprises.
Business Horizons, 58(4), 431–440.
V. CONCLUSIONS AND FUTURE WORKS https://doi.org/10.1016/j.bushor.2015.03.008
The possibility of being connected from any place and [12] Bauer, M., Bui, N., De Loof, J., Magerkurth, C., Nettsträter,
allowing users to manage their offices, houses or apartments, A., Stefa, J., & Walewski, J. (2013). IoT Reference Model. In
Enabling Things to Talk SE - 7 (pp. 113–162).
helps to reduce electricity consumption, an impact that on a https://doi.org/10.1007/978-3-642-40403-0{_}7
large scale contributes to energy saving and care of the [13] Hernandez, L., Jimenez, G., & Baloco, C. (2018).
environment, offering the planet an economical and viable Characterization of the Use of the Internet of Things in the
solution to the absence of large generators of renewable Institutions of Higher Education of the City of Barranquilla and
Its Metropolitan Area. In HCI International 2018 – Posters’
energy. This project describes the improvements in energy Extended Abstracts (Vol. 852, pp. 17–24).
efficiency, productivity and providing a study of how these https://doi.org/10.1007/978-3-319-92285-
improvements minimize industrial activity that degrades [14] Serikov, T. G., Yakubova, M. Z., Mekhtiev, A. D., Yugay, V.
ecosystems; therefore, a prototype is proposed to carry out V., Muratova, A. K., Razinkin, V. P., … Alkina, A. D. (2017).
these applications, it also becomes a practical guide for the The analysis and modeling of efficiency of the developed
telecommunication networks on the basis of IP PBX asterisk
development of other similar projects that automate now. In Proceedings - 2016 11th International Forum on
industries, hospitals, universities, based on IoT. Strategic Technology, IFOST 2016.
Identical to the proposed Project, it is possible to design https://doi.org/10.1109/IFOST.2016.7884168
and implement a large number of future works based on IoT [15] Cisco Networking Academy. (2015). Cisco Networking
Academy. Retrieved from
solutions. It is possible to integrate PBX similar to the http://www.cisco.com/web/learning/netacad/index.html
developed one that is configured with servers in the cloud,
which in turn are connected with sensors and actuators
capable of linking to NGN networks such as 4G (shortly 5G)
or 802.11ad, high speed, or LoRaWAN. Another future work
to develop is to take measures of traffic flow, network

You might also like