Development of Smart Home Applications Based on Arduino and Android Platforms: An Experimental Work

: The ideal smart home could be automatically controlled using a variety of electronic tools and devices to perform everyday tasks. Smart home automation is crucially beneﬁcial for human life, particularly when considering those with disabilities, inpatients, and elderly populations. In this paper, applications and systems for smart homes are investigated. During experimentation they were controlled via an Android mobile phone and the Arduino platform. Bluetooth Module HC-06 was used to connect the Arduino Uno R3 with the mobile phone. Five smart home applications were developed to control the lighting and electrical sockets, fan speed, temperature-and humidity-meter display/controls, as well as the ﬁre-alarm and toxic-gas alarm systems. Herein, the deﬁnition, the graphical user interface, the required main components, and the control circuit connections are prepared and presented for each application. The graphical user interface was created using the RemoteXY website, which is a reliable website for this purpose. The developed applications were tested, and they were found to work efﬁciently and correctly. Additionally, this innovative system is both cost-effective and affordable (total cost at the time of development was 110 USD).


Introduction
Smart homes are very beneficial to people, particularly for those with long-term disabilities, inpatients, elderly populations, people experiencing debilitating diseases, and those who have been through painful accidents and/or injuries, thereby requiring them to be in the care of someone else. Since the smart systems work with a single click of a button, they provide immense convenience and utility. With a smart home, a person can control the air conditioner, turn the lights on and off, and can see who is standing at their door, all regardless of their physical location. In addition to the attained comfort, smart homes are an effective way to reduce utility expenses like electricity, water, and fuel. Furthermore, these homes provide people with increased safety through the use of sensors that can better detect the presence of fire and/or toxic gas leakage. Additionally, they provide improved security with the ability to install CCD cameras that are turned on 24/7 to aid in theft prevention and investigation. In general, these homes make human life easier by saving effort and time when compared with traditional homes [1][2][3][4][5].
Researchers have paid great attention to developing smart home systems and applications. Programmable logic controllers (PLC) and the Arduino platform are usually used for these purposes. Based on PLCs and human machine interfaces (HMI), Sasikala et al. [6] used ladder diagrams for controlling only the ON and OFF status of electrical devices that were found in different rooms from the control room. In their approach different smart home applications were not considered, and the required cost was not clear.
In [7], Yilmaz used a PLC for controlling a home automation system. Their developed applications facilitated fault detection and tolerance as well as switching between ON and OFF in areas such as gas sensing, voltage control in power sockets, and the circuits of valve controls. The required cost was not clear, and many components were needed. Barz et al. [8] developed a smart home automation system using a Siemens PLC and an HMI Weintek eMT3070a touchscreen. Their applications were oriented towards the control and monitoring of lighting, room temperature, and irrigation systems. Their smart home was controlled via Ethernet. The required cost was also not clear. PLCs were also employed in ref. [9][10][11][12]. Most of these developed systems that used PLCs were not controlled remotely and they were only developed for local use. In addition, the required cost was high.
The Arduino platform, which is affordable and easy to program when compared with PLCs, has also been used with smart home applications and systems. In [13], Naing and Hlaing used two Arduino Nano units with sensors in the implementation of a smart home automation system. Their developed applications were designed to monitor and control lighting, room temperature, alarms, and a security system. In their approach, the microcontroller was responsible for sending SMS alerts to the owner in the event that the sensors detected an abnormality. Their approach was dependent on a power supply, and if this power supply were to fail the connection would be halted and the SMS alarm functions would be stopped. In addition, the required cost was, again, not clear. In [14], a smart home system was developed using an Arduino unit. Their system controlled electronic devices such as electric bulbs and fans in addition to providing alerts if there was a fire breakout. In case of a fire in the house, the user could be informed via SMS using the GSM Module. Their system was designed for local use only as it was neither WIFI nor Bluetooth enabled. In addition, the required cost was not clear. Raza et al. [15] developed a smart home system using an Arduino unit and an Android mobile application. In their case, the Arduino unit was connected to the Android mobile application via Bluetooth (HC-05) Module, and only the lighting was controlled. Development of other different smart home applications was missing, and the required cost was unclear. In [16], Chandramohan et al. implemented a smart home automation and security system using an Arduino unit and Wi-Fi connection via an android application. Their approach provided intelligent operation and control for only lamps and fans. Other applications were not investigated and the required cost for their approach was unclear. In [17], the authors managed electrical load and home security using the Internet of Things (IoT) based on the Arduino Mega 2560 system. Other smart systems were developed by researchers in [18][19][20][21]. A comparison between all the aforementioned smart home applications, including the main gaps in each system, is presented in Table 1.
From the analysis thus far and consideration of Table 1, the main gaps and disadvantages of the previous methods that should be considered are summarized as follows: 1.
Most of the methods were developed for local use only. Therefore, remote sensing technology should be taken into accounts (e.g., Bluetooth for controlling systems from a short range and Wi-Fi, IoT, or Cloud for controlling systems remotely from anywhere on the globe).

