Low-Cost and Energy-Efficient Alternatives for Home Automation using IoT

— It is known that a large sector of the population keeps their electronic equipment connected to the power supply for prolonged periods of time. Even in many households, devices such as wireless routers and/or voice assistants are kept switched on every day at all hours even though they are not in use or at nighttime. As a solution to this problem, this paper introduces automation alternatives based on IoT (Internet of Things) making use of the NodeMCU board, a relay module, the Sinric Pro application, Google Home, or Amazon Alexa mobile applications, and smart speakers from Google or Amazon companies. As a result, it was obtained that the 4 proposals are efficient in terms of easy implementation and reduction of electricity consumption around 30% annually. This research helps families to improve their energy efficiency and daily produc - tivity through IoT.


Introduction
One of the concepts that have become increasingly popular in recent years is the Internet of Things (IoT) [1]. This concept refers to the digital interconnection of objects through the Internet making them "smart", which gives us the opportunity to offer solutions that positively impact the quality of life of people achieving efficiency [2]. Some of the components that are part of IoT are low-power and low-cost boards such as the Arduino [3], NodeMCU [4], and/or Raspberry Pi [5].
There are several IoT applications, such as: knowing the status and evolution of a patient remotely [6], applications to monitor environmental pollution [7], monitoring of domestic electrical energy [8], [9], the implementation of smart homes [10], [11] or in smart buildings [12]. All these projects help people by generating a positive impact on their quality of life. Also, there is the possibility of integrating intelligent voice assistants such as Amazon Alexa and Google Home [13], in order to generate automation solutions in the home or office, and optimally improve daily personal activities [14].
The present work aims to analyze and offer low energy consumption and cost automation alternatives using IoT using NodeMCU and Sinric Pro. Also, the proposal includes the integration of mobile applications of Google Home and Amazon Alexa virtual assistants, as well as smart speakers. All this looking for a positive impact on improving productivity and energy saving.

Literature review
Despite the increase in popularity the IoT has had in recent years, especially in home automation [11], the opportunity to implement this type of technology has not been taken advantage of [12]. We know that to maintain a garden it is essential to water every so often, thus the different plants that are in a garden continue to survive. For this reason, at this time it would be helpful for families to have their gardens automated to work when necessary. There are several projects using boards such as Arduino [13], Raspberry Pi [14], and NodeMCU [15], as well as different IoT platforms such as Adafruit IO [16], [17], Bylnk [18], and Home Assistant [19].
It must be also pointed out that voice assistants have become popular nowadays through smartphones or through smart speakers. These devices help to generate lists, reminders, alarms, routines among other functions that offer according to the model of the speaker or application that is being used. In addition, with the integration of voice assistants, an infinity of features is added, such as the linking of intelligent equipment like plugs, lights, and other sorts of equipment that are used in a smart home. Likewise, these technologies can be used by any developer to create their applications to improve a specific area such as security [20] or to improve quality of life by avoiding a sedentary lifestyle [21] and generating energy efficiency [2], [22].

Home automation system
Home automation solutions can be found with various budgets as presented in [9] and [23]. However, this research proposes more efficient alternatives, easy to implement, with low electricity consumption and low cost. In addition, these alternatives improve people's productivity on a day-to-day basis, as mentioned in the literature review. Four alternatives of low electricity consumption and cost are proposed for home automation using the NodeMCU, Sinric Pro as well as two additional alternatives that use the most popular smart speakers, Google Home and Amazon Alexa. Any of the proposals aim at generating savings at home. Proposals will work with the following components: • NodeMCU, also called Lolin. It is a board based on the ESP8266 chip, it has Wi-Fi connectivity (802.11 b / g / n), an analog pin, and 17 digital pins (See Figure 1). • Sinric Pro is a home automation platform (See Figure 1) that allows controlling Raspberry Pi, ESP8266, ESP32, or Arduino boards. In this manner, they can be linked to Amazon Alexa or Google Home for free [24]. • Mini Google Home is a smart speaker that allows voice recognition, for integration with Google's personal assistant services. The device is integrated with a mobile App (Google Home) that allows configuring, managing, and controlling all Google Home devices, as well as various compatible products using voice (See Figure 2). • Echo Dot is a smart speaker that uses Amazon technology. It has its mobile application called Amazon Alexa that allows configuring, managing, and controlling devices of various products compatible with voice (See Figure 2).

