1. Introduction
Automation is the automatic control of smart domestic devices such as lights, thermostats, appliances, alarm systems, and security cameras. More precisely, it is an ecosystem in which all the elements communicate wirelessly with each other – and with the homeowner. Home automation offers many advantages, including comfort, security, convenience, and energy efficiency [1-2]. There are many examples of the benefits of home automation, including: unlocking the front door remotely to, and controlling the thermostat to turn up the heat or activate the A/C while one is away from home.
Automation system can control commonplace household items like thermostats and lightbulbs remotely when they are linked to the internet and become part of the Internet of Things (IoT) [3-4]. This network connects all of the Internet of Things (IoT) devices and allows voice assistants or apps to control each one individually. One can use a smartphone app to control a home automation system that is linked to Internet of Things devices, such as turning on and off the heating while at work or scheduling the outside lighting to turn on before one gets home from work. Additionally, a lot of these gadgets have sensors built in that provide information about the environment [5-7].
NodeMCU is an open source Internet of Things (IoT) platform, an MCU development board with Wi-Fi functionality. Arduino was widely used when initially performing IoT-based projects, but Arduino does not directly provide a Wi-Fi module. NodeMCU uses the ESP8266-12 module from ESPRESSIF, which developed the ESP8266 Wi-Fi module. NodeMCU is an MCU for the IoT node, as its name suggests, and can be thought of as an Arduino with network functionality implemented in a small size and low price. NodeMCU provides convenience by being able to develop using the same IDE as Arduino. NodeMCU uses the MQTT protocol with other IoT devices. MQTT is a protocol developed to communicate asynchronously between devices with minimal power and packet volume, and is suitable for M2M and IoT-type object-to-object communication for remote control and measurement purposes. In particular, it is excellent for building a network environment suitable for periodically exchanging information by minimizing overhead with small bandwidth in the industrial field, mainly for IoT sensors such as temperature, humidity, pressure, lighting, and carbon dioxide [8-10].
The goal of this study is to implement a user-friendly IoT-based automation using MQTT protocol and open source based hardware. The proposed system monitors environmental information such as temperature, humidity, and lighting inside the home [11-14]. The environmental information can be monitored through the system and checked and controlled in real time from the outside. The features of this paper are as follows. First, home automation is implemented using open source-based hardware. This allows home automation to be implemented at a lower cost than existing expensive hardware. Second, real-time monitoring of environmental data is possible using the MQTT protocol. While existing home automation can be monitored in real time through telecommunications contracts, this study implemented real-time monitoring using only open source.
The organization of this paper is structured as follows: Section 2 presents the system design, Section 3 introduces the implementation, Section 4 discusses the results and finally, Section 5 concludes the paper.
2. Proposed system
Fig. 1 illustrates the design of the proposed smart house prototype. Two rooms, a kitchen, a bathroom, and a balcony make up the smart home. The kitchen is equipped with a ventilator. The system of the suggested architecture, comprising its various components, is shown in Fig. 2. A variety of sensors, including the temperature and humidity sensor DHT11, the PIR motion sensor HC-SR 505, the gas sensor MQ2, and the rain sensor YL-83, are used in the design and implementation of an Internet of Things (IoT) based home automation system. The sensors measure various parameters, including smoke, gas leakage, temperature, and humidity. The actions of the household's electronic equipment are managed by multiple actuators. The dashboard controls the fans and lights. A graphical user interface (GUI) guarantees the users' comfort and safety while facilitating user-system interaction. There is a door with a motor and motion sensor at the home's main entrance. Motion is detected by this door-mounted PIR motion sensor. By doing this, the door will open and close on its own.
Fig. 1 Prototype of smart home
Fig. 2 Diagram of system architecture
Our smart home automation system uses web services as an interoperable application layer. The system has a micro web server that is based on Arduino ethernet and hardware interface module. The proposed system allows authorized users to control and monitor connected appliances. A graphical user interface (GUI) for accessing and controlling the devices is provided by the webserver. First of all, the ESP8266 is connected to the power switch. After that, it is connected to Wi-Fi and it gathers the data from different sensors. Then it sends the data to the MQTT dashboard. If the gas is detected from the gas sensor, the exhaust fan of the kitchen is ON. Otherwise, the exhaust fan is OFF. If the temperature value is greater than the threshold value, the room fan or AC is ON. Otherwise, the fan or AC is OFF. If it is raining, then the rain detector detects it and the window is shut down. Otherwise, it is open.
3. Implementation
Our experiment's home automation system consists of an ESP8266, also known as the Node-MCU board v2, temperature, gas, motion, humidity, LED, potentiometer, and motor drivers. Fig. 3 illustrates the system's physical components.
Fig. 3 Embedded board and senrors
a) The Node-MCU 1.0 (ESP-12E Module) is an Internet of Things development board that utilizes Wireless 802.11 b/g/n standards and supports three operating modes: STA/AP/STA+AP. It is composed of an ESP8266 SoC that integrates a 32-bit microcontroller. The NodeMCU/ESP8255 microcontroller served as the prototype's central unit for the study. Using jumper cables, we attached each component to the microcontroller board. Through the four channel relay board, actuators such as the potentiometer, fan, and light are controlled. The battery or another power source could be the source of electricity.
b) 5V DC relay module with 4 channels. It is widely recognized that a low power signal can effectively regulate a high power circuit. Typically, a DC signal is utilized to operate a circuit that is powered by a high voltage, such as when microcontrollers are employed to control AC home appliances. Relay boards are used to regulate high voltage AC appliances, such as washing machines with fans. A 4-channel relay module was employed. We used the relay module to connect to the AC, fan, and light.
c) A temperature sensor, DHT11. DHT11 sensors are typically used to measure an area's humidity and temperature. It functions by using a relay module to trigger associated devices [20]. One of the most widely used and affordable temperature sensors is the DHT11. There is also DHT22. However, it is expensive and unavailable. Using this sensor, we were able to monitor the humidity and temperature. The microcontroller board is attached to it.
d) Gas sensor MQ2. The MQ2 gas sensor is an electrical device that detects airborne gases, including carbon monoxide, alcohol, hydrogen, propane, methane, and LPG. Chemical-resistor is another name for the MQ2 gas sensor. When the sensor material comes into contact with the gas, it changes resistance. It has a detection range of 200 to 10,000 parts per million for gases. Gas sensors come in various varieties, including MQ4, MQ5, MQ7, and so forth. We specifically utilized the MQ2 gas sensor in the smart home's kitchen.
e) The HC-SR 505 PIR motion sensor. An electronic sensor that detects infrared (IR) light emitted by objects within its field of vision is called a passive infrared (PIR) sensor [21]. PIR sensors are frequently found in autonomous lighting systems and security alarms. We employed the imaging motion sensor in this investigation. It recognizes when someone is at the door. With the motion detector, we can keep an eye out for potential intruders from a distance.
f) YL 83 is a sensor for rain. The electronic board and the collector board are its two constituent sections. The droplet detection principle underlies its operation. The electronic board receives a signal if raindrops land on the collection board. In order for the collector board to catch raindrops, we placed it on the open porch. Since we can obtain the figure in two minutes, we have opted for YL 89.
When current passes through a light-emitting diode (LED), a semiconductor light source, light is released. Photons are released as a result of the semiconductor's electrons and electron holes recombining. The energy needed for electrons to bridge the semiconductor's bandgap determines the color of the light, which is correlated with photon energy. The first LEDs were workable electrical components that emitted low-intensity infrared (IR) light in 1962. We visualized a device's state using the LED. Assuming the door detects motion, the LED will turn on. This serves as an indicator to display the sensors' or devices' current state.
The prototype of the dashboard is implemented using Arduino IDE. Ubidot IoT server monitors the condition of home environmental parameters and controls the home electronic devices through the MQTT protocol. A graphical user interface (GUI) is for controlling the devices with fingertips on a mobile screen. First of all, we implemented all the sensors and actuators in the breadboard. The enhancement program is conducted in the virtual breadboard shown in Fig. 4. Next, we put it into practice on the actual breadboard seen in Fig. 4.
Fig. 4 Diagram of system architecture
Fig. 5 Prototype of smart home system
To develop an android application, we need to set up an Android IDE with some custom settings to access the PAHO library which is an MQTT client library. This library is written in Java. This is used especially for developing applications on Android [25]. The Paho has been created to provide a reliable open-source platform. It implemented an open and standard messaging protocol. The intension was to give a new and emerging application for Machine-to-Machine (M2M) and the Internet of Things (IoT). Paho provides the subsequent amenities:
1) Opens up device connectivity beyond financial and physical limitations.
2) It offers degrees of decoupling between apps and devices that are effective.
3) It creates corporate and online middleware and apps that are scalable.
4) For those who wish to use it, Eclipse maintains a Nexus repository.
5) It arranges a build environment and controls the dependencies of the applications so that we can receive the Paho Android Service from the same repository.
4. Results
Since every user has a different dashboard on the server, the initial activity here enables the user to scan a QR code to obtain server information. The user is prompted to connect to the MQTT broker in the second activity, and all of the data supplied by the broker is displayed in the third activity. The appliances are under our control via the MQTT dashboard. The light is on, the motion detector indicates NORMAL condition, and the rain detector indicates DETECTED, meaning that it is raining and no one is waiting in front of the entrance, as seen in Fig. 6.
Fig. 6 Dashboard for home automation
Fig. 6 illustrates the application of smart monitoring. Since every user has a different dashboard on the server, the initial activity here enables the user to scan a QR code to obtain server information. The user is prompted to connect to the MQTT broker in the second activity, and all of the data supplied by the broker is displayed in the third activity. The appliances are under our control via the MQTT dashboard. The light is on, the motion detector indicates NORMAL condition, and the rain detector indicates DETECTED, meaning that it is raining and no one is waiting in front of the entrance, as seen in Fig. 6.
The cost of the sensors and actuators necessary to construct a smart home varies little depending on which manufacturer they are from. However, the Node-MCU or ESP8266 microcontroller board costs more. Because of this, the price of the microcontroller board has a major influence on how much implementing a smart home will cost. Table 1 provides the comparison analysis. We contrasted four microcontroller boards (ESP8266) in terms of price and performance. The ESP8266 turns out to be the top performance. Galileo board is excessively expensive. The Arduino Uno requires an additional board for the extension and consumes more current and voltage. We made a comparison of the cost parameters, SRAM, digital I/O, clock speed, operating system, and DC current.
Table 1. Specification of micro-controller board
5. Conclusion
Home automation based on IoT is one of the promising and essential issues in recent times. It provides a comfortable living. In this paper, we implemented an IoT-based low cost and flex ible home automation system through a mobile android app. We used ESP8266 as a microcontroller board with the Wi-Fi module. However, in future work, we will develop a smart building and as well as a smart city. The big challenge is to manage all in real-time data in a well-organized pattern.
The limitations of this paper are as follows. Since it is implemented as open source, it can achieve the same performance as a commercial system with inexpensive hardware and sensors. However, when making an actual product, the software copyright must be clearly confirmed and made.
Acknowledgments
This research was supported by "Regional Innovation Strategy (RIS)" through the National Research Foundation of Korea(NRF) funded by the Ministry of Education(MOE)(2021RIS-003).
References
- W. A. Jabbar, T. K. Kian, R. M. Ramli, S. N. Zubir, N. S. M. Zamrizaman, M. Balfaqih, and V. Shepelev, "Design and Fabrication of Smart Home With Internet of Things Enabled Automation System," IEEE Access, Vol. 7, pp. 144059-144074, (2019). https://doi.org/10.1109/ACCESS.2019.2942846
- B. Setz, S. Graef, D. Ivanova, A. Tiessen, and M. Aiello, "A Comparison of Open-Source Home Automation Systems," IEEE Access, Vol. 9, pp. 167332-167352, (2021). https://doi.org/10.1109/ACCESS.2021.3136025
- J. Kuang, G. Xue, Z. Yan, and J. Liu, "An Automation Script Generation Technique for the Smart Home," Journal of Web Engineering, Vol. 22, No. 2, pp. 221-254,
- J. K. Park, and E. Y. Park, "Real-Time Monitoring Home Security System Utilizing Iot and Telegram Bot," Mathematical Statistician and Engineering Applications, Vol. 71, No. 3, pp. 507-514, (2022).
- Z. Wang, D. Liu, Y. Sun, X. Pang, P. Sun, F. Lin, J. C. S. Lui, and K. Ren, Z. "A Survey on IoT-Enabled Home Automation Systems: Attacks and Defenses," IEEE Communications Surveys & Tutorials, Vol. 24, No. 4, pp. 2292-2328, (2022). https://doi.org/10.1109/COMST.2022.3201557
- S. W. Tay, N. Zhang, and S. AlJanah, "A Problem Analysis of Smart Home Automation: Toward Secure and Usable Communication-Based Authorization," IEEE Access, Vol. 12, pp. 18103-18121, (2024). https://doi.org/10.1109/ACCESS.2024.3359442
- J. K. Park, and H. Seo, "ZigBee-Based Smart Fire Detector for Remote Monitoring and Control," International Journal of Advanced Science and Technology, Vol. 29, No. 3, pp. 10431-10441, (2020).
- C. S. Abella et al., "Autonomous Energy-Efficient Wireless Sensor Network Platform for Home/Office Automation," IEEE Sensors Journal, Vol. 19, No. 9, pp. 3501-3512, (2019). https://doi.org/10.1109/JSEN.2019.2892604
- F. J. Bellido-Outeirino, J. M. Flores-Arias, F. Domingo-Perez, A. Gil-de-Castro and A. Moreno-Munoz, "Building lighting automation through the integration of DALI with wireless sensor networks," IEEE Transactions on Consumer Electronics, Vol. 58, No. 1, pp. 47-52, (2012). https://doi.org/10.1109/TCE.2012.6170054
- P. Sundaravadivel, K. Kesavan, L. Kesavan, S. P. Mohanty, and E. Kougianos, "Smart-Log: A Deep-Learning Based Automated Nutrition Monitoring System in the IoT," IEEE Transactions on Consumer Electronics, Vol. 64, No. 3, pp. 390-398, (2018). https://doi.org/10.1109/TCE.2018.2867802
- B. Mishra, and A. Kertesz, "The Use of MQTT in M2M and IoT Systems: A Survey," IEEE Access, Vol. 8, pp. 201071-201086, (2020) https://doi.org/10.1109/ACCESS.2020.3035849
- W. A. Jabbar, T. K. Kian, R. M. Ramli, S. N. Zubir, N. S. M. Zamrizaman, M. Balfaqih, V. Shepelev, and S. Alharbi, "Design and Fabrication of Smart Home With Internet of Things Enabled Automation System," IEEE Access, Vol. 7, pp. 144059-144074, (2019). https://doi.org/10.1109/ACCESS.2019.2942846
- J. A. C. Paguay, G. A. H. Brito, D. L. H. Rojas, and J. J. C. Calva, "Secure home automation system based on ESP-NOW mesh network, MQTT and Home Assistant platform," IEEE Latin America Transactions, Vol. 21, No. 7, pp. 829-838,
- A. Flamini, L. Ciurluini, R. Loggia, A. Massaccesi, C. Moscatiello, and L. Martirano, "A Prototype of Low-Cost Home Automation System for Energy Savings and Living Comfort," IEEE Transactions on Industry Applications, Vol. 59, No. 4, pp. 4931-4941, (2023). https://doi.org/10.1109/TIA.2023.3271618