2.
Most of the developed smart home applications in prior research are limited to one, two, or three functions. This is not enough. Smart home systems are very beneficial for daily life; therefore, many different applications in the smart home should be developed, controlled, and monitored. 3.
The required cost for developing the smart applications is often unclear and rarely presented by previous researchers. Therefore, associated costs should be stated clearly to show if the method is cost effective or not. 4.
Using the Arduino platform compared with other platforms is preferable because the hardware is affordable and easy to program. All the previous gaps and challenges are considered in our presented approach. The main contributions and novelty of this paper are discussed clearly in the following points:

1.
A cost-effective concept ($110) for a smart home has been developed and controlled herein via an Android mobile phone and Arduino platform.

2.
The interface circuit between the Android platform and the mobile phone using Bluetooth Module HC-06.

3.
Five different applications for this smart home have been developed which control the lighting and electrical sockets, fan speed, the display for temperature and humidity settings, the fire alarm system, and the toxic gas alarm system.

4.
For all applications, a graphical user interface has been created based on the RemoteXY website.

5.
The components, the controls, and the wiring circuit are presented for each application and system. In addition, the system was investigated experimentally, and its effectiveness is proven through this research. 6.
The system may relieve elderly populations, those with injuries, and people with disabilities from routine stresses and can provide these groups with increased independence. 7.
The system efficiently manages energy consumption and helps with reducing the household's carbon footprint.
The remainder of this paper is divided into the following sections: Section 2 presents the control unit and the interface between the Arduino and Android platforms. In Section 3 the systems developed for the smart home are explained in detail. The components, the graphical user interface, as well as the electronic and control circuits are presented for each application. In Section 4 some experiments are discussed for the smart home applications. Section 5 summarizes the main important points in this paper and provides some direction for future research.

Control Unit and Bluetooth Network
The Arduino UNO R3 and Bluetooth module used in this research are presented below. The Arduino UNO R3 [22][23][24] is extensively used in building projects because of its ease of use and programming. The one used here is a type ATmega328 which provides ports for directly connecting the electronic components, such as sensors, through 14 (entrance or exit) of the digital types of input/output. These 14 digital pins can work as inputs or exits and are used to insert and eject fixed digital signals 0 or 5. Each port can provide a current pull of up to 40 mA. Six of the ports can be used to obtain PWM (Pulse-Width modulation). In addition, the circuit contains a crystal oscillator at a 16 MHz frequency, a USB inlet for communication with the computer, and a separate inlet for energy. The power inputs/outputs are defined as follows: (1) the VIN or DC power jack is an outlet in which the Arduino can be run through an external power source such as a battery, (2) the 5V port can be used for sensors or other circuits, (3) the 3.3V port in which the maximum current value that can be utilized is 50 mAh, and (4) the GND port which is used to connect the ground line. Bluetooth Module HC-06 [25] is used to connect the Arduino Uno with the Android mobile phone. This module is one of the commonly used units with Arduino and it comprises four pins as follows: (1) the VCC pin, which is connected with the Arduino's 5V output; (2) the GND pin, which is connected to the Arduino's ground; (3) the TX pin, which is used to send the order from the phone to the Arduino and is connected to the Arduino's RX; and (4) the RX pin, which is used to drop the order from the phone to the Arduino and is connected to the Arduino's TX. These connections are shown in Figure 1.
direction for future research.