Fig. 2. Mini Google Home and Amazon Echo dot
• A Relay Module is an electromechanical device used to switch circuits. It works as a switch and is controlled by an electromagnet. This device can be used to turn on or off any electronic equipment that is at home. • Electronic equipment. Devices with different voltage and amperage (from 5v to 220v) can be turned on or off using the Sinric Pro platform and through voice commands using Google Home or Amazon Alexa. Some examples of devices that can be controlled with the platform are light bulbs, switches, fans, or solenoid valves, to watering a garden for example [24].
The four alternatives presented in this article are for families that have a wireless router and/or voice assistants (Google Home or Alexa) turned on 24 hours a day. The proposals feature the use of the Sinric Pro platform, the NodeMCU board, relay modules, and the Google Home and Amazon Alexa mobile apps, which can be used with Google or Amazon smart speakers (See Figure 3).

Fig. 3. Home automation applications
The proposals presented have the following sequence of installation, configuration, and coding. There are slight differences among the alternatives. (See Figure 4).

Proposal 1: Sinric Pro, NodeMCU, and App Amazon Alexa
For the first alternative for home automation, it will be required a NodeMCU board, two Relays, the solenoid valve, the Sinric Pro platform, and the Alexa App.
First, an account must be configured in Sinric Pro [24], within the platform two Switch-type devices are added and then notifications are activated. Afterward, the Arduino IDE must include the Sinricpro libraries [25], with their dependencies on Arduino JSON [26] and Arduino Web sockets [27], finally the libraries to generate a time system with NTP Client [28] must be also included. Then the codes established by the Sinricpro of MultiSwitch_advance and the NTPClient of Advanced must be joined. Next, the WIFI SSID and password must be modified according to the home wireless network. Then the credentials of the APP_KEY, APP_SECRET, and the deviceID must be placed, these are located on the Sinric Pro platform.
Finally, the two relay modules and the electronic components must be connected to the NodeMCU to be controlled. In our example case the solenoid valve to water the garden (See Figure 5). Then to work with the Amazon Alexa application, the Sinric Pro Skill must be installed; in this way, it will recognize a new device. Then, within the Amazon Alexa App, routines should be generated. In our example case, watering the garden by turning on or off the solenoid valve can be set at an established hour or executed by voice command at any time. The same would happen with controlling the wireless router (See Figure 6).

Proposal 2: Sinric Pro, NodeMCU, and App Google Home
In this second option, the same process of creating an account in Sinric Pro and NodeMCU board is done. As well as the installation of the libraries and the configuration of the NodeMCU from the Arduino IDE. But, now instead of using the Amazon Alexa App, the Google Home App is used. After running the application, we should go to the home control option and search for Sinric Pro to link the account created on the platform. Finally, we have the option of creating a routine and setting a time as needed (See Figure 7).

Proposal 3: Sinric Pro, NodeMCU with Amazon Alexa App linked with an Amazon smart speaker
As a third option, the Amazon Alexa smart speaker will be used. Also, the same process of creating the Sinric Pro account and configuring the NodeMCU board is also performed. However, these speakers must be turned on all day causing high consumption of electricity. For this, it is proposed to provide a system to turn on or off the devices when all members of a family are awake or resting. The only thing that was added is a new relay that can control the on or off, to generate independence. It would be necessary to add and configure the new Switch in the Sinric Pro platform and add a new instruction within the code of the new digital pin to use. It is important to remember that the equipment shutdown routine should be as follows: first the electronic equipment, then the smart speaker, and finally the wireless router. In the case of turning on, the sequence is in reverse of the power-off sequence (See Figure 8).

