Development and Implementation of an RFID-Enabled Automatic Rice Vending System Using Arduino Mega 2560

ABSTRACT


INTRODUCTION
Rice stands as a fundamental dietary staple for the majority of Indonesians.The conventional practices employed by rice traders and sellers, characterized by traditional sales transactions and a liter-based dosing system, contribute to inefficiencies [1,2].This outdated system not only demands labor-intensive efforts but also consumes considerable time [2,3].A critical aspect influencing decision-making in this context is the scale.The prevailing method of weighing rice remains rooted in traditional practices.Recognizing the limitations of this approach, there is a pressing need for automation in the weighing process.An automated system holds the potential to yield benefits for businesses, workers, traders, and buyers alike.By streamlining the production process through automation, efficiency can be enhanced, making the overall system simpler [4].
The Vending Machine, an automated transaction facilitator responding to a predetermined monetary input, functions seamlessly by dispensing specific goods or items [5].The rapid pace of technological advancement underscores an increasing need to augment the efficiency and simplicity of various human activities, especially within the realm of commerce.This push seeks to facilitate transactions effortlessly and universally, ensuring that the quality of exchanged goods remains uncompromised.The incorporation of Vending Machines aligns seamlessly with this overarching objective, providing a contemporary solution that transcends conventional limitations and cultivates a more accessible and streamlined buying and selling experience for consumers [6].
Advancements in technology stand out as the sole viable solution to address the challenges at hand.Incorporating technology into the realms of trade and commerce emerges as the most potent means to streamline daily activities for the general public [7].An example of this is the widespread usage of RFID technology, a kind of wireless technology, in place of traditional barcodes.This innovative technique employs radio transmission frequencies to uniquely identify specific objects using tiny tags, or transponders, which are composed of a transmitter and a responder [8].In a previous study, researchers developed a digital rice scale that used a load cell sensor and a microprocessor to determine the weight of the rice.Using a keypad to enter the weight or price of the rice, this method opens a valve that allows the rice to be released gradually into a designated container [9].
There are several similarities and differences in this and the previous system.The similarities of the previous research are using Arduino Mega 2560, loadcell sensors in reading the weight stored, and for opening and closing rice valves using servo motors.While the difference in previous research is that the rice collection does not use keypads, limit switches and proximity and is not assisted by telegrams for notification when the rice runs out [10].
Building upon insights gleaned from previous research, the proposed solution in this study aims to create and advance a prototype for an automatic rice sales apparatus utilizing RFID technology [11].This system can be personalized in terms of features, allowing users to select the desired amount of rice via the keypad.To enhance user comprehension of the selected rice quantity and the corresponding total price, an LCD (Liquid Crystal Display) is integrated into the hardware interface of the rice sales tool prototype.Moreover, this research employs an RFID reader module within the tool and utilizes RFID cards as a secure and efficient payment method for customers interacting with the automatic rice sales prototype.Leveraging the RFID system, various tasks can be executed more expediently and securely [9][10][11][12].The principal objective of this study is to develop a prototype for a rice sales tool that accepts RFID identity cards as a convenient and secure method of payment.

RESEARCH METHODS
Figure 1 shows how a research approach is used.The stages are problem, approach, development, implementation, measurement, and outcome.

Problems
In this initial stage, the problem is how to design and apply RFID technology to the prototype of a rice sales tool using the Arduino Mega 2560 microcontroller.

Approach
The requirements Ingé nierie des Systè mes d'Information approach, which comprises the hardware specifications used in the study, and the work approach, which outlines the system's overall operation, make up the approach stage.

Development
Tools like the Arduino IDE for programming the device, Fritzing for designing the hardware, and Microsoft Visio for creating various diagrams like flow charts are available during the development stage.

Implementation
Connecting the circuit tool's modules and using the Arduino IDE software to operate on the microcontroller and additional hardware completes this step.

Measurement
At this point, a number of tests are conducted, specifically:

Result
The final result of this research is an RFID-enabled rice sales tool using Arduino Mega 2560.

RESULT
The focus of this session will be on the results and discussion of the application of RFID technology to a beras penjualan alat using an Arduino Mega 2560.