Control Unit and Bluetooth Network
The Arduino UNO R3 and Bluetooth module used in this research are presented below. The Arduino UNO R3 [22][23][24] is extensively used in building projects because of its ease of use and programming. The one used here is a type ATmega328 which provides ports for directly connecting the electronic components, such as sensors, through 14 (entrance or exit) of the digital types of input/output. These 14 digital pins can work as inputs or exits and are used to insert and eject fixed digital signals 0 or 5. Each port can provide a current pull of up to 40 mA. Six of the ports can be used to obtain PWM (Pulse-Width modulation). In addition, the circuit contains a crystal oscillator at a 16 MHz frequency, a USB inlet for communication with the computer, and a separate inlet for energy. The power inputs/outputs are defined as follows: (1) the VIN or DC power jack is an outlet in which the Arduino can be run through an external power source such as a battery, (2) the 5V port can be used for sensors or other circuits, (3) the 3.3V port in which the maximum current value that can be utilized is 50 mAh, and (4) the GND port which is used to connect the ground line. Bluetooth Module HC-06 [25] is used to connect the Arduino Uno with the Android mobile phone. This module is one of the commonly used units with Arduino and it comprises four pins as follows: (1) the VCC pin, which is connected with the Arduino's 5V output; (2) the GND pin, which is connected to the Arduino's ground; (3) the TX pin, which is used to send the order from the phone to the Arduino and is connected to the Arduino's RX; and (4) the RX pin, which is used to drop the order from the phone to the Arduino and is connected to the Arduino's TX. These connections are shown in Figure 1.  RemoteXY [26] is a reliable website on the Internet that helps the programmer create a graphical user interface easily and free of charge. Therefore, this resource was chosen to create the GUI for the smart home applications. Figure 2 shows how RemoteXY works.
Automation 2022, 3, FOR PEER REVIEW 5 RemoteXY [26] is a reliable website on the Internet that helps the programmer create a graphical user interface easily and free of charge. Therefore, this resource was chosen to create the GUI for the smart home applications. Figure 2 shows how RemoteXY works.

Smart Home Applications and Their Control Circuits
This section presents the developed five applications of the smart home. These applications are shown in Figure 3. This work was carried out through cooperation between the Health Technical Institute and the Faculty of Engineering at South Valley University, Qena, Egypt. The definitions, the components, and the control circuits for each application and system are discussed in detail in the following subsections.

st Part
Control lighting and sockets by phone

Smart Home Applications and Their Control Circuits
This section presents the developed five applications of the smart home. These applications are shown in Figure 3. This work was carried out through cooperation between the Health Technical Institute and the Faculty of Engineering at South Valley University, Qena, Egypt. The definitions, the components, and the control circuits for each application and system are discussed in detail in the following subsections.

Smart Home Applications and Their Control Circuits
This section presents the developed five applications of the smart home. These applications are shown in Figure 3. This work was carried out through cooperation between the Health Technical Institute and the Faculty of Engineering at South Valley University, Qena, Egypt. The definitions, the components, and the control circuits for each application and system are discussed in detail in the following subsections.

Lighting and Sockets Control
The aim of this system is to control the operation of lighting and electrical sockets in the home using an Android phone. In this case, three lamps and two sockets are used. Using the RemoteXY program, the GUI in the phone is arranged as presented in Figure 4. The main components of this system are presented in Table 2.

Lighting and Sockets Control
The aim of this system is to control the operation of lighting and electrical sockets in the home using an Android phone. In this case, three lamps and two sockets are used. Using the RemoteXY program, the GUI in the phone is arranged as presented in Figure 4. The main components of this system are presented in Table 2.  The control circuit is constructed by connecting the first end of the relay to the positive voltage, the second end of the relay to the ground of the circuit, and the third end of the relay to the output no. 8 of the Arduino. The lamp is connected in series with the relay.  The control circuit is constructed by connecting the first end of the relay to the positive voltage, the second end of the relay to the ground of the circuit, and the third end of the relay to the output no. 8 of the Arduino. The lamp is connected in series with the relay. This circuit is illustrated in Figure 5. The implemented code is divided into two parts: the first part defines the functions of the keys within the RemoteXY software interface, in addition to the name and number of the pin switches that the user operates, while the second part is about defining pin states and integrating them with RemoteXY's software interface. This code is presented in Appendix A.

