Design of Automatic Candy Mixer using Blynk and NodeMCU ESP8266

Candy has many variations based on shape, texture, and taste. The more variations of the product have an effect on more consumers, Candy products also have a lot of variety, which makes mixing candy an interesting task. The mixing process of candies is usually done by weighting them manually with conventional scales, so there are some deficiencies to be improved. The automatic candy mixer using Blynk and NodeMCU ESP8266 has been designed to be able to help with the process of mixing and weighting candy automatically. This device allows users to choose weight and candy types to be mixed, whether it is one type of candy or more, from the Blynk application and is operated using a microcontroller and sensor. The utilized sensor is a load cell sensor with 1% of calibration inaccuracy.


Introduction
Candy is a type of snack product that is generally made of sugar or sweetener, water, food flavorings, and food coloring. There are various types of candy based on shape, texture, and taste. Several types of candy are often mixed into one package so the consumer can obtain a variety of candies in one package. The variety of a product is one of many factors that might impact on customer satisfaction. The greater the variety of products, the more appealing they are to consumers [1]. Candy, as a product that has plenty of variations in shape and taste, motivates a small industry to develop an automatic device for mixing it. Mixing candy is an activity for mixing a variety of candies into one package. The mixing process of candies involves the type and weight of candies. A type of candy could have a different weight. Weighing is a process to measure the sum of candies' weight. The weighing process in conventional candy stores is usually done manually using conventional scales. This conventional scale has some deficiencies that need to be improved.
Due to [2], automatic weighing and packaging machines for small-scale industries and grocery stores can manage to do all the processing steps for weighing and packaging the product without any external help. According to [3], an automatic weighing and packaging machine is the cheapest machine which would automate this process of weighing and packaging with almost negligible chances of error in weight measurement. Based on two previous research studies, an electronic sensor known as a load cell could improve weight measurement cell sensor assists the process of weighing to become more efficient [4]. By applying a load cell sensor on a digital scale, the weighing process could be done in detail. Therefore, an automatic mixing candy machine could be designed and developed with some additional features such as the Blynk application and the WiFi module ESP8266 NodeMCU. In this research, we designed and implemented an automatic candy mixer that can be operated wirelessly.

Materials and Methods
The implemented automatic candy mixer that uses Blynk and NodeMCU ESP8266 consists of a mixer Android application module, a processing module, a container module, and a weighing module. Figure 1 shows the block diagram of the device. The Blynk app is an Internet-of-Things (IoT) platform that allows remote control of electronic devices [5][6].The Blynk application can be used as an Application Programming Interface (API), making it a mixer application module which displays a selection of virtual buttons and widgets representing the desired candy type and weight options [7].
The NodeMCU is an Arduino board which runs on the ESP8266 module [8]. The ESP8266 module is used for WiFi network connectivity between the microcontroller itself and the WiFi network. The features of the ESP8266 are able to enhance some WiFi-enabled devices that are enabled to program and connect to the Internet uncomplicatedly [9]. The NodeMCU serves as a data processing center, receiving data from the mixer application module over the WiFi network.
The container module consists of a PET plastic jar, an MG90S servo motor, and a PCA9685. PET plastic jars are used as containers to accommodate the candy to be mixed or weighed. This transparent plastic makes it easy to monitor the volume of candy it holds. A MG90S servo motor is used to open and close the valves on each container. The PCA9685 is an I2C-bus for optimizing servo motor applications that controls a 16-channel servo motor controller [10]. PCA9685 is used to allow the microcontroller to control more servo motors.
The weighing module consists of a load cell, an HX711, and a servo motor. The load cell is used to detect the weight of the candy flowing from the container module. The output of the load cell will be passed to the HX711. The HX711 serves to amplify the output generated by the load cell so that it can be processed by the microcontroller [11]. The servo motor serves the flow of the results of weighing candy into the candy container and ready to be packaged. Based on the block diagram in Figure 1, an automatic candy mixer is created. The realization of the candy mixer weigher can be seen in Figure 2. Figure 2(a) shows the front view of an automatic candy mixer consisting of a PET jar and a mixer application module. Figure 2(b) shows a rear view consisting of a processing module and a container module consisting of a PCA 9685 servo motor. The processing module is wired directly to the container module and weighing module. The mixer application module connects wirelessly with the processing module via a WiFi network.   Several modules, such as the mixer application module and the weighing module, were tested. The mixer application module was tested to ensure the ability of the mixer application to connect and send commands to the processing module wirelessly. The mixer application module includes four virtual buttons and one H-step widget that are shown in Figure 3. Virtual buttons have two states: high and low, which indicate whether the key is pressed or not pressed. The result is that the mixer application was able to connect and send commands to the processing module properly.

Results and Discussion
The weighing module was designed by integrating a load cell with the HX711 and processed by NodeMCU. Figure 4 shows the realization of the weighing module. The weighing module is compared to conventional and digital scales. Comparisons were made to determine the accuracy of the weighing module from the average presentation of weighing results. The comparison of the weighing module with a conventional scale can be seen in Table 1. A comparison of the weighing module with a digital scale can be seen in Table 2.  Some cases were applied to determine the ability to mix candy. The cases include 2 things: the first is the type of candy, and the second is the weight being weighed. The type of candy used includes all the possible types of candy to choose from. The weight that was chosen is 500 grams. The type of candy used for weighing or mixing is hard candy. These hard candies also come in different flavors and sizes. The shape of the candy can be seen in Figure 5. The purpose of the cases is to show that the automatic candy mixer using blynk and NodeMCU can weigh various types of candy available at a certain weight. Table 3 shows the results of the tests carried out by weighing all the choices of types of sweets selected up to 500 grams. The weighing process was carried out by the weighing module. Based on the results of the pictures and measurements, the types of candy selected can be weighed appropriately and can also be mixed accurately.

Conclusions
Based on the testing results of the realized automatic candy mixer, it is concluded that the options for the type of candy and the desired weight through the blynk application can be received and processed properly to weigh all kinds of candy options that can be chosen. The accuracy of weighing carried out by the load cell sensor has an average weight difference of 1% compared to a conventional scale and 0.35% compared to a digital scale. This shows that the weighing module using a load cell has an inaccuracy below 1%.