RFID-Based Automated Supermarket Self-Billing System

Supermarkets are large retail stores operated on a self-service basis. They sell a range of goods from agricultural produce to electronics with tagged prices. They are coupled with numerous advantages like supporting advanced means of payment like cheques, credit cards, smart store electronic cards and mobile money, offering transportation incentives and discounts. The study aimed at coming up with an RFID-Based billing system through automation. The methods and materials used included document reviews, observational experiments, system design, implementation and testing based on current situations in the supermarket business. Findings showed that there are several weaknesses with the existing systems and the new system could ably uphold the time resource, efficiency improvement of both workers and customers, and it is secure, cost-effective, and time-saving especially from queues. The widely implemented system can improve the revenue gap and possibly rejuvenate the national or international economy to a large extent.


INTRODUCTION
Supermarkets are large retail stores operated on a self-service basis selling food goods like; agriculture produce, beverages, meat, bakery and dairy products, and sometimes non-food goods like; appliances, utensils, groceries, electronics, among others (Thomas Reardon, 2004). Supermarkets were first established in the U.S. during the 1930s as nofrills retail stores offering low prices. In the 1940s and 1950s, they became the major food marketing channel in the U.S; the 1950s also saw them spread through much of Europe (Elepu, 2008).
In Uganda, supermarkets have taken the lead in the retail business. Shoprite and Game Stores both based in South Africa were among the first supermarkets to open in Uganda. The other supermarkets in Uganda today include; Kenyabased Uchumi, Nakumatt and Tuskys, Capital Shoppers, Quality Supermarket and Kenjoy, among others. Industry experts say the launch of a new supermarket, which operates alongside small and medium stores, comes with a lot of unfulfilled expectations for manufacturers and stiff competition in the market. However, they provide many employment opportunities, more revenue, quality products and relatively cheaper commodities to the shoppers (Gwambe & Businge, 2012;Hamlet, 2008), (Armstrong, 2011).
Supermarkets are associated with goods being exposed to the customers' view in the aisles together with their prices tagged on hence no bargaining. So, the customer is required to pick goods from the supermarket on a self-service basis and then present them to the cashier at the exit counter for billing and thereafter packing the billed items (Hamlet, 2008;Thomas et al., 2004;Gwambe & Businge, 2012).
Shopping from Supermarkets has various advantages that include but are not limited to (Hamlet, 2008). Prices of supermarket products are relatively low as compared to other retail shops; They provide a very convenient way of shopping, the shopper is provided with a variety of goods from which choice is made; Supermarkets support advanced means of payment like; cheque, credit card, smart store electronic card, mobile money etcetera. They also offer after-sales services like; packaging, transportation incentives, discounts, promotional goods among others; The quality of goods purchased from supermarkets is always high and guaranteed. This is because every commodity is labelled with; its expiry date, manufacturer, supplier and they are subjected to regular monitoring and verification by the relevant standards boards; some supermarkets offer a 24/7 shopping experience which allows shoppers access to goods at their own time of convenience (Thomas et al., 2004).

Overview of the Existing Supermarket Billing Systems in Uganda
Current systems in Uganda require that the customer enters the supermarket, pick whatever they want from the supermarket and present them to the cashier at the billing counter. At the billing counter, a number of systems are being used.
Shopping in absentia is supported in numerous ways including online shopping, teleshopping, etc., wherein a shopper does not have to be physically present in the shopping area. Shopping in-person involves customers entering the supermarket and selecting the commodities they want on a selfservice basis (Stuart, 2007). These commodities are then presented to the counter for billing and packaging. At the counter, some supermarkets have barcode readers that help cashiers in carrying out the billing by reading the special bar codes tagged on each commodity (Smith, 2011;Lawrence, 2013;Rouse, 2011). While in others, attendants use a manual way with the help of their eyes to check the price tags on the items and feed those prices into the calculator to get the total cost of things purchased by a particular customer (Lawrence, 2013).
Long customer queues can lead to dissatisfied customers and lost businesses; thus, need to take measures to reduce queues and improve the operation (Leonard, 2005). A study by A. Goldman revealed that how well queues are managed in the service industry can have a tremendous impact on customer service since nobody enjoys waiting in long lines (Goldman, 2013).
The developed system is able to reduce these long queues by eliminating the time wasted at the billing counter as cashiers try to count items per item and in packing the items. The system, therefore, addresses these problems by introducing automatic self-billing of all commodities in the shopping bag of the customer using RFID technology. Therefore, the study aimed at designing and implementing a system that automatically bills the customer's goods using RFID technology. This followed this procedure: reviewed, identified and analysed the requirements for the design of an automated supermarket self-billing system; designed the user interface, database modules and hardware modules of the proposed system; and finally developed the proposed system by integrating the different modules, tested and implemented the system.