Fan Speed Control
The aim of this system is to control fan speed from the Android phone. In this case two fans are used. Using the RemoteXY program, the graphical user interface on the phone is arranged as shown in Figure 6. The main components of this system are presented in Table 3.

Fan Speed Control
The aim of this system is to control fan speed from the Android phone. In this case two fans are used. Using the RemoteXY program, the graphical user interface on the phone is arranged as shown in Figure 6. The main components of this system are presented in Table 3.

Transistor
It is used to amplify the signal, and it consists of three terminals: base, emitter, and collector.

Fan Speed Control
The aim of this system is to control fan speed from the Android phone. In this case two fans are used. Using the RemoteXY program, the graphical user interface on the phone is arranged as shown in Figure 6. The main components of this system are presented in Table 3.  The control circuit for this system is constructed by connecting the output no. 9 of the Arduino to the base of the transistor. The first end of the fan is connected to the positive voltage, and the second end of the fan is connected to the collector of the transistor. The emitter of the transistor is connected to the ground of the circuit. This circuit is presented in Figure 7. The implemented code is also divided into two parts: the first part provides the definitions for the sliders within the RemoteXY software interface, in addition to the name and number of the pin switches that the user operates, while the second part is about defining states within the sliders and integrating them with RemoteXY's software interface. This code is presented in Appendix B.
Automation 2022, 3, FOR PEER REVIEW 8 Table 3. The main components used to control the fan speed.

Component Definition Technical Specifications
Fans Two fans are used to ventilate the rooms of the smart house.

Transistor
It is used to amplify the signal, and it consists of three terminals: base, emitter, and collector. The control circuit for this system is constructed by connecting the output no. 9 of the Arduino to the base of the transistor. The first end of the fan is connected to the positive voltage, and the second end of the fan is connected to the collector of the transistor. The emitter of the transistor is connected to the ground of the circuit. This circuit is presented in Figure 7. The implemented code is also divided into two parts: the first part provides the definitions for the sliders within the RemoteXY software interface, in addition to the name and number of the pin switches that the user operates, while the second part is about defining states within the sliders and integrating them with RemoteXY's software interface. This code is presented in Appendix B.

Temperature and Humidity Measurement
This system measures the temperature and humidity and displays it on the Android phone. Using the RemoteXY program, the GUI on the phone is arranged as shown in Figure 8. The main components of this system are presented in Table 4.

Temperature and Humidity Measurement
This system measures the temperature and humidity and displays it on the Android phone. Using the RemoteXY program, the GUI on the phone is arranged as shown in Figure 8. The main components of this system are presented in Table 4.

Component Definition Technical Specifications
Heat and Humidity Sensor (DHT11 Module) -This sensor gives a digital signal that is in line with temperature and humidity and these signals are easy to read by the Arduino unit.
-It consists of three pins as follows: (1) the VCC, which is the positive voltage connected to 3.3 V and 5.5 V.
(2) the GND which is connected to the Arduino's ground.
(3) the OUT which sends temperature and humidity data to the Arduino.
-Digital reading and using a single exit.
-Standard measurement indicator: 1% for humidity and 1 °C for heat.
The control circuit of this system is constructed by connecting the sensor VCC terminal to the 5 V output of the Arduino; the sensor GND to the Arduino GND; and the sensor's OUT to port no. 13 on the Arduino from which it receives the signal. This circuit is presented in Figure 9. The implemented code is divided also into two parts: the first part defines the text and level within the program interface for the RemoteXY program and defines a library for temperature and humidity sensors, whereas the second part programs the texts and levels to display temperature and humidity data. This code is presented in Appendix C.  Table 4. The main components used to control the humidity and temperature system.

