ISSN : 1978-8282. Online ISSN: 2655-4275 Build Smart Home Controls Using Wemos Microcontroller-Based Telegram App Freddy Artadima Silaban*1. Rendy Elmianto2. Lukman Madriavin Silalahi3 1,2,3 Program Studi Teknik Elektro. Fakultas Teknik. Universitas Mercu Buana Jakarta Email : *1freddy. artadima@mercubuana. id, 2rendyelmianto77@gmail. medriavin@mercubuana. Abstract Current technological developments are very fast and progressing. One of the developments that occurs in the IoT (Internet Of Thing. Many IOT (Internet Of Thing. systems already have open source and can be suitable as needed, therefore by utilizing technological advancements, lamp controllers and house doors are made using Telegram applications. This control system can carry out home communications and control home electronic devices such as lights and house doors remotely using the Wemos and Arduino UNO microcontrollers. The Telegram application is used to send commands connected to the io. com server. This system can provide notifications sent to the Telegram application when the house door is opened. The conclusion of the results obtained when the tool needed to communicate with the server is 12. 94 seconds. For the voltage of 4 lights A 220 V AC and for servo voltage A 4. 8 V DC. For the response time of the tool to the server A 3 seconds, while the response time of the tool to Nextion LCD is A 1 second. Keywords Ai Microcontroller. Wemo. Arduino Uno. Telegram. Internet Of Things. Server INTRODUCTION Technological advances are now fueling the human mindset to be able to create innovations to facilitate work for better performance. The emergence of the Android operating system that most humans consider to be an easy-to-operate, flexible, and unlimited operating system for building their own applications, led to the proliferation of user-generated applications themselves. At this time, there is already a lot of use of android smartphones in controlling household appliances, for example to enable or disable lights in or in the yard or lights in the house and residents of the house are not at home for example, the occupants of the house must walk to the switch to open and close the circuit. Usually, it causes a sense of lazy or reluctant to move when someone is on the bed. When on the go, sometimes someone forgets to turn off the lights. Undeniably, people nowadays can be said to be very close to smartphones, especially androids that have anywhere even when going to sleep. [ 4-. One aspect that is considered is the issue of home security. The cause of theft is due to lack of security on the door especially on the main door, such as the living room door. Security at the door is an obligation for all homes. The door is a tool as in or out of a room. Doors are generally controlled directly by the homeowner and it is quite troublesome if the homeowner is in a different room if he wants to control the door. The environmental security system is basically less efficient because when there is a security disturbance officers do not quickly know because it is not real time. Officers have to go around to control security that takes time and effort. Information received when there is interference is not real time so the handling is late. The owner of the house does not know the state of his house when traveling due to the absence of a device that can tell directly if the house has entered an unknown person. From the description of the problem above, the tool that will be made has security features and more efficient use by using Wemos Control can be done on Android smart phones by using the Telegram Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 application that can control the lights in each room and lock and open the main door in the house, such as the living room door and kitchen room door so that it adds efficiently for the RESEARCH METHOD The control system designed is a control system used to control lights and doors of the house via an internet connection using a smartphone using the telegram chat app. With this system, these devices can be controlled anytime and anywhere through the Telegram chat app, as well as provide security notifications to the Telegram chat app if the door of the house is opened by force. Figure 1. Diagram of How the System Works The advantages of the system made in this research with similar products on the market are: the price of tools and materials used is cheaper, applications and supporting servers are free, in addition wemos microcontrollers used have features and specifications that make it possible to create or develop larger systems. Power ON WiFi:Stasion Connecting to WIFI Connected? Tidak Connecting to Server Nextion LCD Touchscreen Tidak Connected? Sistem Ready Figure 2. How The System Workflow Works Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 In figure 2 is a workflow on the system created is as follows: In this design made two systems, namely control system and security system. In the control system the user can control in two ways, firstly using the telegram chat application to turn off and turn on the lights and open and close the door in real time, secondly by using the Nextion LCD touchscreen to turn off and turn on the lights in real Meanwhile, in the security system, magnetic sensors have been added to the door of the house, so that if the door is opened forcibly then the user can receive notifications through the telegram chat application. When the system is turned on, the WiFi on the Wemos microcontroller is in "station" mode, then the system will try to connect with the WiFi connected to the system, if the connection is successful then the Wmos microcontroller will be connected to the com server, and the system is ready to use . Actually. Wemos can act as an Access Point, so it can be connected directly with a smartphone. But with this configuration. Wemos can only be controlled for a limited distance. Therefore, this design uses the server io. com as a connecting media between smartphones and Wemos from a long distance. Whereas if the connection fails or the internet is in disruption, then the user can use the Nextion LCD touchscreen for manual control. In figure 3 describes the flow of how the door control system works in the following way: Start, is a condition when the user is working on his operational activities that is closing or opening the door. User selects door control options. In this design made the selection of options as many as two doors, and use two methods of activation, namely activation through the telegram chat application and using the Nextion LCD touchscreen. Next the user will choose one by one the door is controlled and then the user will choose the method of activation used, namely through the Telegram chat application or using the Nextion LCD touchscreen. For the method of activation through the Telegram chat application, the user must send a command sentence that has been set on the IFt applet to control the selected door. Once processed on the IFt applet, the data is then sent as a trigger on the Trigger received by the server io. com processed by Wemos microcontroller to drive the servo. If the command to open the door, then the servo unlocker works first then the door opener servo works. If the order to close the servo door cover works first then the servo door cover works. For the method of activation using the Nextion LCD touchscreen, previously the user must press the reset button and then press the on button on the touchscreen screen if they want to control the selected door. The Control Design consists of several main hardware, including: Wemos D1 R1 microcontroller . Arduino microcontroller . Nextion LCD Touchscreen As well as additional hardware to perform the functions of input sensors and output indicators, . Magnetic sensor . Relay as well as lamp as output . Servo Sg90 Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 Sistem Ready BUKA Nextion LCD TIDAK Aplikasi Telegram? Buka/Tutup TUTUP Pintu? Aplikasi Telegram? TIDAK Nextion LCD Applet IFt Server Mikrokontroler Wemos Servo Membuka Slot Kunci 1 Servo Membuka Pintu 1 Applet IFt Server Mikrokontroler Wemos Servo Menutup Pintu Servo Mendorong Slot Kunci 2 Selesai Figure 3. Door Control System Workflow Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 Rangakain smart home hardware as a whole can be seen in figure 4. Figure 4. Entire Series . Wemos microcontroller As the main controller used Wemos microcontroller with ESP8266 chip that supports WiFi connection. This microcontroller is connected to arduino microcontroller using I2C communication on SDA and SDL pins. Wemos microcontroller is used as magnetic sensor input regulator, for D12 pin is used as magnetic sensor input controller 1 and D13 pin for magnetic sensor input 2. Arduino microcontroller The pin used as the output is the pin on the Arduino microcontrolle. Pin 2,3,4,5 is used for relay output lamp 1 to relay lamp 4. These pins are connected to the IN pin on each relay. VCC relay pin is connected to V on 5V power supply. GND relay pin is connected to AeV in power supply. Relays use normally open (NO), so when the relay gets a high signal from the microcontroller then the light is on, and vice versa. Nextion LCD Touchscreen Nextion HMI LCD is equipped with the help of Nextion Editor software with a large 2 inch screen, this touchscreen module has 4 cable sockets connected to arduino microcontroller, including cable 1 as vcc connected to power supply 5V, cable 2 connected on pin A0 (TX), cable 3 connected on pin A1 (RX) and cable 4 as ground, this LCD can display a lot of data and to make user interface enough to make design on the nextion editor , copy to LCD via SD Card or flashing via USB to Serial then Nextion LCD displays the desired interface. Configuration of Relay Lights and Relay Alarms The controlled lamp is a 220V AC lamp so it uses a PLN power source to turn on the The power source phase of PLN is connected to the COM pin on the relay, then the lamp is connected to pin NO . ormally ope. on the relay. The ground side of the lamp is made one and then connected to the pln power source ground. The lights turn on when the relay is on and vice versa. To control the magnetic sensor by connecting the 3 V pin on the Arduino microcontroller to the COM pin on the relay. While pin NO . ormally ope. is Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 connected to D2 pin microcontroller Wemos. So when the relay is active, the D2 pin gets a HIGH signal that makes the alarm active and vice versa. Figure 5. Relay Circuit Lights and Alarms . Servo Sg90 Configuration A servo motor is a DC motor with a closed feedback system where the rotor position is informed back to the control circuit inside the servo motor. The motor consists of a DC motor, a series of gears, a potentiometer, and a control circuit. The potentiometer serves to determine the angle limit of the servo rotation. While the angle of the servo motor axis is set based on the width of the pulse sent through the signal foot of the servo motor cable. In this design used Sg90 type servo motor connected on pin 6,7,8,9 on Arduino microcontroller. Servo motors are used to open or close doors and move door lock slots. Figure 6. Servo Suite . Designing server io. com is a new platform that allows to quickly build interfaces to control and monitor hardware projects. On the server io. com can be created project dashboard and set buttons, sliders, graphics, and widgets. In this case the dashboard is made in the form of button settings. The button is connected to the IFt applet, so when the IFt applet gets a command from the Telegram chat app, the IFt applet triggers to change the dashboard status of the button on the io. com server, as in figure 7. Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 Figure 7. Feed Naming RESULTS AND DISCUSSION After completion of the design stage, testing of the application and electronic circuits that have been made to find out if the program has been implanted runs and works as As well as avoiding possible errors. MQTT Server Communication Testing This test was conducted to find out how long it would take a Wemos microcontroller to communicate with the MQTT server. The time is calculated from the start of the tool is turned on until it successfully communicates with the MQTT server. If the LED indicator on the Wemos microcontroller has been lit indicates that the Wemos microcontroller has successfully communicated with the server. Table 1 is the result of MQTT server communication test. Table 1. MQTT Server Communication Testing Percobaan Waktu . Hasil Percobaan 1 13,70 Sesuai Percobaan 2 12,90 Sesuai Percobaan 3 13,01 Sesuai Percobaan 4 Sesuai Percobaan 5 12,50 12,67 Percobaan 6 12,20 Sesuai Percobaan 7 13,43 Sesuai Percobaan 8 13,61 Sesuai Percobaan 9 12,07 Sesuai Percobaan 10 13,40 Sesuai Sesuai . Full Application Testing This test is done to find out the tools in this research work according to function and The testing process is carried out gradually through the telegram chat application there Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 are two categories of control features on telegram bots namely the first feature for light controllers and the second feature for monitoring the status of magnetic sensors with Wemos Here's an early look at the features on the telegram bot. Figure 8. Initial View On Telegram App To start using the Telegram chat app as a control system, type a previously set command sentence. Table 2. Testing On Telegram App Against Tools Perintah Lampu 1 Manghidupkan Sesuai Lampu 1 Mematikan Sesuai Vol. 14 No. 1 Ae February 2021 Fungsi Foto Hasil Pengujian Hasil ISSN : 1978-8282. Online ISSN: 2655-4275 Perintah Fungsi Foto Hasil Pengujian Hasil Buka pintu Membuka pintu Sesuai Tutup pintu Menutup pintu 1 Matikan Mematikan fungsi alarm Matikan Mematikan fungsi alarm Sesuai Sesuai Sesuai Table 3. Output Response Time Testing Waktu saat (On/Buk. Waktu saat (Off/Tutu. Nama Percobaan Rata-rata Lampu 1 1,2 2,3 3,1 2,48 1,6 2,1 2,26 Lampu 2 3,5 2,6 1,8 2,98 1,9 1,7 2,5 1,9 3,1 2,22 Percobaan Vol. 14 No. 1 Ae February 2021 Rata-rata ISSN : 1978-8282. Online ISSN: 2655-4275 Waktu saat (On/Buk. Waktu saat (Off/Tutu. Percobaan Percobaan Nama Rata-rata Rata-rata Lampu 3 3,2 3,6 2,7 1,4 2,1 2,4 2,6 1,5 2,6 2,62 Lampu 4 4,2 2,6 1,2 2,6 1,4 3,7 1,7 2,36 Pintu 1 1,3 1,5 2,6 3,4 2,16 3,6 2,7 1,3 4,7 2,88 Pintu 2 2,8 2,1 2,64 Based on the test result data in table 3 above obtained the results of the average response time of interactive chat Bot Telegram with the tool using one of the telecommunication providers as an internet source. Security Application Testing The security application serves to turn on the security system at home, namely by sending command sentences on the telegram chat application that has been created before. Once the alarm is activated, the home security system is automatically activated. Where later magnetic sensors detect movement if the door of the house is opened by force. If the magnetic sensor detects movement then the alarm in the house immediately lights up, the alarm stops if the magnetic sensor returns to its original state. Not only does it set off alarms, app users or homeowners receive information through the telegram chat app, which states that someone is trying to force open the door of the house. Table 4. Magnetic Sensor Testing Sensor Magnetik Buzzer Notifikasi Tidak Aktif Tidak Aktif ui Aktif Aktif ui Aktif Aktif ui ui Aktif Aktif Table 4 found that magnetic sensors can detect and send notifications if one or both magnetic sensors are actively detecting. Vol. 14 No. 1 Ae February 2021 ISSN : 1978-8282. Online ISSN: 2655-4275 Table 5. Magnetic Sensor Testing Against Distance Sensor Magnetik No Jarak Buzzer Notifikasi Waktu . 1 cm Tidak Aktif Tidak Aktif 2 cm ui ui Aktif Aktif 3 cm ui ui Aktif Aktif 4 cm ui ui Aktif Aktif 5 cm ui ui Aktif Aktif 6 cm ui ui Aktif Aktif In table 5 that the magnetic sensor detects from a distance of at least 2 cm. As for the magnetic sensor response time to buzzer and A 3 seconds. CONCLUSION Based on the above tests, it can be concluded that the whole program can run well in accordance with the initial command. From magnetic sensors as door safety to controlling applications contained in the system. But it should be noted to be able to use prototypes on smartphone devices need to be made settings on IFt and io servers, adafruit,com which is useful for processing data from prototypes to databases located on io. In the prototype also seen that the application is quite responsive and accurate, there is a slight delay that occurs when all applications and microcontrollers Wemos communicate, this is because wemos microcontroller communicates reading data on the server io. com first and then just respond to the command. This is evidenced by a more responsive manual system compared to the system using the Telegram chat application. The delay does not much affect the work of the application when executed until all components on the electronic circuit SUGGESTED For lamp or door control can use other methods such as web, android applications, sms and server io,adafruit,com and IFTT is still open source so that it is possible to be accessed by others, perhaps for developers can then be created tools and systems using the internet server itself, so that the system is made more secure. REFERENCES