Proposal 4: Sinric Pro, NodeMCU with Google Home App linked with a Google smart speaker
This option is very similar to proposal 3, but this time Google technology is used. It is necessary to install the Google Home application and make the connection as shown in Figure 8. All four proposals have the NTP Client implemented, which by adding a conditional at the end of the code will allow the wireless router to be turned off and on, depending on what time the family members go to bed and what time they get up. Figure 9 shows an example of pseudocode that at 23 hours and 30 minutes the wireless router is turned off and at 5 hours and 30 minutes the wireless device is turned on. In case a member of the family needs to work later, he or she will only have to wait one minute and press the RST button of the NodeMCU, which will activate everything off.

Result and discussion
The tests were carried out for 1 year and the results of monthly and annual electricity consumption were analyzed. A comparative table of the costs required for implementation was also generated. The results are described below:

Proposal 1: Sinric Pro, NodeMCU and App Amazon Alexa
By using the Sinric Pro platform and the NodeMCU board, it was possible to successfully link the Amazon Alexa mobile application, which made it possible to control the on and/or off electronic equipment from a robust application such as Amazon Alexa. Also, create routines that allow generating an on and off automatically. It should be mentioned that it did not require the purchase of an intelligent horn to carry out the automation, being one of the cheapest proposals (energy used and cost of equipment) to be implemented in families with low economic resources. One of the advantages of using the Amazon Alexa App is that it allows us to know how much the electrical energy expenditure of the equipment is turned on in a certain time.

Proposal 2: Sinric Pro, NodeMCU and App Google Home
The second proposal also using Sinric Pro and NodeMCU, was integrated with the Google Home mobile app. This allowed the use of Google technology to turn on and off through the voice assistant, just like option 1. This allows the generation of routines through the Google mobile application without the need to purchase a smart speaker. This Google Home mobile app does not have power consumption calculations, as with Proposal 1.

Proposal 3: Sinric Pro, NodeMCU with Amazon Alexa App linked with an Amazon smart speaker
Unlike the first two, in this proposal they considered Amazon's smart speakers (Echo dot), to turn on or turn off an electronic component, a new relay has been added, so that it also turns off or on the speaker, just like the router wireless.

Proposal 4: Sinric Pro, NodeMCU with Google Home App linked with a Google smart speaker
Finally, this last option is like the previous proposal, but uses Google's smart speaker (Mini Google Home), to turn on or off an electronic component.
When analyzing the last two proposals (option 3 and 4), they have a higher electricity consumption when working 24 hours. Google's technology is the one that consumes less electricity compared to Amazon (difference in consumption = 4320W/month). However, If the automation of the latest proposals is applied, electricity savings can be seen with Google (6408 W/month) and Amazon (7848W/month) (See Figure 10).
In a first impression, it turns out that the last two options are the least popular because it requires the purchase of smart speakers, but in reality more and more families choose to acquire them in recent years [29], due to the great help that voice assistants give in different areas such as in-vehicle assistance, home automation, among others [12]. Through this research, we can improve the energy efficiency of homes by automating the switching on and off home devices. By experimenting with the four options turned on 24 hours a day for one year, results were obtained to analyze the electricity consumption of each one (See Table 1): • Proposal 1: It reached a consumption of 171720W/annual, but by performing the automation, a consumption of 120744W/annual was achieved, resulting in a saving of 29.7%. • Proposal 2: Had the same monthly consumption and efficient consumption as option 1. • Proposal 3: The monthly consumption with Amazon technology was 301320 W/ annual and its efficient monthly consumption is 207144W/annual, representing a saving of 31.3%. • Proposal 4: The monthly consumption with Google technology was 249480 W/ annual and its efficient monthly consumption is 172584W/annual, generating a saving of 30.8%. Figure 11 shows the analysis of the four proposals regarding energy consumption. The first two alternatives are the cheapest. For families that have smart speakers, the cheapest is Google's (Mini Google Home).