Component Definition Technical Specifications
Heat and Humidity Sensor (DHT11 Module) -This sensor gives a digital signal that is in line with temperature and humidity and these signals are easy to read by the Arduino unit.
-It consists of three pins as follows: (1) the VCC, which is the positive voltage connected to 3.3 V and 5.5 V.
(2) the GND which is connected to the Arduino's ground.
(3) the OUT which sends temperature and humidity data to the Arduino.
-Digital reading and using a single exit.
-Standard measurement indicator: 1% for humidity and 1 • C for heat. -Measurement changes factor over sensitive age: ±1% for humidity/year.
The control circuit of this system is constructed by connecting the sensor VCC terminal to the 5 V output of the Arduino; the sensor GND to the Arduino GND; and the sensor's OUT to port no. 13 on the Arduino from which it receives the signal. This circuit is presented in Figure 9. The implemented code is divided also into two parts: the first part defines the text and level within the program interface for the RemoteXY program and defines a library for temperature and humidity sensors, whereas the second part programs the texts and levels to display temperature and humidity data. This code is presented in Appendix C.

Fire Alarm System
The purpose of this system is to turn on an alarm when there is a fire detected inside the house. The implemented graphical user interface on the Android phone is presented in Figure 10. The main required components for this system are illustrated in Table 5. Figure 9. The control circuit for displaying the temperature and humidity in the smart home.

Fire Alarm System
The purpose of this system is to turn on an alarm when there is a fire detected inside the house. The implemented graphical user interface on the Android phone is presented in Figure 10. The main required components for this system are illustrated in Table 5.

Fire Alarm System
The purpose of this system is to turn on an alarm when there is a fire detected inside the house. The implemented graphical user interface on the Android phone is presented in Figure 10. The main required components for this system are illustrated in Table 5.  Figure 10. The graphical user interface on the phone for controlling the fire alarm system in the smart home. Table 5. The main components for the fire alarm system in the smart home.

Component Definition Technical Specifications
Flame Sensor -It is used to detect fire or light sources of wavelength in the range of 760-1100 nm. This sensor is of a YG1006 type which is a light transistor.
-It can detect infrared radiation from the flame and detect fire in a range of 60 degrees Celsius.
-This sensor has four pins as follows: (1) the VCC which is the voltage supply from 3.3 V to 5.5 V.
(2) the GND which should be grounded.
(3) the OUT-D which is responsible for the digital output of the signal.
(4) the OUT-A which is responsible for the analog output of the signal.
-The ability to output digital signals (high and low). The control circuit of this system is constructed as follows. The Arduino port is connected to a power source; the VCC terminal of the sensor is connected to the 5-volt terminal of the power source; the GND end of the sensor is connected to the ground; and the D-OUT for the sensor is connected to the port no. 6 of the Arduino unit. This circuit is shown in Figure 11. The executed code for this part is presented in Appendix D.
Automation 2022, 3, FOR PEER REVIEW 11 Table 5. The main components for the fire alarm system in the smart home.

Component Definition Technical Specifications
Flame Sensor -It is used to detect fire or light sources of wavelength in the range of 760-1100 nm. This sensor is of a YG1006 type which is a light transistor.
-It can detect infrared radiation from the flame and detect fire in a range of 60 degrees Celsius.
-This sensor has four pins as follows: (1) the VCC which is the voltage supply from 3.3 V to 5.5 V.
(2) the GND which should be grounded.
(3) the OUT-D which is responsible for the digital output of the signal.
(4) the OUT-A which is responsible for the analog output of the signal.
-The ability to output digital signals (high and low). The control circuit of this system is constructed as follows. The Arduino port is connected to a power source; the VCC terminal of the sensor is connected to the 5-volt terminal of the power source; the GND end of the sensor is connected to the ground; and the D-OUT for the sensor is connected to the port no. 6 of the Arduino unit. This circuit is shown in Figure 11. The executed code for this part is presented in Appendix D. Figure 11. The control circuit for the fire alarm system in the smart home.

Toxic Gas Leak Warning System
The main objective of this system is to turn on an alarm in the event that toxic gases (CH4, CO, or H2S) are leaking and their air-concentration levels rise inside the house. The graphical user interface on the android phone is the same as the one presented in Figure  10. The main components for this system are presented in Table 6. Figure 11. The control circuit for the fire alarm system in the smart home.