Needs approach
The research Development and Implementation of an RFID-Enabled Automatic Rice Vending System Using Arduino Mega 2560 at the point of approaching the needs to be carried out can be aided by hardware, as Table 1 shows.
From this system, Arduino is an electronic kit or board that uses the ATMega microcontroller family and runs open source software.It was created by Atmel to make it easier to use electronics in a variety of applications, where the software uses its own programming language and the hardware uses an Atmel AVR CPU [13].A microcontroller board based on the ATmega 2560 is known by another name: the Arduino Mega 2560.In addition to a reset button, an ICSP header, a USB connector, a power socket, and a 16 MHz crystal oscillator, the Arduino Mega 2560 offers 54 digital input/output pins.Of these, 16 pins can be used for hardware serial ports (HARTs), 15 pins for PMW outputs, and 14 pins for analog inputs [14].Ethernet Shield (1) An umbrella term for non-contact technologies that use radio waves to autonomously identify individuals or objects is RFID-RC522.There are many ways to identify something, but the most popular one is to store the person's or thing's unique serial number on a microchip that is attached to an antenna.An RFID transponder, often known as an RFID tag, is a device that combines an antenna and a microchip and communicates with an RFID reader [15].(2) A servo is a tool that offers mechanical control over a large area.Servo motors produce a shaft.A code signal sent on the servo motor control channel can be used to position this shaft at a particular angle [16].(3) Sensors designed to gauge a load's weight or pressure are called load cell sensors.They can be used on weigh bridges to measure the weight of trucks that convey raw materials.Generally, they are the key part of digital weighing systems.These measurements are made using the pressure principle by the load cell [17,18].(4) The integrated "AVIA SEMICONDUCTOR" HX711 24-bit precision analog to digital converter (ADC) was developed for digital weighing sensors in industrial control applications that are linked to bridge sensors [19,20].(5) A keypad module with 4 rows and 4 columns is known as a 4x4 keypad module.Applications like digital security, data loggers, attendance, motor speed control, robotics, and others can use this module as an input device [21].(6) A form of display called an LCD (Liquid Crystal Display) creates visible images by using liquid crystals as the display medium.the incorporation of LCD into a system's design that uses a microcontroller [22].(7) The term "proximity sensor" refers to a sensor or switch that detects the presence of a target (a particular type of metal) without making physical contact.This type of sensor typically consists of a solid-state electronic device that is tightly wrapped to shield it from damaging vibrations, liquid, chemical, and corrosive influences [22].(8) Connecting parts on a breadboard requires electrical cords called jumper cables.At each end of jumper wires are connectors or pins.Jumper cables are split into three categories: male to male, male to female, and female to female [23].Connectors for connecting are referred to as male connectors and connectors for connecting as female connectors [24].( 9) A limit switch is a switch or electromechanical device that changes the position of the terminal contacts from normally open (NO) to closed (NC), or vice versa, using an actuator lever.When an object presses or pushes the actuator lever, the contact position will change.Limit switches feature just two conditions, joining or disconnecting the flow of electric current, like switches in general.It just has ON or Off conditions, in other words [25].(10) A module called Ethernet Shield is used to link Arduino to the internet.For it to work, an Ethernet and SPI libraries are needed, and the Ethernet Shield uses an RJ-45 connection to connect to the internet, an integrated line transformer, and Power over Ethernet [26].

Work approach
The operation of the system being studied will be described in this method.How the system works will be explained in Figure 2. The system and operational procedures in this research use Arduino Mega 2560 as the data collector and the limiting sensor.The switch will read more thoroughly about the presence of rice; if the rice is found in the box for rice-related activities, there will be a keypad requesting input; if the rice is elsewhere, there will be a notification in the seller's telegram account.The keypad as a source of input will be sent to Arduino when Arduino receives input data from the keypad.Arduino will continue the operation after sending the output to the LCD.After the LCD receives output data from the Arduino, the LCD will provide information to the buyer about how many items he wants to buy.After the buyer provides input regarding how many items he wants to buy, the transaction will then be completed using the RFID sensor.After completing the transaction, the proximity sensor will further analyze whether there is a rice container or not, if there is a container but has not been detected, the servo motor will not be active, and if there is, the servo motor will be active to cause the rice container to come out.After obtaining stability, the HX711 module will then collect data and send it to the Load Cell sensor.When the Load Cell sensor detects the weight of the rice as instructed, the servo motor will continue its operation to close again.

Development
At this stage, several designs related to the research are carried out.The following are some of the stages of system design in this study.

