Smart Home with Voice Control Lights Using Arduino Uno R3

— “ The development of science and technology has positively impacted human life, which has now reached the age of electric voice commands. An intelligent home management system allows humans to operate their house's electrical gadgets, such as lighting, using simple voice commands, eliminating the need to move around to switch on or off equipment. When users of indoor lighting use sound waves to operate the system or turn on the lights, the sound sensor sends an input signal to the microcontroller, which is then processed with the microcontroller's output in the form of a voltage to turn on the load. The system will function when the FC-04 sound sensor receives sound input (sound code). The FC-04 sound sensor can only provide a digital output signal with a value of 1 and 0 in the form of a clap, which is then accumulated on Arduino with a value above 400 million by the program uploaded to be used as a 5-volt output to turn on/off the lights. This is because when turning on the lights from a certain distance, several factors can affect it, including setting the sound sensor's sensitivity and noise levels in the surrounding area.


I. INTRODUCTION
In this modern era, the use of control systems is increasing rapidly.In general, control systems assist individuals in making their jobs more accessible; in this instance, a microcontroller is employed as the control system, with sound sensors as input to drive other supporting devices (Aljshamee et al., 2020;Dargie & Poellabauer, 2010;Nelwan et al., 2023).A microcontroller is a functional computer system on a chip that includes a processor core, memory (a small amount of RAM, program memory, or both), and input-output equipment (Valdes-Perez & Pallas-Areny, 2017).The microcontroller differs from the multi-purpose microprocessor used in a PC because it requires a minimum system to process or run it; the minimum microcontroller system is the minimum electronic circuit required to operate the microcontroller IC (Barkalov et al., 2019).This minimum system can then be connected with other circuits to perform certain functions (Hasan et al., 2018).In everyday discussions and internet forums, microcontrollers are often known as µC or uC.
In a free translation of this understanding, it can be said that a microcontroller is a micro-sized computer on one IC chip (integrated circuit) that consists of a processor, memory, and programmable interface (Meidelfi et al., n.d.).It is called a microcomputer because the IC, or microcontroller chip, consists of a CPU, memory, and I/O that we can control by programming (Parai et al., 2013).I/O is also often referred to as GPIO (General Purpose Input Output Pins), which means pins that we can program as input or output as needed (Wootton, 2016).
One of the solutions that may be applied to remedy this issue is an alternative energy system.In this instance, home lighting technology allows the lights to be turned on or off using sound input (Gunputh et al., 2017;Lumbantobing, 2022a).Therefore, we need a tool that can control lights automatically, which are integrated using a microcontroller as a controller (Sadikin et al., 2019).A wireless sound system may use voice commands to switch on or off and replace button operations with sound for various home amenities, including lights, fans, and television (Novani et al., 2020;Parameshachari et al., 2013).The development of voice control for home control with sound wave technology can serve as a reference for future homes where we no longer need to move to turn on and off electrical equipment in a different place in the house (Chattoraj, 2015;Kamarudin et al., 2013).
Based on the background, the problem can be formulated as follows: (i) How can the microcontroller work with sound as input?Furthermore, (ii) creating a microcontroller program in the Arduino IDE software.Limitation of problems "This work is licensed under a Creative Commons Attribution 4.0 International License".
in the design of this system, the authors provide limitations on the problems in this study, including: 1. Software input data processing only uses the Arduino IDE software.2. Only focused on the control system only.3. Does not discuss the capacity used.4.Only discusses the performance of the sound sensor on the microcontroller.
The objectives of this research are: (i) to design a device that can control the system using a sound sensor to the microcontroller and (ii) to instruct the program that has been made so that it can work on the microcontroller.
The working principle of the microcontroller (Kumar et al., 2015)  The microcontroller is one of the essential parts of a computer system; However, it has a much smaller form than a personal computer and mainframe computer.The microcontroller is built from the same essential elements.In simple terms, a computer will produce specific output based on the input received and the program executed, as in general, a computer, a microcontroller is a device that carries out the instructions given to it; that is, the most important and central part of a computerized system is the program itself made by a programmer, this program instructs the computer to perform a long thread of simple actions to perform more complex tasks desired by the programmer (Irawan & Wahyuni, 2021).
Almost all equipment related to our activities has a microcontroller, for example, Mobile phones that we always use to communicate, LCD screens, cars, motorbikes, digital cameras, and much other equipment.However, the point is that every electronic device with a "remote control" must contain almost a microcontroller (Sophia & Musa, n.d.).Even though we deal with these devices daily, many people still do not know what a microcontroller is.How does this tool work?A microcontroller is a device that integrates several components from a microprocessor system into a single microchip.A microcontroller has three main components (Figure 1): CPU processor, memory, and input/output (I/O) (Sadraey, 2017).Electronic equipment, including hearing aids, speech recorders, radio transmission, and other communication tools like mobile phones, telephones, intercoms, walkie-talkies, and home entertainment systems like karaoke all depend on microphones.The microphone produces a weak electrical signal.As a result, a signal amplifier-often termed an amplifier-is required.(Mallik et al., 2019).To gain more knowledge about the microphone that we use virtually daily.
The microphone's operation is briefly described in the paragraphs that follow (Benesty et al., 2015;Roy et al., 2017): 1.When we talk, sound waves go to the microphone.2. Sound waves strike a thin plastic membrane that serves as a microphone's diaphragm.The sound waves exposed to the diaphragm will cause it to vibrate.3. A coil or wire (voice coil) attached to the diaphragm's back will vibrate in tandem with the diaphragm.4. As the coil travels, a tiny permanent magnet encircled by it will produce a magnetic field.5.An electrical signal is produced When the Voice Coil moves in this Magnetic Field.6.The resulting electrical signal travels to an amplifier or speech recorder.The inverter functions to convert AC to DC to supply electricity to the motor dynamo with DC, so this tool initially has multifunction, changing AC to DC and then outputting it with AC again.All this is done by changing the potentiator contained in the device (Figure 3); besides that, we can easily change the power according to our wishes.In addition to changing the current, the inverter is also used to stabilize the output voltage, so it can be said that if we use a device, the resulting voltage will not change, unlike the stabilizer, which only functions to stabilize the current without being able to change the voltage, but the inverter can change the voltage (Krishna & Suresh, 2016).Battery/Accumulator it can, also called Accu, is an electric cell in which a reversible electrochemical process takes place with high efficiency (Bekmezci et al., 2021).The chemical change occurs in electric power (discharging process), and vice versa from electric power to chemical energy, charging back by regenerating the electrodes used by passing an electric current in the direction (opposite polarity in the cell) (Figure 4).Batteries or accumulators function to store electrical energy in the form of chemical energy, which will be used to supply (provide) electricity to the starter system, the lamp ignition system, to other electrical components (Zschornak et al., 2018).
Figure 4. ACCU/Battery equivalent circuit "A coil is a coil of wire that receives an electric current, and a contact is a form of switch whose movement depends on whether the coil is receiving an electric current."There are two different kinds of contacts: normally open (NO), which is in its initial state before being activated, and normally closed (NC), which is in its initial state before being activated.Here is the relay's basic operating principle: When the coil receives electrical energy (energized), an electromagnetic force will develop that will pull the springy armature and cause the contact to close (Blackburn & Domin, 2015)."The Com and No terminals will be connected when C1 and C2 are not passed by current;" conversely, when C1 and C2 are passed by current, the Com plate will move to ensure that the Com and No terminals are correctly connected.This relay's operating principle is shown in Figure 5. to put the SPDT relay together for use with the Arduino (Syukriyadin et al., 2018), the components that need to be prepared or needed are: 1. SPDT 5v/12v relays 2. 1k Ohm resistors 3. 2n2222 transistors 4. Diode 1n4007