Toxic Gas Leak Warning System
The main objective of this system is to turn on an alarm in the event that toxic gases (CH 4 , CO, or H 2 S) are leaking and their air-concentration levels rise inside the house. The graphical user interface on the android phone is the same as the one presented in Figure 10. The main components for this system are presented in Table 6. Table 6. The main components for the toxic gas warning system in the smart home.

Component Definition Technical Specifications
Gas Sensor (MQ2) -It is used in the MQ series sensor.
-It is a metal oxide sensor (MOS) and known as Chemiresistors because detection depends on changing the resistance of the sensor when the gas comes into contact with the substance.
-Using a simple voltage divider network, gas leakage can be detected.
-This sensor detects many types of toxic gases such as LPG, smoke, alcohol, propane, hydrogen, methane, and carbon monoxide.
-The sensor consists of four pins as follows: (1) the VCC which is connected to a positive voltage of 5 V.
(2) the GND which should be grounded.
(3) the OUT-D which is responsible for outputting the digital signal.
(4) the OUT-A which is responsible for the analog output of the signal.
-Power consumption: mW > 800 -Sensor resistance: 5% ± 33 Ω -Operating voltage: 5 V -Focus range: 200-10,000 ppm The control circuit of this system is constructed as follows. The Arduino port is connected to a power source; the VCC terminal of the sensor is connected to the 5-volt terminal of the power source; the GND end of the sensor is connected to the ground; and the D-OUT for the sensor is connected to the port no. 6 of the Arduino unit. This circuit is presented in Figure 12. The executed code for this system is presented in Appendix E.

Component Definition Technical Specifications
Gas Sensor (MQ2) -It is used in the MQ series sensor.
-It is a metal oxide sensor (MOS) and known as Chemiresistors because detection depends on changing the resistance of the sensor when the gas comes into contact with the substance.
-Using a simple voltage divider network, gas leakage can be detected.
-This sensor detects many types of toxic gases such as LPG, smoke, alcohol, propane, hydrogen, methane, and carbon monoxide.
-The sensor consists of four pins as follows: (1) the VCC which is connected to a positive voltage of 5 V.
(2) the GND which should be grounded.
(3) the OUT-D which is responsible for outputting the digital signal.
(4) the OUT-A which is responsible for the analog output of the signal.
-Power consumption: mW > 800 -Sensor resistance: 5% ± 33 Ω -Operating voltage: 5 V -Focus range: 200-10,000 ppm The control circuit of this system is constructed as follows. The Arduino port is connected to a power source; the VCC terminal of the sensor is connected to the 5-volt terminal of the power source; the GND end of the sensor is connected to the ground; and the D-OUT for the sensor is connected to the port no. 6 of the Arduino unit. This circuit is presented in Figure 12. The executed code for this system is presented in Appendix E.  Figure 12. The control circuit for the toxic gas warning system in the smart home.

Experiments
All the components controlled by the five applications are rigidly connected to a wooden board/panel to simulate the smart home, as shown in Figure 13.

Experiments
All the components controlled by the five applications are rigidly connected to a wooden board/panel to simulate the smart home, as shown in Figure 13.  All the developed smart home applications and systems are investigated using the created GUI on the mobile phone. The user turns the ON and OFF switches for the three lamps easily using the mobile phone interface. The two electrical sockets are tested by connecting them to two mobile chargers. When the user switches the socket to ON, the mobile device starts charging and when the person turns it to OFF, the mobile charging is stopped. The user can increase and decrease the speed of the two fans easily using the graphical user interface. The temperature and the humidity data for the surrounding air are displayed correctly in the graphical user interface. When there is a flame or gas leakage detected, the sensors activate their respective alarm system. In conclusion, the developed smart home applications work efficiently and correctly. A demo video for these experiments is available at the following link: https://www.youtube.com/watch?v=LlYoM6kFP_A&t= 19s (accessed on 12 June 2022).
Supplementary materials are attached to this paper and available for any interested researcher which contain the implemented code, the used Arduino software, the used alarm voices, and the RemoteXY.