Functional block diagram
In this case, hardware design work is performed that is in line with the research being conducted.Based on the overall research, the following hardware design example is shown in Figure 3.
Keypad as input, arduino as receiver and sender, RFID-RC522 as a card reader sensor for payment, Limit Switch as a rice detection, Proximity as a rice container detection sensor, Servo Motor to open and close the rice output buffer, Load Cell as a weight detection sensor, an Ethernet shield is an output that links the Arduino to the internet, while an LCD output shows data as characters or numbers.

RFID-RC522 system diagram
At this point, it is taught that there are three different sorts of RFID tags: those that utilize a frequency, those that can read and write, and those that use an energy source [27].
The design of the RFID system is shown in Figure 4, which indicates that when the RFID reader emits radio waves, the RFID tag will respond by sending the unique number stored in it wirelessly to the RFID reader to be read if it is within the range of these radio frequency waves.The RFID tag generates this response through an inductance voltage.The data will then be forwarded by the reader to the computer and Arduino Mega 2560 microcontroller infrastructure that are attached to it [28].

Network topology design
The network architecture design demonstrates that the Ethernet shield is linked to the switch, and naturally, the Arduino Mega 2560 prototype circuit for the rice sales tool has been programmed in compliance with the provided programming instructions (see to Figure 5).
From the internet source, it connects to the RB CCR 1009-7G-1C-1S+ proxy router with an ip address of 10.Implementing security methods like encryption, authentication, firewalls, and ACL settings has improved the security and dependability of communication between the Arduino and the server.Furthermore, in the research phase, buffering schemes, repetition mechanisms, QoS setting, and network redundancy implementation have been used to mitigate network slowness and potential data loss.In order to identify preemptive problems and guarantee that the riceselling tools are performing at their best, network performance monitoring is also used.It is anticipated that these enhancements will allow the network topology to preserve data security, enhance communication dependability, and maximize the functionality of the Arduino-powered riceselling device.

Implementation
Prior to being included into the actual system, all components must be assembled or installed during the implementation step.The steps of implementation that will take place utilizing the system process are as follows.The system workflow in Figure 6 begins with the module being connected to the Arduino Mega 2560 microcontroller, then the limit switch will first check if there is rice available; if not, it will notify the seller via telegram.Enter the quantity of rice you wish to purchase using the keypad, then tap the RFID card to complete the payment.Once the card is tapped, the proximity sensor will first look for the presence of a container holding the rice that will be released; if it does, the servo motor will open the rice valve and release the rice.After the rice is released, the servo valve will again shut off when the loadcell sensor determines the weight load that can be supported based on the quantity of rice that was purchased.

Measurement
Currently, an Arduino Mega, keypad, LCD, RFID-RC522, proximity, limit switch, servo motor, HX711 + loadcell, Ethernet shield, and Telegram are being used to test the RFID utilization feature on the rice sales tool.This test is conducted to ensure that the tool is constructed in compliance with the anticipated goals.

Keypad and LCD I2C function testing
At this stage, the LCD I2C and keypad are being tested.When the keypad is pressed, information about how much rice to purchase quickly appears on the LCD I2C.   7 shows the test of the keypad and LCD when the keypad is inputted, it will immediately appear on the LCD to enter data on how much rice to buy.

Proximity photodiode function testing
The Proximity Photodiode is currently undergoing testing.The indicator light on the sensor's back will turn on when it senses the presence of an object.

Figure 8. Proximity photodiode function testing
The Proximity Photodiode is tested in Figure 8 functions to detect the presence of an object, in this study the proximity photodiode is used to detect the presence of a rice container that will come out.

RFID-RC522 function testing
At this stage, the RFID-RC522 is being tested.When the reader emits radio waves, the RFID tag's chip will generate an inductance voltage and respond by sending a unique number that is stored in it wirelessly if it is within the RFID tag's range of these radio frequency waves.
Figure 9 shows how the RFID-RC522 sensor reads when the RFID card/tag is attached to the reader and receives frequency waves from the reader.The chip from the card tag will send unique code data to the reader and read the availability of the balance according to the unique code, if the RFID card tag detects a balance there will be a notification in the LCD "Successful Pay", and if it does not detect the balance "Failure to Pay Balance Less".In order to test this limit switch, one limit switch is used as a rice shelter availability detector.