II. METHOD
This research uses development research methods.The goal to be achieved from this research is to develop a home control, which is when a power outage occurs, and the Arduino is in a standby state and waiting to be sent commands from the sound sensor to be channeled to the relay so it can turn on the load.This development research was carried out on system design, both hardware and software design.
The tools and materials (Table 1) used in the control system design based on a microcontroller via sound sensor are: The working principle of this system requires energy that has been previously backed up and stored in the AKI, which will then be supplied later.However, in this system, the authors utilize sound sensors as input from the microcontroller in designing the control system when the electricity is cut off from the State Electricity Company (in Indonesian, it is abbreviated as PLN).The author will connect the AKI to the inverter to supply a voltage of 220 Volts while the Arduino is in a standby state, which can then work to switch the relay from normally open to normally closed with the help of a sound sensor that has been programmed before and has been uploaded to Arduino when given a sound code instruction, the light will automatically turn on, and when the light is turned off, a sound code is given, and the light will go out.
It has several components in general, which are depicted in the block diagram in Figure 6.The system is generally divided into several parts, namely input sensors, current converters, output devices, and PLC as the controller.

Sound Sensor (Microphone)
The sensor used for this system is a sound detection sensor, which sends waves to give commands to the microcontroller.The sensor used is a microphone.

Output Devices
This device is equipment that the controller directly controls.These devices are blowers (fans), lamps, laptops, TVs, and other devices that require a power supply.

Converter tool
This device will be used to convert energy, while the device used to convert there are two items, namely the inverter current converter.