NodeMCU hardware features
In the world of IoT, there are several devices that can be used to carry out the proposals that have been presented in this research. Nonetheless, there are few with little money investment. The automation of houses in a stable and reliable way, it is only necessary to have basic knowledge of programming and computer networks for them to be implemented. Some reasons why NodeMCU board is used in home automation are as follows: • It has more RAM (4MB) compared to an Arduino, it also has more flash memory, providing much more space for more complex applications (source code). • The price is much lower than an Arduino.
• Finally, the power consumption is almost like that of the Arduino, but as it natively has a wireless network, it has become the favorite in IoT solutions.

Cost comparison of the proposals
According to Table 2: • Option 1 and option 2: Both are proposed with the same cost, because it is being considered that families already have a Smartphone, they will only have to install the Google Home App or Amazon Alexa, which are free. • Option 3 and option 4: they are for families who have an Amazon or Google smart speakers such as Echo Dot 3 or the Mini Google Home.
All the mentioned proposals are scalable to automate more electronic equipment in a home, you just must remember that by adding more components (relay module) the electrical consumption and the cost of the solution increase. Compared with other automation projects, it has been seen that there is a great variety of proposals that use mobile applications developed by themselves using the Arduino board [30], the NodeMCU board [31], or the Raspberry Pi [32]. These proposals have some limitations because there is not a platform that allows integration with other brands. Instead, our proposals can be linked to Google or Amazon Alexa Apps where there will be no problems regarding compatibility. Likewise, other platforms have been found for home automation such as the Home Assistant [19], which would help to carry out automation with different commercial IoT devices, but it requires a monthly payment of 5 dollars if it is required to control from outside the house, or as it happens with the Adafruit IO [17]. This platform is a cloud service that works as an intermediary with the help of the IFTTT in all communications with Google or Alexa technology, but the free version is not 100% functional. On the other hand, our proposals are designed to generate an electrical saving of 30%, by turning off the equipment that is not used when the members of a family are resting, also if in a home it is required to automate more than 3 electronic equipment, a payment of 3 dollars should be done per year for each device to the Sinric Pro platform, being the cheapest proposal on the market to automate a home. In the world, the demand for smart speakers from Google and Amazon continues to grow, which are compatible with various IoT companies, which allow home automation at high prices in different parts of a home. However, the proposals presented in this article require a basic knowledge of programming and computer networks to personalize the needs of the home without spending a lot of money, as shown in Table 2.

Conclusion
The four proposals are low-electricity consumption and low cost in their implementation, being accessible to any family. In addition to having the possibility of generating routines with Google Home or Amazon Alexa technology for turning on and off household appliances, allowing to improve productivity.
It is very common that people who have a wireless connection at home, leave the Wi-Fi and their smart speakers 24 hours a day, this bad habit generates a waste of electricity in which using the IoT, could be corrected using automation to turn off the devices every day at least 6 to 8 hours a day, generating savings in monthly electricity consumption. Considering this scenario, the savings calculated in this research are around 30% depending on the alternative chosen.
The first two alternatives of this research are the most economical solutions because with a small budget you can automate a house. Just by having a smartphone, you can turn on or off any electronic equipment and/or create routines that allow you to activate or deactivate the electrical flow. The last two alternatives have a higher price compared to the previous ones, since they have a smart speaker, proposing can work with the use of the Smartphone or through the smart speaker. This will allow having an advantage since any member of the family can perform the same processes in contrast to the first two alternatives mentioned above.
Through the Sinric Pro platform, it is easy and fast to link it with the Amazon Alexa or Google Home mobile applications, which makes it possible to have a large number of low-cost components at home. The four proposed alternatives are highly scalable since there is the option of adding more relay modules. This takes into consideration a maximum of 8 modules, because if you want to add more, you must add more Noce-MCU boards. Also, consider that the free version of Sinric Pro only allows a maximum of 3 devices. If you want to include more a payment of $3 per year for each one is required.