The IoT could control the devices that need a high current voltage to operate. The voltage control here means that the IoT could give the command to turn on and turn off the electric current by using a relay module. One of the devices that are most frequently used in many research projects is Node MCU ESP8266 and Node MCU ESP32. Those microcontrollers work with the maximum supply is 3.3-volt direct current (DC). On the other hand, the relay module commonly needs a voltage supply of 5-volt DC and the relay needs to be controlled by a single transistor to make a trig on. The relay will be active when the transistor’s basis pin is grounded into the ground, so the relay will get the current flow. However, the relay module which is controlled using Node MCU could not work properly, caused Node MCU only provides the digital out is 3-volt maximum from its digital Input Output pins (I/O). Meanwhile, the driver relay based on a single transistor needs a bias input amount of 5 volts to make the relay module active well. If the bias voltage doesn’t reach 5 volts or just 3.3 volts will make the relay can’t switch on properly which can result in bad contact. To overcome that problem this research proposed the driver relay based on Arduino UNO.

Figure 1. The diagram of the proposed method overall, where the Node MCU ESP32 does not control the relay directly, but instead through Arduino UNO which stands for relays driver.

 

Code 1 The programs for Node MCU ESP32 that contained library ArduinoJson for wrapping or serializing of four different variables then sent to custom serial that declared on digital pin 5 for serial transmitter and digital pin 4 for serial receiver.

Code 2. The programs that implemented on Arduino UNO as a driver relay module.