Figure 10. Limit switch function testing
The limit switch is tested in Figure 10.If the switch indication is on, meaning that rice is available in the shelter, then the limit switch is receiving a load from a rope packed with rice; if the switch is off, meaning that rice is not available.

Servo motor function testing
This test uses a servo motor as the opening and closing rice valve.Figure 12 shows a test is carried out as a load/weight detector that is accommodated in the loadcell sensor and the hx711 module will send to the arduino.This loadcell will send input into the arduino after the weight of the rice accommodated is in accordance with what was purchased, the arduino will give a command to the servo motor.
The next stage is done by testing the loadcell error in the table.Testing is done by inputting the amount of weight on the rice weighing device.Testing is done with five weight conditions, namely 756 grams, 1,506 grams, 2,259 grams, 3,012 grams and 3,765 grams.Each weight measurement is done twice with the calculation (digital scale value -loadcell value = less result), (less result / digital scale value = quotient), (quotient x 100 = error %).The test results are shown in Table 2.

No. Digital Scales (Liters)
Loadcell Scales (Gr) Severe Error (%) Notes: The process of validating the weight of the load cell reading results is carried out using a digital scale.The test results show that the largest test error is obtained in measurements using a weight of 1.506 grams, with an error value of 9.3%.While the smallest error value at a value of 0.2% was obtained in testing with a weight of 3.765 grams.

Ethernet shield function testing
This stage is carried out to test the function of the Ethernet Shield.
The purpose of this Ethernet shield test, as illustrated in Figure 13, is to determine whether the Ethernet shield is linked to the internet so that it can transmit information about the availability of rice for sale.If it is, the serial monitor will indicate our Local IP address.

Telegram function testing
This stage is carried out to test the function of the Telegram for notification.
A stage is conducted to test the telegram's functions, as seen in Figure 14.This test is run in the form of an alert.This system will determine whether or not the rice information to be sold is available in the rice storage box and send text messages via Telegram indicating the availability of the rice obtained.The messages will be recorded in the rice sales database.Figure 15 shows the serial display of the monitor when the infrastructure detects the absence of rice in the rice storage/box, thus notifying a message to the telegram.

CONCLUSIONS
In conclusion, the integration of RFID technology with Arduino Mega 2560 has presented a successful paradigm for automating rice sales.The system's meticulous design incorporates RFID-RC522 sensors, limit switches, proximity sensors, loadcell sensors, and an Ethernet shield, resulting in a cohesive and efficient solution for streamlined transactions.Notably, the system has excelled in accurately measuring rice quantities and facilitating seamless purchases, fulfilling the objectives set in the introduction.While challenges were encountered, such as occasional issues with limit switches and reliability concerns with proximity sensors, these setbacks offer valuable insights for future improvements.Looking ahead, future work should prioritize refining the reliability of proximity sensors and addressing the intermittent issues with limit switches to enhance the overall robustness of the system.This ongoing development is crucial for ensuring the sustained success and real-world viability of the automated rice sales tool.Stakeholders considering the adoption of this technology should appreciate its proven functionality while remaining attentive to the potential areas for refinement, emphasizing the collaborative efforts between developers and industry representatives to unlock the full potential of this innovative solution in practical applications.

Figure 2 .
Figure 2. Steps for working 10.0.1/21.From the RB CCR 1009-7G-1C-1S+ router connecting to the switch on the CSN (Computer System and Network) Laboratory Server, the switch connects to the rice sales infrastructure having an ip address of 192.168.137.2/24.Then the rice sales infrastructure provides notification of rice running out to the telegram bot.

Figure 7 .
Figure 7. Keypad and LCD I2C function testing

Figure
Figure7shows the test of the keypad and LCD when the keypad is inputted, it will immediately appear on the LCD to enter data on how much rice to buy.

Figure 9 .
Figure 9. RFID-RC522 function testing 3.4.4Limit switch function testingIn order to test this limit switch, one limit switch is used as a rice shelter availability detector.

Figure 11 .
Figure 11.Servo motor function testing Figure 11 shows in this Servo Motor test functions as opening and closing the rice buffer / valve when finished making payment transactions.3.4.6 Load cell function testingThis stage is carried out to test the function of the loadcell sensor.

Figure 12 .
Figure 12.Load cell function testing