System Study and Review
In order to obtain the necessary data needed to accomplish the project, a number of research designs were employed. These included reading textbooks, journals, magazines and newspapers plus making good use of the available internet facilities. It also provided a wide knowledge base of the different supermarket billing systems. A close look at how people interact with supermarkets and how convenient they find them was made on several samples. There was the need to ascertain how all stakeholders in the supermarket business, e.g., cashiers, customers, owners, and managers find the current billing system and the future perspective they have towards the billing systems used apparently. Observation also involved ascertaining the approximate amount of time it takes a cashier to bill an average customer in order to compare the values to the developed system.
The data collected was analysed based on the objectives specified in this proposal. A qualitative approach was used and the consistency of the data was ensured in order to come up with effective recommendations. This was achieved by coming up with a context diagram that is not part of the manuscript.
After collecting and interpreting all the relevant information, a documentation report with all the findings and challenges met was formed intended to help any other person who might be capable and interested in enhancing or improving the performance of the system developed.

System Design
The design of the system is a composition of a hardware system, a database module and two user interface modules. The hardware module is responsible for interfacing with the commodities bought by reading the tags and sending their unique identification numbers to the user interface and database. The database module contains updated information about all the commodities available in the supermarket at a given time. The user interface module interfaces the system to the users, i.e., Cashier and Customer; this is through displaying the list of commodities bought on the cashier's PC, providing provisions for sending commands to the system and also indicating the total amount to be paid to the customer (Li, 2010). It also notifies the users about the ongoing activities by giving a beep sound, LED blink indication and a display of the total on the LCD. The system contains the following hardware components descriptions: Arduino Board. This contains the Atmega32 microcontroller and it is used to coordinate all the activities of the system, all the system components such as; PC, LED, LCD, and Buzzer will be connected to this Arduino microcontroller board (Adman, 2012;James, 2010).
RFID Reader. This is connected to the Arduino board and is used to read all the RFID tags attached to every commodity in the supermarket (Li, 2010;Lindsay, 2003).
Liquid Crystal Display (LCD). This acts as an interface to the customer by displaying the total amount of money he/she has to pay and any other relevant customer information.
Electronic Components (Diodes, capacitors, connecting wires, resistors and transistors). Different components were used mainly to connect, regulate and direct current in the system.
Board was used for holding and housing the system components during prototyping.
Buzzer and Light Emitting Diode (LED). These were used for signalling, alerting and notifications purposes.
Quite a number of both hardware and software development tools are used in the development of the systems (Josephine, 2013). These included; Personal Computer. This is used to write the programmers that are burnt on the programmable chips in the system.
Arduino Software (IDE). This was the programming environment; it was used for writing programs and burning them to the ATMEGA32 microcontroller on the Arduino board (Adman, 2012;James, 2010).
Proteus. This was used as the simulating environment; it was used to analyse the behaviour of the system in simulation mode.
Smart Draw. This tool was used to draw all the relevant diagrams required during analysis, design and testing, i.e., conceptual diagrams, context diagrams, dataflow charts, among others.
Visual Studio (C#). This was used to design the cashier's user interface for the supermarket and also to interface it to the central supermarket database.

System Implementation
The program was coded in the embedded C language of Arduino using Arduino Software (IDE). It then went through various levels of simulation to ensure that the system attains the required standard and functionality using Proteus software. The program was then downloaded onto the ATMEGA32 microcontroller on the Arduino board using the Arduino Software environment. The different components were then interconnected together in order to come up with a complete working system.
A counter-table like wooden infrastructure was used to depict the real supermarket counter and it is on this that all the other components of the system were assembled. It has a well-designed glass flat surface where the shopping bags containing all the commodities or a single commodity are or is placed for billing. An LCD was mounted on it; it displays the total amount to be paid by the customer and any other relevant information.
The RFID reader antenna is positioned parallel to the flat surface of the counter-table such that the reader is in a position to read all the multiple tags presented within its reading range.
The whole hardware circuitry is connected to the personal computer via two USB interface serial ports, i.e., COM3 and COM7 in order to interact with the user interface and RFID reader modules, respectively.
The user interface is designed using Microsoft visual studio's C-Sharp (C#) programming environment. It is then linked to a Microsoft Access database containing all the items in the supermarket; it will also contain specialized buttons for different commands, i.e., Bill, Print Receipt, Show Total, Clear etc. The database module on the computer is connected to; the user interfaces via MySQL commands and to the Arduino board via the console port.
A buzzer is connected to the Arduino board and it gives a beeping sound to indicate that all the commodities presented in the shopping bag have been read and billed. An LED-Green is also connected in the same way to serve the same purpose by blinking.

System Testing
In order to construct a working system, testing was done at different stages of the system's development following this order:

Unit Testing
This involved testing different individual units of hardware components, i.e., RFID reader, tags, user interface, Arduino board to ensure that they are meeting the project expectations. Unit testing also involved testing pieces of code to ensure that they worked as expected.

Integration Testing
The different components were brought together and tested for inter-component communication; this helped in finding out whether the different integrated components give the expected outputs for the respective inputs.

Front-end testing
Front-end testing was carried out on the user interface of the system after completion to ensure that the system was able to perform the required functional requirements. This was aimed at ascertaining whether the system can simultaneously detect and bill all the commodities in its reading range and display the information on the user interface.

Principle of Operation of the Developed System
Every commodity in the store is equipped with a unique RFID tag attached to it. Each tag has a unique ID that references all the information such as the name of the product, type of product, its cost and any additional information that the supermarket manager wishes to include from the database. The customer goes through the store collecting all the products he/she wishes to buy using shopping bags present at every aisle. On completion, the shopping bags are placed on a self-checkout billing system which consists of: a platform for placing the shopping bag, an RFID reader and antennae, an LCD display, a buzzer, an LED and a PC connected to the supermarket database server. The RFID reader reads all the RFID tags attached to the items in the shopping bag regardless of how the different items are positioned in the bag. This information read is sent to the cashier's PC, the PC contains an interface that retrieves additional information from the database and displays it to the cashier. The cashier then issues a "SHOW TOTAL" command which prints the total to the LCD via the COM serial port. Successful completion of the reading of all the items is signalized by a single buzzer sound and a change from the Ready-state Blue LED to the Readstate Green LED. The customer is now required to make payments either by cash, credit card or any other method supported by the supermarket.
After receiving payments, the cashier issues a completion of purchase command by pressing the "PRINT RECEIPT" button on the interface which updates the database to indicate the sold items and also issues out a receipt that is presented to the security personnel by the shopper at the exit.
In the event that the customer wishes to exclude some items to fit his/her budget, such items are removed by the cashier and the system automatically generates another updated total excluding the removed products. For items which cannot fit in shopping bags such as; TV sets, Printers, big toys, chairs, bags, among others, they are individually put beside but close to the billing system one at a time and the total bill generated after reading all of them.

Benefits of the Proposed System
The system has various benefits that consist but not limited to the following: The waiting time is reduced as only payments but not counting and packing of items is done at the counter, this enhances supermarket shopping experience; The efficiency of cashiers increases since their purpose is only receiving payments and issuing receipts; The system is cost-effective and affordable by every supermarket in the region. This is possible since RFID tags are considerably cheap relative to the price of any product sold (approx.1cent~shs.36) in the supermarket and can be put on any commodity (Saila, 2012). The supermarket's operational expenditure also reduces with the automation of the billing process. This is as a result of reduced human labour required hence saving on salaries; The system also employs an efficient mechanism that ensures that all commodities in the shopping bag are read and paid for before leaving the supermarket hence cubing shop-lifting; The system has the provision of being synchronized with already available security systems in supermarkets using RFID technology, this will ensure that no commodity unpaid for leaves the supermarket premises. This enhances the supermarket's security and minimizes losses; Price fluctuations can be easily affected on every item than in the existing systems since the RFID tags can be reprogrammed as many times as it may necessitate, also RFID tags can be recycled hence reducing costs (Li, 2010;Saila, 2012).

Development Platforms
The following are the platforms that were used in the design and implementation of the system in Figure 1, Figure 2

Verifications
Individual units of the system were tested before testing the entire integrated system. The first testing was done with the user interface design developed in Visual Studio C# and the RFID reader code also designed in C#. I also tested the LCD screen and its communication with the Arduino microcontroller. All attached components like the buzzer and LEDs were tested to make sure they work as required.

Validation and Evaluations
The main objective of the project, which was to design and implement a prototype of an RFID-based Supermarket self-billing system was met. Compared to the existing shopping system, this developed system is able to read all the items in the shopping bag, compare and retrieve additional information from the database, display the retrieved information on the cashier's interface, generate a total and display it to the customer on the LCD and print a receipt to the customer. This is all done in a few seconds hence the system is by far better than the available system.

Functional Analysis
The system was analysed to check whether it was in good working order. The system works in a way that it reads the tag ids of items in the shopping bags and sends these values to the user interface application on the computer. It then picks the price and weight of the read items from the database and displays them on the cashier's interface screen (Desktop). The total bill is automatically generated by the system and a cashier issues a command which displays the total to the customer.

Functional Requirements
These are the functions that the system would execute based on the problem statement which later serves as the basis for the system testing, verifying and validation. These are: Being able to read and interpret the tag codes of every item presented; Able to effect communication between the microcontroller, database and the user interface on the cashier counter; Able to display the names, prices, description and any other relevant information to the cashier; and able to print a receipt to the customer at the end of the transaction.

Non-functional Requirements
These requirements are considered as properties of the system and they included the following; Performance requirements: Security: The system has the ability to resist the manipulation of the running algorithm. The system's operation should not easily be observable by an intruder. It is expected to be able to run for longer hours or whenever it is required. By this, it is able to achieve the desired results with the minimum use of energy, effort and time. Thus, it does not need any intervention. On the other hand, the system is able to run at a low cost and meet the requirements plus the objectives. Reliability is expected so that it is able to give only the right output since it cannot be manipulated like a human being.

Requirement Analysis
The system was analysed to determine the requirements that provided a ground for its design, this included hardware and software requirements. The RFID-based supermarket self-billing system is expected to meet its main objective while providing the user with functional and non-functional requirements; software and Hardware requirements were availed.

Software Requirements
The software requirements provided the platform for generating the logic required to run the system. These are Arduino IDE, Visual Studio's C#, Smart Draw and the VM Studio (Piejko, 2011).

Hardware Requirements
The hardware requirements that were used to ensure system operability are the RFID Reader, RFID sticker tags, TTL to Serial USB adaptor, Arduino Board, Atmega 328P Microcontroller, 16x2 LCD display, Buzzer, Connecting wires, Breadboard and copper board, Resistors and transistors, Light Emitting Diodes (LEDs) and USB cables (Li, 2010;Lindsay, 2003).

System Analysis and Design
System design is the process or art of defining the architecture, components, modules, interfaces and data for a system to satisfy specified requirements. It can be seen as the application of systems theory to product development. The design of the system was composed of both the software and hardware components and it operates in a way that the customer and cashier are able to interact with it and effectively understand it. The system has a central database consisting of all the items in the supermarkets with their unique tag-id numbers.
A circuit board consists of a display screen (16 x2 LCD), LEDs (Blue and Green), a Buzzer, and an Arduino board onto which the microcontroller is mounted. The system also has an integrated RFID reader module connected to the cashier's PC via a serial communication port. The LCD displays a total to the customer, the blue LED indicates "ready state" of the system, the greed LED indicates 'reading state' and the buzzer gives a beeping sound to indicate the end of billing and display of total.
The system has an integrated RFID tag reader which scans all the unique tags on the different items presented in its reading range. The read tag-ids are interpreted and compared to the records in the database.
The system also has a central database on the cashier's desktop at the counter. From this database, items read will be picked, compared and displayed to the user interface.
There is a counter where the cashier (customer attendant) resides. The customer places his/her already packed items in the system; the cashier commands the system to the bill. The system then displays the total to the customer on the LCD after which the customer makes payments either by cash or credit card and a receipt is issued to him/her.

Microsoft Visual studio
Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for windows, as well as websites, web applications and web services. This studio has a development platform called C-Sharp (C#) in which I developed my user interface and the code for the integrated RFID reader module (Li, 2010).
Visual studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a form designer for building GUI applications, web designers, class designers and database schema designers.

Arduino IDE
The open-source Arduino Software (IDE) makes it easy to write codes and upload them to the board, it runs on Windows, Mac OS x, and Linux. The environment is written in java and based on processing and other open-source software. This software can be used with any Arduino.
This platform was used in my project to develop and program the Arduino in order for it to communicate with the cashier's interface.

Microsoft Access
Microsoft Access is a Database management system (DBMS) from Microsoft that combines the relational Microsoft jet Database Engine with a graphical user interface and software development tools. It stores data in its own format based on the access jet database engine. It can also import or link directly to data stored in other applications and databases. MS Access was used to develop the database module of the system. It is from this database that information is called from to the user interface.

CONCLUSION
For a period of time, we were committed to working on a system that automatically bills the shopped items in the minimum time possible. The system has been tested, validated and proven to work and can be deployed in supermarkets. This project achieved its main objective of designing and implementing a prototype of an RFID based supermarket self-billing system to save a few challenges. The major aim of reducing billing time was achieved with an approximate percentage of 85% as compared to the already available systems for the sampling validation taken. The RFID integrated module was not directly connected to the Arduino board as proposed but rather interfaced directly to the computer via the serial communication port (COM port).
However, for future use of the system, multiple RFID readers should be embedded in the system in order to achieve effective reading and accuracy. The study recommends that for any deployment purposes, the RFID sticker tags should be embedded into the cover material of the items than outside. This is to avoid canning customers who may pluck them off. More so, the system be incorporated with already available RFID security systems to enhance the security of the supermarket against theft. Additional development of the cashier's interface to enhance its functionality by adding; Reports, Updating of database, VAT calculations, and Discounts calculation.