Controller
The controller device used is the Arduino R3 Atmega 328 microcontroller, 23 I/O lines, 32 registers, three timers with comparison modes, internal and external interrupts, six channels of 10-bit A/D converters, and the chip works at a voltage between 1.8 V -5.5V.
Figure 7 shows the design plan for the created tool.
Figure 7. Simple mechanism/ control system design manual Imagine that someone gives the load or lights the go-ahead by voice order.In such a situation, the sound will be captured by the microphone and converted into an electrical signal.The sound sensor module will then analyze the signal and provide the microcontroller with outputs like ground, VCC, and signals.After processing, the microcontroller will deliver a 5-volt input, ground, and signal, instructing a relay module with one channel to turn on the lamp.Relay input has three connecting terminals: Vcc 5 volts (+), ground (-), signal (0/1) with output VCC (+) and NO (Normally Open), output from VCC connected to PLN 220 volts, and on in theory, if the relay is given voltage, the terminal from NO at the output will be closed/connected (Normally Close), then the voltage will enter the load (lamp), and the wiring phase goes directly to the lamp, then the lamp will light up immediately.

III. RESULTS AND DISCUSSIONS
Comprehensive system testing uses three lamps, each with a power of 5 watts, to indicate that the system functions according to the software instructions programmed into the Arduino UNO R3 with the FC-04 sound sensor as input (Lumbantobing, 2022b).By utilizing a sound sensor as a detector to switch on the lights or loads with this tool, making it simple to turn on or off the lights anytime the user wishes, this test seeks to control the lights the author will apply when there is a power outage.
Tools and materials used: a. Arduino Uno R3 b. 9-volt power supply/Battery c.Sound sensor FC-04 d. 5 VDC relays e. Lamp 3 pieces 5 watts f.Software (Arduino IDE) g.PCs / Laptops h.Arduino Uno Board USB cable i.MCBs j.Jumper cables k. socket l. plug m.TDOS n.Module Board After we have tested and confirmed several devices so that they can function in the assembly process (Figure 8), the tools are as follows: Figure 9. Alternative energy sources design system "The microphone operates based on the size of the wave strength, precisely the sound that hits the sensor membrane.These sound waves cause the sensor membrane, which has a small coil, to move up and down.The LM393 chip then processes the results into an output signal output 1 and 0. The microphone sensitivity can be changed using the available trimpot, and this output module is connected to the sound sensor.The Atmega 328 chip will process the input after previously uploading a program that includes a container instruction worth 500 milliseconds with a validation value of > 400 milliseconds to turn on or off the light and output pin 13 as an output voltage with a value of > 400 milliseconds or an output voltage of 5 volts.The ground port (-) from the Arduino is then connected to the ground relay input pin.This is by the working principle of the relay, which is that when C1 (ground) and C2 (VCC) are known, there is a coil as a driver when c1 (ground) and c2 (VCC) have not been passed through by voltage.If c1 (ground) and c2 (VCC) are passed by voltage, the com and NC (Normally Close) terminals will be connected, and NO (Normally Open) will not be connected; otherwise.The output relay's COM pin is connected to a 220-volt power source, and the NO (Normally Open) relay output pin is connected to the lamp, which will then be turned on or controlled based on input in the form of sound (sound code) from the FC-04 sound sensor.Next, the COM and NO (Normally open) terminals will be connected, but the NC (Normally Close) terminals will not be connected."

✓
The flowchart of the control system with the instruction that the light will turn on if the sound sensor gets an output of > 400 ms if someone claps once (Figure 10).With the initial conditions, the light is off.

IV. CONCLUSION
The following conclusions may be taken from the findings of this development inquiry, (i) "The system will work when the FC-04 sound sensor detects a clap with a value of 1, which is then collected on the Arduino with a value exceeding 400 milliseconds by the program uploaded to be utilized as a 5-volt output to turn on/off lights;" (ii) "The FC-04 sound sensor can only generate digital signals with values of 1 and 0;" (iii) "It depends on several factors to turn on the lights within a specific range, including the room's noise level and the sound sensor's sensitivity level."This development research still has many shortcomings, and it is still possible to carry out further development, including: (i) Voice instructions can be in the form of statements with voice records for controlling lights; (ii) The output voltage from Arduino can be stabilized to serve three 5 Volt DC relays at the same time to turn on three light loads; (iii) The specifications for the FC-04 sound sensor regarding the clapping intensity in decibel units are unknown.

Figure 1 .
Figure 1.Three Main Components of a Microcontroller

Figure 2 .
Figure 2. The working principle of the microphone

Figure 8 .
Figure 8. Overall design scheme with PLN as the source

Figure 10 .
Figure 10.Control system flowchart of > 400 ms with the initial state of the light is off is licensed under a Creative Commons Attribution 4.0 International License."

Table 1 .
List of tools and materials

Table 2 .
System for experimental control with a 3-meter maximum range