Conclusions and Future Work
For this paper, five applications for the smart home were successfully developed and controlled via an Android mobile phone and an Arduino platform. The applications control the lighting and electrical sockets, the fan speed control, the temperature and humidity display, the fire alarm system, and the toxic gas alarm system in a simulated smart home. The required components for these systems were procured and then the controls and wiring circuits were implemented. A GUI designed for use on a mobile phone was created using the RemoteXY software. The developed systems were tested and found to be working efficiency. Finally, this concept is very cost-effective which indicates an encouraging probability of mass adoption and commercialization of similar systems. Furthermore, these systems are easily utilized by beneficial for people with disabilities, those suffering from injury, and elderly populations. In future research, Arduino units could be connected to Android mobile phones via Wi-Fi. In addition, different controllers could be used and investigated such as PLCs. The focus of this paper could also be expanded to the level of smart city applications.

Supplementary Materials:
The following supporting information can be downloaded at: https: //www.mdpi.com/article/10.3390/automation3040029/s1, the implemented code, the used Arduino software, the used alarm voices, and the RemoteXY. Code S1: The implemented code for smart home applications in Arduino unit.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. The Executed Code Used to Control Lighting and Sockets
Automation 2022, 3, FOR PEER REVIEW 15 Appendix A. The executed code used to control lighting and sockets. Figure A1. The first part of the executed code used to control lighting and sockets.
Identify light keys within RemoteXY's software interface.
This part is for the pins name (13,14,15) as "PIN_SWITCH_1, PIN_SWITCH_2, PIN_SWITCH_3" respectively. This part is specific to the definition Figure A1. The first part of the executed code used to control lighting and sockets.    Identify sliders within RemoteXY's software interface.
This part is for the pin name number (9). This part is specific to the definition of the state of sliders, so these sliders are outputs.  This part is specific to the definition of the state of sliders, so these sliders are outputs.
Pulling the slider to the right increased fan speed.

Appendix C. The Executed Code for Programming the Heat and Humidity Sensor
Automation 2022, 3, FOR PEER REVIEW 17 Appendix C. The executed code for programming the heat and humidity sensor This part is about the library known heat sensor, and the name pin number13 called DHTPIN. This pin is the one that gets the sensor out.
Define a variable called (temp) to put the value of the temperature and define a variable with the name (hum) to put the value of humidity.   This part is about the library known heat sensor, and the name pin number13 called DHTPIN. This pin is the one that gets the sensor out.
Define a variable called (temp) to put the value of the temperature and define a variable with the name (hum) to put the value of humidity.
The value of the temperature is placed in its (Text) inside the program interface and put the value of the humidity in its (Text) inside the program interface.
The value of the temperature is placed in its (Level) and if the temperature is less than zero the level does not move and if the temperature is greater than zero the level moves by the temperature.
This part puts the value of the degree of humidity in its (Level) as the (Level) moves with the degree of humidity. Figure A6. The second part of the executed code used to program the heat and humidity sensor.

Appendix D. The Executed Code for the Fire Alarm System
Automation 2022, 3, FOR PEER REVIEW 18 Appendix D. The executed code for the fire alarm system Figure A7. The implemented code for the fire alarm system.

Appendix E.
The executed code for the toxic gas leak system This section is for naming: where pin 3 is named (flame_sensor_1) and pin 5 is named with (alarm_for_flame).
This part is for defining the state of the pins as the pin (flame_sensor1) is entered/the input, but the pin (alarm_for_flame) is the output.
When the first sensor or the second sensor detects a flame, the alarm is triggered. In the event that the first sensor does not sense, and the second sensor does not sense, the alarm is stopped.
This is the section for naming: where pin 6 was named (gas_sensor) Figure A7. The implemented code for the fire alarm system. detects a flame, the alarm is triggered. In the event that the first sensor does not sense, and the second sensor does not sense, the alarm is stopped.
This is the section for naming: where pin 6 was named (gas_sensor) and pin 7 was named (alrm_for_gas).
This part is defining the state of the pins as the pin (gas_sensor) is entered/ the input, but the pin (alrm_for_gas) is the output.
When the gas sensor senses that there is a gas leak, it activates the alarm.
When the gas sensor senses that there is no gas leak, it stops the alarm. Figure A8. The implemented code for the toxic gas leak system.