You are on page 1of 117

Automatic collection system for supermarkets Page.

Summary
The main objective of this project is to create an automatic collection system for
supermarkets, with the intention of streamlining the current purchase process. To do this,
a system integrated into the shopping cart has been designed that allows, through a mobile
application or a laser barcode reader, that the customer scans the products as they buy.
This prevents it from having to download the products to proceed with payment and then
having to bag them. As an innovation, a weight control system has also been introduced in
the carts, to make the system safer.

The cart has been equipped with energy autonomy and has been enabled so that it can
use the information acquired, and thatit interacts, through a touch screen, with the user, or
communicate wirelessly with other equipment.

Finally, a prototype of the designed system has been implemented that simulates the
operation of the final system, facing what the client sees. The scope of the demonstration
ranges from the creation of the mobile application to scan the products, to the creation of
a scale to simulate the weighing system of the cart, which assembles the computer
purchasing software with the balance of product weight.

Page 2 Automatic charge system for supermarkets


Summary
ABSTRACT ___ PREFACE ____
1.1. Motivation . 7

2. INTRODUCTION ____
2.1. Objectives of the project ..............
...................................................................... 9
2.2. Scope of the project ............ 9

3. STUDY OF PRECEDENTS __
3.1. Internet search ............ ...... 11
3.2. Visits . 20

4. BASIC SPECIFICATIONS ____ CONCEPTUAL DESIGN ____


5.1. Generation of concepts ............ 23
1. RFID (Radio Frequency Identification Device) .................................................
23
2. Bar code ................ 25
3. Vending ...........................................................................................................
29
4. Product image identification ................ ........ 31
5.2. Evaluation of alternatives ................ 32
5.3. Choice of system ................ ................................. 36
5.4. Security systems ............ 36
1. Weight control system........ ........ 36
2. Cart status notification system ............ 41
3. Random controls (sampling) ........ .............................. 42
4. Security cameras........ 43
5. Security guards ............ 43
6. Physical barriers ............ 43
7. Anti-theft arches ........ 44
5.5. Definitive solution ........ 44
Page 4 Automatic charge system for supermarkets

6. DETAIL DESIGN ____


6.1. Logic and algorithmic of the purchase process ................ 47
Automatic collection system for supermarkets Page. 3

6.2. Purchase control system ............ 51


Specs........................................................................................................... 51
Morphology of the Purchasing Control System ........ 52
Description ofthe components ................ 53
6.3. Collection post ............ 62
Specs.................... ....................................................................................... 62
Morphology of the Collection Post ................ 62
Description of the components ............. ..................................................................... 64
6.4. Possible control of the purchase to certain customers ................. 69
Specs..................................................................... ...................................... 69
Operation............................................................................................................ 70
6.5. Software ....................................................................... ................................ 71
Mobile App ................ 71
Cart screen software............................ ................................ 73

7. DESIGN AND CONSTRUCTION OF THE PROTOTYPE ____ 75


7.1. Specifications ............ 75
7.2. Scope . 75
7.3. Hardware ...................................................................................................... 76
Design......................................................................................................................... 76
Implementation... ......................................................................................................... 82
7.4. Software ....................................................................................................... 93
Design................... ...................................................................................................... 93
Implementation............................................................................................................ 98

8. ECONOMIC STUDY ____


8.1. Project budget ............ 109
8.2. Economic estimation of the final system ........ 110

9. PLANNING ____ ENVIRONMENTAL IMPACT __


10.1. References ........ .... 121
10.2. Further reading ........ 123
Automatic collection system for supermarkets Page. 5

1. Preface

1.1. Statement of reasons

The elaboration of this project can be justified as a way to face some of the needs that the
client believes should be improved in the current purchase process. An example of these
needs is the waiting time in the queue of a supermarket, because it is important enough to
try to reduce it. The client, while waiting, feels dissatisfied to be wasting time that could be
invested in other things and the discontent is accentuated as the waiting time is greater.

Technology has been relied upon to solve this problem and, in this way, carry out a project
that meets the needs of many customers and from which it is believed that a good business
could come out. An innovative solution has been arrivedat that is believed to have the
potential to be implemented in the current commercial structure. The implementation of the
system would be accompanied by a reduction in staff, especially in the number of cash
staff. As a result, with this reduction in costs, the initial investment made would be
recovered and, in addition, it would be possible to increase the capacity of customers / hour
and reduce the number of cash registers and their space used.

From a more personal point of view, the project caught my attention as it combines
creativity and technological development, something that I found very interesting. In
addition, it is a project covering many areas of knowledge, from mechanics to electronics,
through computer science or electricity.

From the beginning, the large number of ideas about possible solutions that emerged was
surprising, but it was not easy to arrive at a final solution that covered everything.
Something that has allowed to develop the ability to value them, group them and finally
unite them in a single solution.

In addition, the project offered many possibilities to develop new knowledge, and in the end
it has been, since a mobile application has been created for the first time, it has learned to
program the Arduino and to use the Visual Studio program, with which an application for
Windows has been created.
Collection system toutomatic for supermarkets Page. 7

2. Introduction

2.1. Objectives of the project

The purpose of the project is the design of the electronic and computer part of an automatic
collection system for supermarkets. A device integrated into the shopping cart will be
developed that allows the preparation of the shopping list as it is made, as well as its
subsequentshipment to the payment terminal. This change makes automatic collection
possible, without the need to download the products when they arrive at the checkout,
which is intended to streamline the payment process and the purchase in general.

The project has been divided into two parts, the mechanical part and the electronic part.
The first will be carried out by my project colleague Carlos Darder, and it deals with the
structural design of the cart, as well as the integration of the various electronic components
of the system. An ectronic system that will be designed in the other part of the project, in
which the software will also be designed that will allow the interaction between the various
components as a simulation.

In this document this second part will be carried out, therefore, the objective of this
particular project is to design, as a whole, the electronic computer system that allows
automatic collection.

Once the design of the real system has been made, the objective will be the creation of a
first prototype of the system. Therefore, the various elements of the system will be
implemented and a prototype of the system software will also be designed as a simulation.

2.2. Scope of theproject

To address the problem, a first phase of study of the state of the art and analysis of possible
solutions existing today was carried out jointly. Once the system to be designed was
decided, each one then focusedon his part of the project although a certain interaction
between the two parts was inevitable throughout it, so that it has been working in parallel
at all times. This document will explain:

• A first phase of study of arte to check where automatic collection systems are today.
Page. 8 Memory

• A comparison and selection between the different technologies and purchasing


algorithms that can meet the specifications set. A study will also be made of
thesecurity systems applicable to the chosen alternative.

• Already focusing on the electronic part of the project, the detailed design will be
carried out, in which the system will be divided into two large blocks: on the one
hand, the purchase control system (part of the cart) and on the other, the collection
post. The components that best fit the specifications will be chosen and their
operation and interconnection will be explained.

• A first prototype of the automatic collection system will be implemented,in order to


demonstrate the technical feasibility of the solution adopted. With the exception of
the final part of payment, the whole system as a whole will be simulated, since it
has been considered that, being an innovative purchase method to which the
customer is not accustomed, ademonstration of its operation would be useful.

• Breakdown of the activities that have been carried out throughout the project
through a Gantt chart, in order to explain what has been the planning that has been
followed during these monthsis work.

• Budget of the project carried out, including the hours of work and the material cost
necessary for the implementation of the prototype. An economic estimate will also
be made of what the project as a whole would cost if it were tobe installed in a
supermarket.

• Study of the environmental and regulatory considerations that must be taken into
account when designing the automatic collection system.

3. Study of precedents

3.1. Internet search

The most important revolution in the history of product sales was 40 years ago, when the
world's first product, a pack of Wrigley's gum, was scanned at a Marsh supermarket in
Automatic collection system for supermarkets Page. 9

Ohio. Since then, the most successful coding model hasbeen the barcode. Currently two
million companies worldwide and 25,000 in Spain alone use it to code their products.

At present, with new technologies, the Internet, smartphones, microcomputers and all the
advances in computing and electronics, there is an increasing trend towards automation.
For this reason, companies struggle to implement modern systems at the point of sale and
thus achieve a greater number of sales, doing it at a lower price and with greateravailability
of schedules. The current trend of the collection system in supermarkets suggests that they
will be increasingly automated and require fewer staff.

Below we will explain some pioneering experiences that have been carried out
bysupermarket chains around the world and some of the most modern and innovative
collection models that currently exist and that have incorporated different companies.

At all hours

At all hours [1] is a franchise dedicated to the


remodeling of medium or small premises so that they
can operate fully automatic without the need for
personnel.

It is based on a series of robotic compartmentsthat


dispense the products selected by the customer, who
chooses them through a touch screen. Once the
purchase is finished, the products leave through the
outbox and the own Fig. 3.1.1 – System mechanism

System facilitates the number of bags needed.

Source: At all hours


The minimum investment is 34,900 euros
according to the official website of the
company and can be implemented in a place
with a minimum of 10m2. According to the
opinion of some entrepreneurs who have
invested in this technology, it has been

Fig. 3.1.2 – Establishment.


Page. 10 Memory

observed that the profitability of This business is not too high. According to most
entrepreneurs It is practically impossible to reach
Source: At all times amortize the initial investment. The machine has
Many failures and blockages, not to mention that delicate products or susceptible
tobreaking cannot be added to drawers. So at the moment there is no news of any
franchisee who has done well business. Part of the problem with people not buying with
this system is that they don't see the product until they've bought and paid for it.

Openval

This business model is similar to that of 'A todas horas'. It is based on having a place with
many of the typical vending machines and that the user acquires any product through them.
It is not possible to have machines of any product but there is a lot of variety: traditional
snack machines, hot drink machines, hot products such as pizzas, ice cream machines
and other cold products and even product machines such as condoms, compresses,
cigarette paper and batteries are available. [2]

Tesco "Home Plus"


The revolutionary idea of this company
has been to 'bring supermarkets to
people'. It emerged in South Korea,
which is the second country with more
people working and where the pace of life
is very hectic. Tesco realized this
situation and offered itscustomers an Fig. 3.1.3 - Virtual store on the metrofrom Korea
option to make the purchase without having to
southern. Source: Oddculture.com
sacrifice more time. Instead of having an establishment or premises in a fixed place, they
took paper replicas of the shelves of a supermarket to other parts. In this way, products
can be taken virtually anywhere, such as the corridors of a metro stop. If a product catches
the attention of a passing person, simply scan the item's QR code with a free mobile app
and it is automatically added to a virtual shopping cart. Once the purchase is finished, it is
sent directly to the customer's home at the desired time. [3]
Automatic collection system for supermarkets Page. 11

RAPTOR System (Retail Application Prototype Testing of


Operational Robotics)

The RAPTOR System [4] is a prototype capable of reading codes using imaging software
and with 360º visual capability. It uses 14 cameras to identify products from different angles
and thanks to a software created by the company ECRS itself, this system is able to detect
where in the image is the barcode and then perform the reading. So it does not use the
typical barcode scanner but needs intelligent visual information treatment.

This prototype does not fully automate the collection and identification system but greatly
speeds up the process, leaving the cashier all the time to pack the products or introduce
them in the bags. In this way it ishorrified time.

Fig. 3.1.4 – RAPTOR System de ECRS. Fuente: Web Armagpos

The problem with this system is that you cannot pass several products at once, otherwise,
the recognition software does not work properly. The user has to introduce the products on
the conveyor belt one at a time when a signal heardon the belt indicates it. While the
products are being passed, on the other side of the tape the cashier is introducing those
that arrive in their respective bags with a system designed to facilitate and speed up this
task.
Page. 12 Memory

"Shopping Buddy" de IBM

It is a project developed in 2004 that was tested for the


first time in a supermarket in Massachusetts (Stop &
Shop). It is based on a computer installed in the cart
with a reader that detects RFID-equipped products. To
personalize the purchase, the customer has the option
of entering a previously configured personal card, in
this way the computer goes Fig. 3.1.5 – Shopping
Buddy.
showing offers related to the products that Source: CoolestGadgets habitualmente buys
the customer. [5]

"Shopping Navis Wagon" by Fujitsu, Jusco y Dai Nippon


It is a project developed in early 2006, similar to
"Shopping" Buddy" but uses a manual reader instead of
one incorporated into the screen, that is, the customer
must take the reader and pass it over the products in
the cart to detect them. IncoIt includes an LCD screen
and an RFID reader created by Fujitsu that, combined,
allow you to get all the information you need about the
products in the store. [6]
Fig. 3.1.6 – Shopping Navis Wagon
Fountain:
Engadget

The EXTRA METRO Group “Future Store”

Also called "The supermarket of the futureor" [7], it was made in 2005 in Germany by the
supermarket chain METRO and the technology company IBM. The idea of this supermarket
model is that the customer arrives at the supermarket with the shopping list made and sent
by internet to the store. Once in the supermarket the cart, equipped with a small computer,
informs the customer of the route that the customer has to make to collect all the products.
The way forward indicates it by means of arrows projected on the ground. This supermarket
Automatic collection system for supermarkets Page. 13

also includes self-checkout boxes since they use RFID technology for the detection of
products through an arch at the end of the purchase.

Fig. 3.1.7 – METRO Group Future Store.


Sources: deepartmend.de / we-make-money-not-art.com

Woodman's Food Markets (Madison) 2013


In this supermarket they launched a mobile application created by NCR corp [8] that
allowed consumers to use their iPhone to scan products while they were shopping.
Customers could also use the app to create their shopping list before going to the store.
This increases the speed, efficiency and ease of purchases. To make the payment,
customers have enabled self-service boxes in which they scan a QR code on their phones
to transfer the information of the shopping list.

To confirm that the list of productsscanned


matches the products taken by the
customer, a check of the total weight is
carried out. Employees help customers
with any discrepancies detected by the
system and answer any other questions
they have.

Fig. 3.1.8 – Establishment. Source:


theshelbyreport.com
Page. 14 Memory

Ridge IGA Supermarket in Snoqualmie, Washington


Another existing mobile application is the one released by QThru [9], which can be used
on both iPhone and Android phones. The novelty presented by this application is that
customers can also scan QR codes to pay with a credit card saved in the application.

As for heavy goods, if you're buying three apples you just


have to weigh the products on adigital scale and scan a
QR code with your phone and add it to your list (you don't
have to print a label). The app also offered a recipe
section from which consumers could add teeth directly to
their shopping list. This allowed customers to create their
list from home, send it to the store and only have to go to
Fig. 3.1.9 – Payment system.

Store to pick up your order and pay. Source: Seattle Times

If customers scan a product that can only be sold to adults, the app won't let you pay without
an employee confirming their age. It would then scan a card with a UPC code on it so that
the system would allow the operation to bedone.

QThru was introduced to Myer's stores and offered a $50 discount for every $50 purchase
for using its app. With this measure the number of users increased radically, in addition the
average purchase of consumers increased with the use of thistechnology. To prevent theft,
they had an employee in charge of randomly checking some of the carts with the purchase
receipt.

“Scan & Go” Carrefour

In 2010 Carrefour implemented as a pilot test in its hypermarket in Alcobendas in sistema


Scan & Go [10] and currently it is still in use in some of its hypermarkets. Its operation is
very simple and the only thing it requires is the Carrefour Club membership card. Upon
entering the supermarket, using his membership card, the customer takes a barcode
reader that has a small screen with which to scan the
Automatic collection system for supermarkets Page. 15

products you want to buy as you enter them in your addition, the reader can be
cart. On the screen the customer will see the accommodated in a built-in
amount of each item and the total of his purchase, repair in all trolleys so that it
being able to control at all times what he spends. In does not bother the customer
during the purchase. Once
finished, the customer must go
to special boxes for this system
in which, scanning a barcode
that appears in Fig. 3.1.10 –
Scan & Go System.

Source: Flickr.com

At the checkout, the system will tell you if your purchase has been randomly selected for a
review of a certain number of items or, if not, you have the green light tore-ealizar the
payment.

Walmart “Scan & Go” App


The hypermarket chain Walmart created a system very similar to the one previously explained
by Carrefour, although it went a little further as consumers scanned their products with their
smartphones. Customers only had to install the Scan & Go app [11] on their mobiles, choose
their products, scan them from the app and put them in their carts. Once the purchase was
complete, consumers had to scan a QR code in their app to transfer the purchase data to a
self-checkout terminal at the exit, where they had to pay for their purchase by card.

Decathlon

Decathlon's self-service system is used in machines where customers scan their products.
They are then placed in a cubicle in which RFID tags are deactivated. There are special
products that carry a special electronic label that is not deactivated in these cubicles. At the
moment in which the cubicle detects the presence of one of these labels, a light lights up that
warns the supervisor and he helps the client to remove the label. For the proper functioningof
this collection system, the presence of a supervising employee for the self-service checkouts
is necessary. In addition to taking care of surveillance, it also helps customers make the
purchase.
Page. 16 Memory

Once all the products have been scanned, the customercan make the payment by card. This
system has a drawback that can be used for the benefit of the thief and is that the labels are
deactivated when entering the cubicle whether or not the client has paid.

Ikea
In Ikea there is a system in which a barcode reader gun is used so that the customer himself
is the one who scans the products he has purchased. It can only be used for purchases of
less than 20 items and only card payment is accepted. A system is installed todisable
electronic labels once the customer scans the product, although it is not currently in use as
most Ikea products do not carry a security label. There is one employee for every two boxes
who is dedicated solely to life, except in the case of many people who do it quickly.

Crossroads

This system has been implemented for 2 years in some Carrefour establishments. It consists
of a collection terminal located at the exit, in which there is afixed barcode and a
checkweighing system. As in Ikea, its use is also restricted to purchases of less than 15 items.

Once the customer has completed the purchase, he must go to this box and scan his products
withthe code reader. Once scanned, you must deposit it in a box located right next to it, so
that the product is weighed. Until you have deposited the product in the box, the system does
not let you scan the next one, since the weight sensor does not detect the product . The
system also crashes if you scan a unit of a product and then insert more than one unit into
the box or insert a product other than the scan. In the event that more than one unit of an
item has been purchased, there is anoption to enter the number of units and not have to scan
them all.

The biggest problem of the system occurs when you scan a product and insert another in the
box of equal weight, since the system cannot detect it. To avoidthis type of theft, there is an
assistant who watches four boxes at once and if he sees that a customer is trying to cheat
the supermarket, he can stop his purchase and attract attention.

For that, it is necessary to train the cashier assistant to monitor the four boxes he is in charge
of. The assistant has full control over what is happening in each box and can act through a
touch screen in the different errors that may arise. On a screen you see the list of products
Automatic collection system for supermarkets Page. 17

of the fourautomatic boxes and can stop the purchase at any time. To buy a product that has
an age ban such as alcohol, the authorization of the employee who watches is necessary.

Alcampo

Mobile scanning systems have been installed that allow your


customers to make their shopping list by scanning with their Mobile
phones the barcodes of the products and finally going through a
specific box to make the payment. In it, the customer sends the list of
scanned products from the mobile to the payment terminal, through
the scanning of a QR code that initiates the action. At last The
customer makes the payment and leaves the establishment.

Fig. 3.1.11 –Google


Mobile Play
app.Fuente:

IBM Self-Checkout

It is one of IBM's inventions currently on the market. It consists


of a self-collection machine adaptable to different points of
sale. This model offers a configurable three-level security,
based on the pesor, with adjustable safety tolerances, which
help reduce employee intervention. It is not a store model by
itself, but it offers the possibility to private companies to obtain
an already created model of self-charging machine. [12]

Source: IBM
Fig. 3.1.12 – Point of sale
3.2. Visits

Due to the proximity of some of the establishments mentioned above, it was decided to make
a visit to talk to the staff and try to obtain some more information about the main problems
andvirtues of each of the systems.

In Decathlon, the conclusion was that the system was not safe against theft and that security
guards had to be placed to monitor the boxes. Mainly, it was very typical to change labels
from expensive products to cheaper ones. In addition, the problem occurred when there
were many customers, since the collection process was slowed down due to customers who
did not know how to use the system, so it should be the employees themselves who helped
the customers.
Page. 18 Memory

At Ikea, the system for deactivating security labels is not currently in operation, since most
of its products do not use them. Regarding the operation of the system, we were told that
only in cases of many customers werethey the ones who scanned the products to make the
process faster. Another difference with respect to other establishments is the limitation of the
system to users with less than 20 products.

Carrefour was the establishment that worked bestin the collection system. What we were told
by the employees was that the second time a customer uses their system, the effectiveness
of it becomes more evident. In addition, a curious fact is that normally children and foreigners
are usually the ones whouse it best (according to those in charge of Carrefour). The
explanation they gave us is that the system is very guided, and people are not used to reading
and following instructions rigorously. Children, on the other hand, do look at what the machine
identifies to them and use the system correctly. On the other hand, foreigners have more
ease to use it since, apart from being in different languages, in other countries there are
similar systems they are more accustomed. In spite of that, the most common users are
elderly people who go to the supermarket every day and once adapted to the system take
advantage of its facilities. Finally, we were told that the main problem arose on Saturdays,
when there are many people in the standard boxes,since many customers go to these
automatic boxes by mistake and not knowing how to use them causes traffic jams.

4. Basic specifications
The adverse economic situation of recent years has led to an evolution in retail trade. The
significant competitiveness in this sector has become a stimulus for many establishments,
which are committed to creativity and technological innovation to differentiate themselves
from their competitors. Companies seek in technology to improve the service to their
customers and make them leave their establishments as satisfied as possible. To do this,
they must be aware of the aspects that consumers value most and try to enhance them.
Products Variety of products Sellers Amiability
Variety of brands Formation
Quality Sufficient staff
Presentation Zero waiting times
Prices Good prices Confidence
Good deals
Automatic collection system for supermarkets Page. 19

Establishments Proximity Additional Home delivery


Size services Financing payment by card
Cleaning Quick box
Luminosity Returns
Timetable Parking
Comfort

Table 3.2.1 – Aspects valued by users of a supermarket

In blue, those aspects in which it can be influenced by the new automatic collection system
have been highlighted. Once we know which needs and aspects consumers value mostand
those factors that are believed to be erodible, the specifications for the collection system to
be designed can be determined.

• Automatic: that it is a system that works by itself, without the intervention of the staff
of the establishment. The customer must be able to carry out the entire purchase
process himself.

• Insurance: unknown loss is a serious problem for many companies and one of the
causes is the way in which certain procedures are designed or executed, which can
inhibit or facilitate theft. That is why we will try to design a system that is as safe as
possible, that is, that maintains or reduces the current level of thefts (1-2% of
turnover).

• Fast: it is important to keep in mind that we live in a society that increasingly


appreciates free time and that any innovation offered at points of sale that allows them
to save time is likely to be liked by the consumer. That is why we want to increase the
current average of 20 items per minute of the current boxes.

• Easy to use: when the design of the system is made, the capabilities of the final
consumer must be taken into account, since after all this will be the one that will dictate
the success or failure of the designed system. For this reason, we must not fall into
the error of introducing systems that, in the end, due to their complexity, make it even
longer for customers to make their purchases.

• Economically viable: it will be decisive when a supermarket implements it. From this,
other aspects will begin to be assessed. It should be borne in mind that despite the
Page. 20 Memory

initial investment, a profit is expected due to a reduction in staff that will vary
depending on the size of the establishment.

• Easy implementation: the introduction of the system should not involve major changes
in the production system, especially by suppliers. That is, in the labelling of products
or in the tolerances of product weights.

• Comfortable: Apart from the ease of use of the system, comfort is a very important
factor. That is why it is desired that the user does nothave to remove the items from
the cart to make the payment.

Now that the general specifications have been exposed, it is possible to move on to
conceptual design, where the various alternatives will be generated taking into account the
specificationspractically exposed. Once in the detailed design, they will be determined in
more detail, for each of the subsystems, the specifications must be met.

5. Conceptual design

5.1. Generation of concepts

Once the specifications that our system has tomeet have been raised, a study of the different
alternatives has been made to satisfactorily address the requirements. It will be explained
below what each of them consists of, as well as their possible variants, advantages and
disadvantages.

1. RFID (Radio Frequency Identification Device)

General operation

Radio frequency identification (RFID) is a technology for capturing and automatically


identifying information contained in electronic tags ( tags or transponders). When these tags
enter the coverage area of an RFID reader, itsends a signal for the tag to transmit the
information stored in its memory, usually an identification code. One of the keys to this
technology is that the retrieval of the information contained in the label is done via
radiofrecuencia and without the need for physical or visual contact (line of sight) between the
reader device and the tags, although in many cases it requires a certain proximity of these
elements.
Automatic collection system for supermarkets Page. 21

In the specific case that is being treated, the labels should be placed on each product, so that
when the end of the purchase is reached, the customer should simply go through a detector
arc. These arcs would allow products to be detected without taking them out of the cart,
thanks to RFID technology. Therefore, in addition, the customer could save the products
during the purchase.

Then, the operation would be as easy as entering the establishment, taking the desired
products and finally going through the magnetic arcs without taking the purchase of the case.
The amount would be calculated from the information received from the labels, the customer
would pay and leave.

Fig. 5.1.1 – Flowchart


Variants

Automatic payment by customer card

This variant is based on the system previously explained, but with the added factor that the
user should have a client card. This would be like an electronic tag that, when passing through
the magnetic arc, would identify the client. It would also be stored in the customer's account
number, from which the amount of the purchase would be automatically deducted.

Payment at collection post

This variant is designed so that it is not necessary to have a customer card to buy. In this
case, the customer after passing through the magnetic arc would find a payment terminal in
which he would see the amount to be paid reflected. Once the payment is made, security
barriers would be opened that would allow the customer to leave the establishment.

RFID system integrated in the cart

This alternative is the most divergent of the others. In this case the radio frequency
identification system would be integrated into the cart. That is, there would be a series of
antennas located at various strategic points of the cart that would allowto identify the products
inside (the antennas would perform the same function as the magnetic arc in the other
variants). Another novelty would be that in the cart there would be a small screen that would
serve as an interface with the user. In it you would see the products purchased, as well as
Page. 22 Memory

the total price to be paid and once the purchase is finished, the customer could make the
payment in the same cart by credit card. At the exit of the supermarket there would be a
magnetic arc that would beep in case the client had not made the payment beforehand.

Advantages and disadvantages

As advantages of RFID technology would be the ease of use it would offer the user, since the
purchase method would be the same as the current one unlike the final payment, whichwould
be faster. Therefore, the system would have the acceptance by the user without any problem.
The system would be very reliable since the technology is already developed and reliable,
which means that there would hardly be any problems of efficiency. Finally, with this system,
there would be absolute and instantaneous control of the stock in the supermarket, which
could make a more efficient and faster replenishment of the shelves, and sales would not be
lost due to lack of supply.

As drawbacks would be that the labels could be torn off and when passing through the
magnetic arcs they would not detect the products and the client could steal. On the other
hand, there would be the problem of labeling, since currently the products usen the
identification by barcode. This would force suppliers to change the type of labeling, or to label
products again once in the supermarket. This would be a fairly significant problem if RFID
technology were not establishedas the standard and products came directly with electronic
tags from suppliers. But the main problem would lie in the economic cost of this technology,
since electronic labels currently have a price ofbetween 10 and 20 cents, which would lead
to a general increase in product prices. With products of a certain value, the problem would
not be so serious, but for cheaper products, the system would be unfeasible.

2.D-code and bars

General operation

With this purchasing system the customer would be responsible for reading the barcodes of
the products himself as he was buying. In this way, the current checkout would be eliminated,
where the products are scanned one by one, and therefore, the queues that are generated
there. This system has several variants that will be explained later, but the basic operation
would be as detailed below.

The customer would arrive at the store and purchase a cart, togetherwith a barcode reader
unit. The purchase would be made as in a conventional establishment, that is, the customer
Automatic collection system for supermarkets Page. 23

as he goes through the aisles is taking the products he wants. The only difference would be
that the patient should scan the products before putting them in the cart. Reading, as will be
explained later, can be done in different ways, depending on the technology. The storage of
scanned products would also present several alternatives. In the cart a screen would be
placed where the customer would see the scanned products reflected and would serve to
interact with it. Once the purchase is finished, the customer would go to the exit, where he
would make the payment and thenreturn the cart.

Fig. 5.1.2 – Flowchart

Variants

Drive

A. Fixed reader to the cart: this alternative consists of a barcode reader located right next
to the screen or even incorporated into it, so that users should bring the products
closer to the reader to scan them. This system would be a problem for heavy products
as some customers would have difficulty lifting and positioning them correctly so that
the barcode was read.

B. Reader with flexible connection to the cart (cable): this option is designed to facilitate
the scanning of the products to the users, since unlike in the previous case, users
can approach the products with the reader to scan them. The cart would have a grip
for the reader when it was not necessary to use it. In summary, the convenience when
scanning the products would be increased, but the fragility of the system would be
greater since a misuse of the scanner could cause wear on the cable connections.
It would also have greater exposure to bumps or falls.

C. Lector wireless: probably the most comfortable option for the user but the most
complex to implement, the most expensive and the most susceptible to theft. In
Page. 24 Memory

addition, the power should be through batteries or batteries, and we should think
about recharging thesedevices.

D. Mobile application: this would probably be the most innovative and forward-looking
option. It consists of a free mobile application, which supermarket customers should
download to their Smartphone. To start the purchase, customers should identify
themselves in the application and then connect to the cart (via Bluetooth or WiFi) that
they had taken. As the customer scanned the products with the application, the
information would be sent to the cart, in which the scanned products would be
reflected through thescreen that would be incorporated.

Data storage

Three options were proposed for data storage, taking into account the general database of
the supermarket and the specific data of users' purchases.

A. In the reading units : one option would be to store the purchase data of each customer
in the memories of the reading units, either a barcode reader gun or the mobile
application itself. Once the purchase is completed,this information should be
transmitted to the collection station, in order to make the payment. Therefore, another
database would probably be needed at that point to be able to identify the information
received from readers.

B. In the cart: this option would be based on a mobile memory located in the shopping
cart in which the data received by the code reader would be stored. It could also be
possible that in this memory the information of all the products of the supermarket had
been stored. In this way, through the cart screen you could provide information about
the products, as well as include images of the products or offers available.

C. Central database: if you only had a central database, the communication would be
quite complex, since when a product was scanned by the reading units, they would
have to send the code to the central database. The product would then be identified
and the scanned product information would be returnedto the reading unit. This
operation could lead to quite a few communication problems if the establishment had
considerable dimensions, as well as delays due to distance.

Collection systems
Automatic collection system for supermarkets Page. 25

A. Payment withcredit card in cart: consists of a card reader that would be integrated into
the cart right next to the screen. In this way the customer would make the payment
from the same cart.

B. Payment via internet (card number): the customer would make the payment on the
same screen of the cart. You should only enter the card number and CVV code to
perform the online operation. In this case the trolleys should have an internet
connection via WiFi.

C. Payment in common payment terminal (machine): consists of a machine capable of


making the transaction and charging by card or cash. Customers once finalized their
purchase, would send their list to the machine from the payment menu on the screen.
Being a common machine for all users, it should set the payment order of customers
based on the order of sending the list.

Advantages and disadvantages

The main advantage of this method is that the current checkout step is eliminated, which is
the point where queues are generated in supermarkets today. With this system the customer
only has to choose the products he wants, scan them and make the payment. The time spent
in the supermarket will not depend on other factors such as the number of people, the
problemas of other customers at the checkouts or the skill of the cashier employees.

The main factor against this system is that the customer must read the products manually
during the purchase. This could cause some rejection by thecustomer since they would
actually be doing the job of the cashiers.

Another factor that should be taken into account is security. If this system is finally
implemented, some security measures should probably be taken to preventtheft. The cost of
the equipment to be installed should also be taken into account, since each cart would need
a reader, a screen and a microcontroller that interrelated everything.

Despite this, this system has a great point in favor and that is that it could be implemented in
various phases without paralyzing the activity of the supermarket. In addition, it could be
combined with the current system and depending on the acceptance of the client be extended
or not.
Page. 26 Memory

3. Vending

General operation

This purchasing system would be based on vending machines, but on a large scale. That is,
there would be a series of closed compartments with transparent doors, so that the customer
could see all the products inside but not take them. When the user wanted to purchase a
product, he should enter his customer card and the door would open.

The cost of the product would be immediately deducted from the customer card, which should
have an initial balance to make purchases. With this system, once the card is introduced, the
product would already belong to the customer. That is, the payment would be made
progressively as it was purchased.

Once the product is removed, the door would close and another product identical to the
previous one would be placed in its lugar (by means of a helical coil similar to those of vending
machines). A grid or vertical wall should be placed between the chosen product and the spare
products, to avoid theft.

The problem would be in the returns. If a customer regretted the purchase of a product, it
would not be possible to introduce it into the machines again. So a returns counter would
have to be enabled, in which the product would be returned and, if it was in good condition,
the amount would be returned to the customer.

Fig. 5.1.3 – Flowchart


Variants

Automation

A variant of the previous system would be process automation. That is, instead of the
customer taking the products from the machines, that once the customerpassed you the card
to buy the product, it was added to his list. At the end of the purchase the customer would go
through the collection point where his bag with all the products he had selected would be
delivered.
Automatic collection system for supermarkets Page. 27

The automation of the system would be relative, since the operation would be as follows: as
customers were buying products, these through a mechanical belt would go to the point of
delivery, where the operators would have somescreens with the lists of each client, and in
which they should make the separation and packaging of the products.

Advantages and disadvantages

The main advantages of this system would be the reduction of thefts, since to reach a product
theclient would have to make the payment beforehand. On the other hand, in the case of the
automated system, the work on the part of the customer would be practically nil, since he
would only have to pass the card on those products he wanted and, finally, collect the
purchase.

Even though the system may look very good, it has quite a few drawbacks. To begin with, the
implementation of the system in an existing establishment would be almost impossible, due
to the large structural changes that it would entail. In addition, theinitial investment would be
very high since a large number of machines would have to be purchased.

On the other hand, the customer could not look at the products before buying them, that is,
look at their labels with the characteristics, the quantity or, in short, become familiar with the
product. This fact could imply a certain reluctance on the part of the client to the system.
Another factor to take into account are the queues that could be generated, either in the
machines to buy a certain product, or at the delivery points, in the case of the automated
system. At peak times, the work of separating products at delivery points could be very
complicated due to the high number of customers, which could lead to errors.

Finally, with thissystem there would be a great dependence on machines, which in case of
failure would disable the operation of the supermarket, so the technical risk of this option
would be quite high.

4. Product identification by image

Funcionamiento general

This system is based on the identification by image of the products. The system would be
similar to the RAPTOR System that has been previously explained, which consisted of a
system capable of reading barcodes using imaging software, which allowed to identify the
product and determine where the code was to later read it. Well, the system would consist of
a tape in which the products would be deposited and that would pass through an "arch"
Page. 28 Memory

or "tunnel" detector in which there would be cameras that would allow the identification of the
product.

The purchase system would be the same as the current one, with the only variation that
instead of cashiers there would be this scanning system. The collection process would not
be completely automated, but it would speed it up a lot since as the products were scanned,
the cashier or the customer (if it was decided to dispense with the employees) could pack the
products in bags. Finally, the payment would be made in the same way as it acts.

Fig. 5.1.4 – Diagram flow

Variants

One option to make the system faster would be to include a cart lifting system to extract all
products. At the base of the cart would be a system of cylindrical wheels, which when tilting
the cart would cause the products to slide,due to gravity, towards the mechanical scanning
tape. The front vertical wall of the cart would open (vertical opening with guides or circular
hinged) so that the products would leave the cart and slide to the belt.

A separation mechanism for the products should then be installed, as to use image
identification, they would have to pass one by one through the scanner.

Advantages and disadvantages

The advantages offered by this system is mainly the reduction of the time involved in the
automatic scanning of products. In addition, with the system, the speed in the boxes would
no longer depend on the employee in the box and would be uniform at a rate superior to the
human. Acceptance by customers would be assured, since the habit of purchase would be
practically the same.

The problem with this system is that you cannot pass several products at once, otherwise,
the recognition software does not work properly. So you have to leave theproducts on the
tape one at a time, leaving a space between them or introduce a mechanism that does so.
Another problem could be the investment/productivity ratio, since image recognition software
would probably be expensive, being a technology not yet implemented in this sector, and the
Automatic collection system for supermarkets Page. 29

chains could consider whether it is really worth making the investment. Finally, this system
would not meet one of the specifications that the system is intended to meet. The collection
would not be fully automatic and also the products should be removed from the cart to make
the payment.

5.2. Evaluation of alternatives

Once the different solutions to address the system have been explained, a comparative
analysis of the alternatives will then be carried out using a multi-criteria table in order to select
the best solution. Different factors will be taken into account such as acceptance, technical
risk, implementation, price or security. As can be seen in Table 5.2.1, each of the criteria will
be weighted according to its importance in the decision of the system.
Criterion Weighting (%) Explanation
Acceptance 25 Try to measure if customers would agree with the
implementation of the system

Technical risk 10 Maturity of the technology used and its correct


functioning

Implantation 15 Difficulty and structural change involved in the


implementation of the system in the
establishment
Financing 10 Economic cost of implementing the system
Added costs 25 Impact of the implementation of the system on
product prices

Safety 15 Robustness against theft offered by the system

Table 5.2.1 – Table with weighting and criteria used to compare alternatives

Each of the alternatives has been scored from 1 to 5 (5 being the best score) according to
each criterion and, subsequently, the total has been calculated for each alternationby
weighting the scores.
Weight (%) RFID Barcode Vending Identification by
image

Acceptance 0,25 5 3 1 3
Technical risk 0,1 3 5 2 3
Implantation 0,15 2 5 1 3
Financing 0,1 4 3 2 2
Added costs 0,25 2 5 5 4
Safety 0,15 3 2 4 4
TOTAL 1 3,2 3,85 2,65 3,2

Table 5.2.2 – Multi-criteria table for comparison of the various alternatives


Page. 30 Memory

Sistema RFID

a) Acceptance of the system almost completely assured. The only change that entails
with respect to the current purchase system is to improve it (the passage through boxes is
eliminated).

b) Technology has been invented for many years now, although it is already beingused
in some establishments in other sectors, in this it would be an almost pioneering experience.
Therefore it is possible that some problems arise, such as interference or reading errors.

c) As far as the infrastructure of this system is concerned, the implementation of this


mechanism would not entail many changes and the investment would be relatively small.
The big problem would be labelling, as products do not currently come with electronic labels,
soall products in the establishment should be relabelled. This would be a great inconvenience
for the implementation of the RFID system.

d) The economic cost of implementing the system would not be very high. The main
investment would be the security arches locatedat the exit.

e) The other big problem of this technology, currently, is that the price of the products
would be increased because the electronic labels would have to be inserted in each product.
If the price of ch ips were to be reducedand made insignificant in relation to the price of the
product, this system would gain a good chance of being implemented.

f) The level of thefts could be increased because the labels could be torn off, disabling
thesecurity system. Measures should be taken to prevent this.

Barcode

a) The acceptance of the system would probably be good, although not as good as in
the previous case. On the one hand there would be the fact that customers should scan the
products at the same time as they make the purchase, and on the other, that at the end of
the purchase they should notqueue to pay.

b) The barcode has been the identification system par excellence for many years. The
same goes for readers, their operation is practically perfect and they almost never give
reading errors. If a mobile application is usedfor scanning, code reading is also very good if
correct lighting is available.
Automatic collection system for supermarkets Page. 31

c) The implementation of the system would be very convenient since it could be


introduced partially, without the need to paralyze the activity of theestablishment.

d) The economic cost of the system would be focused on the readers, screens and
microcontrollers that should be installed in each cart. It should also be noted that the system
would allow a reduction in the number of employees ofcaja, thus making the system
economically profitable.

e) The system would not entail any added cost to the products, since the manufacturing
process would be the same as the current one.

f) The security of this system would be its weak point, since it would not be controlledif
customers scan all the products they put in their carts. Some security and control systems
should be sought if this alternative is finally chosen.

Vending

a) The acceptance of this system by customerswould be doubtful as it would completely


change the habit of the current purchase.

b) The mechanical system would be very complex, so the technical risk of the solution would
be quite high.

c) The introduction of vending machines in the establishmentwould entail a major structural


change.

d) The large number of machines needed, due to the large number of different products,
would make the financing of this system quite high.

e) The price of the products would not vary, since the production system would be the same.

f) The payment of the products with this system would be prior to obtaining them, so the
thefts would probably be reduced.

Identification by image

a) The acceptance of the system by customers would be very good, since it would not
change the way they make the purchase. It would only be faster to pass through the box.

b) The technical risk of the solution would be relative. The image identification system has
not yet been used for this function, so it is not known whatits actual performance would
Page. 32 Memory

be. On the other hand, the system would notify products that were not identified and these
could be scanned manually.

c) The implementation of the system would not entail a very large structural change.
It would only be modifiedto the box area and its implementation could be done in phases.

d) The economic cost of the system would probably be high due to the novelty of the use of
this system in this sector.

e) The price of the products would not vary, since the production system would be the same.

f) The level of theft would probably be at the same levelas the current level, since the
purchasing system would be the same.

5.3. Choice of system

As we can see in Table 5.3.1, the solution that has obtained the best score, taking into
account all the criteria, is the product scanning system incorporated into the cart. If we look
at Table 5.2.2, the only weak point of this alternative is security, so the possibility of improving
the system in this aspect should be studied.
RFID Barcode Vending Identification by image

TOTAL 3,1 3,85 2,65 3,2

Table 5.3.1 – Total scores of the multi-criteria table

5.4. Security systems

Now that it has been decided that the automatic collection system will be based on a barcode
reading system installed in the cart, we will explain various security systems to improve the
operation and efficiency of the system.

1. Weight control system

Nowadays it is common in many companies to control their products through weight. It is


typically used for piece counting or for quality controls at the end of production lines. In this
way it is checked thatall the products are correct, i.e. that there are the corresponding units
on a pallet or that the units have been filled correctly.
Automatic collection system for supermarkets Page. 33

The checkweighing system would be the primary safety system. It would be based on the
verification that the weight of the purchase made (productsin the cart) is that corresponding
to the list of the purchase obtained (scanned products). The control would be carried out by
means of scales located on the same trolley. Below are some alternativesproposed for this
system.

A. Two scales with vertical separation: to ensure that the balances have sufficient
precision without raising the cost too much, this alternative has been proposed,
whereby the products are divided into theareas of the cart. In the part closest to the
customer would go the items of lower weight and in the farthest part the heaviest.
This distribution has been decided since most of the products that people buy are
within the range oflight products, so placing the objects in the nearest part is more
comfortable for customers. With this division of the weighing system into two
balances what is achieved is to improve the precision especially in the lightest
products, which are the most abundant and with which there could be precision
problems due to very similar weights. This would lower the cost of load cells, which
is strongly influenced by the accuracy of the balance as we increase the loadto
maximum.

In the balance for heavy products the accuracy could be reduced since the differences
between the weights of the products in this range are greater than the specified 5 g of
precision, which could also increase the maximum weightwithout that meaning
increasing the price much. The weight range of the two balances would be up to 10
kg for light products and from 10 kg for heavy products.

Fig. 5.4.1 - Separate trolley


vertical betweenand balances
Page. 34 Memory

B. Two scales with horizontal separation: this


alternative is based on the same concept as
the previous one, separating the cart into
two parts in which there would be adequate
balances for its range of weights and
precision necessary. The difference would
be in the distribution of the cart, since
in this case, the upper basket would house Fig. 5.4.2 - Cart with two scales light

products and horizontally separated products

heavy ones would be placed at the bottom. This option is designed thinking that
products outside the range of 10 kg in a regular purchase are very few, so the
customer has more space to place the products they normally buy.

C. A single balance: this option is based on a single


balance on which all products would be weighed. This
frees the user from having to separate the products
into two baskets. In this case the accuracy of the
balance should be as specified for the entire weight
range, which would require a
load cell of considerable precision and a high Fig. 5.4.3 - Cart with a
weight range. Single balance

There are several problems with being able to verify the list safely. The main problem you
can have is that you accept an incorrect list as if it were good. That could happen since there
are products of very similar weights, and there are other productsthat have small variations
in weight.

Products of similar weight may be confused at check. So the customer could replace them
with products of different price, as for example could happen with the oil and the vinot.

On the other hand, with a common labeling you can not know the real weight of each specific
product. Therefore, each one will have an average weight, and a margin of error.

In order to be able to make an estimate of the error in the weight of each product we havefixed
ourselves in the packaging machines. These machines provide an error between 1 or 0.5%
over their maximum measurement. On the other hand, we have the products that are
Automatic collection system for supermarkets Page. 35

packaged inside the centers. These scales have errors of 0.1% on their maximum
measurement that is usually 5kg. Although there is more margin of error in products that are
packaged volumetrically, such as legumes, or beverages.

But at the end of the day, most products pass quality controls that, in this particular aspect,
are regulated by Royal Decree 1801/2008 [13], which establishes the rules regarding nominal
quantities for packaged productsand the control of their effective content. It sets the
tolerances of the content of packaged products, fixing the maximum permissible errors in the
measure of the actual content. Therefore, most products will be within these ranges.

Fig. 5.4.4 – Table of RD 1801/2008

Then, two options are presented for weight checking: it can be done individually as the
products are scanned, or at the end of the purchase.

A. Checking individual weight

The most accurate way is to validate a product during purchase. In this way, only the error of
a product has to be considered, so weight increases would be measured. The product is valid
if the scale measurement, including the error, falls within the weight range of the product. In
the form of an equation is:

Pestimated Pscale ( Eq. 5.4.1) In order not

to cause confusion between products, the scale error should be small. If we give youa
large scale error, the measure taken will cover more products. Viewed graphically:

Large Average Small


measurement error measurement error measurement error

Weighing interval
Page. 36 Memory

Range products in database

In order to obtain a small measurement error, a very precise weighing system will be needed,
which makes the system more expensive. This is because load cell technology is more
expensive when accuracy increases, and even more so for high weight ranges such as a
purchase.

B. Verification of common weight

The second alternative is to do a heavy when the purchase is finished. Then it must be taken
into account that the average weight and the error depend on the sum of all the weights.

To make the verification of the purchase we will need an average weight and an error, and
thus be able to compare it with the measured. With this data, the verification will be the same
as with a single product.

To know the average and the error of the purchase we can test the weight of the products
and see what weight distribution they follow. If we adapt the distribution of pesos to a normal
law, we can know directly the mean and deviation of the entire purchase.

The mean of the total weight of the purchase is equal to the sum of the mean of each product,
and the mean of the standard deviation is equal to the square root of the sum of squared
deviations.

(Ec. 5.4.2)

(Ec. 5.4.3)

Although we do not know the standard deviation '' of each product, we can obtain it from

the ''. The value of Z chosen will have to cover practically the entire Gauss bell. Therefore,
we will choose the value of the least demanding cases in the industry inquality controls, which
Automatic collection system for supermarkets Page. 37

is Z = 3. According to Chebyshev's Theorem, 99.7% of the values taken by the weight of a


product will be within a range of three sigma.

(Ec.
5.4.4)
That is, if a product weighs 250±5 g. Its deviation would be σ=5/4=1.25 g.

Having outlined the two possible options, a more specific study should be carried out on the
tolerances of food weights and on the tolerance that should be allowed in the weight check,
according to the variation of errors in the products. From there, it would be decided based on
needs, such as accuracy, price or efficiency of the system, which of the two methods is best
suited to the system.

2.Cart status notification system

This system would have the function of informing if the weight of the cart corresponds to the
products that the customer has scanned at all times. Several options are proposed to do so:

A. Post with LED’s Informative: It consists of an antenna incorporated into the cart with
three LED’s colored at the top. The antenna would serve to visualize from a relatively
distant distance the status of the carts, thus alerting of a possible hUrto. There would
be an LED green, which on would report that everything is in order; an orange LED,
which would light up when scanning a product and remain in that state until the
customer placed the product in the cart; and a red LED, which would mean that the
weight of the products does not match the theoretical weight of the products on the
customer's list.

Fig. 5.4.5 – LED station

B. Sound alarm system: this system would consist of a small bell that would be activated
in the event that the weight of the cart did not match that of the list. This system has
the disadvantage of noise pollution that could cause. If several customers at once
hadweight problems in their carts, the sound could be annoying to customers.

C. Information on the cart screen: this would be the most discreet option for the user,
since only he would see the status on his screen. For example, you could geta green
square if the weight was correct and red if it was not adequate. In the face of security
personnel it would not be so easy to have customers who intend to steal controlled,
but there would be other methods to avoid them. It would be the best option in terms
Page. 38 Memory

of user privacy, since with the other methods, a customer who did not intend to steal
and had weight problems, could feel embarrassed in front of other customers due to
alarm systems.

3. Random controls (sampling)

It consists of a manual review of the purchase that would be made randomly. In the controls,
the matches between the products in the list (those scanned) and those in the cart would
mainly be verified.

If this were the case, the coincidence between the weight of the cart and the theoretical weight
would be checked in order to have information on the operation of the weighing system in the
carts. According to the statistics, it could be known if any changes or adjustments are
necessary in the system.

In case the weights did not match, it could be for two reasons. The first, that in the cart there
were more products than those scanned. In such a case the customer would be trying to steal
or would have forgotten to scan some product. In this case, the "loss" of such products would
be avoided. The opposite case would be that more products had been scanned than those
existing in the cart. The reason is probably because someone would have decided to leave
a previously scanned product and would not have remembered to remove it from the list. In
this case we would do the client a favor since he would have paid more than the bill.

Apart from random checks, customers who have been observed with attitudes suspected of
carrying out certain irregularities may also be retained. In addition, people who at the time of
making the payment the system would also go through this control when indicating that the
weight of the cart is not correct.

In all the controls that were carried out, information could be savedsuch as the result of the
control, the type of client (age, sex) or the time of day. In this way, a statistical study could be
carried out to determine the type of customer who steals the most or the most conflictive time
slots.

To compensate for the inconvenience tothose customers subject to control and that the status
of their purchase was correct, they could be offered some kind of discount or offer on the next
purchase.
Automatic collection system for supermarkets Page. 39

4. Security cameras

This system consists of the placement of videocameras in various points of the supermarket.
Through them you could observe from the point of control of purchases to the customers and
decide to which people the control is carried out. Another option would be for the security
cameras to be fake and onlyserve to intimidate thieves.

5. Security guards

They would be distributed by the supermarket to ensure that no thefts were made. Their
presence would likely reduce theft attempts, but it would also be uncomfortable for customers.
Another option would be for them to be only at the exit and control customers in the collection
area. In case of any irregularity they would send customers to the checkweighing area.

6. Physical barriers

The function of this system is to prevent a customer from leaving the supermarket without
paying. It consists of a mechanism of doors normally closed and that only opens when the
collection station gives the signal. In this way, when the customer had paid, the collection
terminal would send the signal to the doors to open and the customer could leave.

7. Anti-theft arches

This mechanism is used in many establishments today. It consists of the placement of


electromagnetic labels on the products and two electromagnetic arcs at the exit of the store.
The labels when scanned with the barcode reader are deactivated, due to a magnetic field
generator that has built-in. This prevents an alarm signal from occurring if the customer has
scanned the products. If it had not done so, at the moment of passing the product into the
magnetic field generated by the security arcs, the alarm would go off.

The problem with this security measure is that with the new code reading system that you
want to introduce, which is through a mobile application, the labels would not be deactivated
when scanned and the products would trigger the alarm.

5.5. Final solution

Once the various security systems that could be applied to the previously chosen alternative
have been raised, we will briefly explain which systems will be included in the detailed design.
Page. 40 Memory

The operation of the automatic collection system will revolve around two main pillars. On the
one hand, the barcode reading system and on the other the weight control system.

With this purchase systemthe customer would be responsible for reading the barcodes of
the products himself as he was buying. The reading of the products could be done by laser
guns of barcode scanning or through the mobile application of theestablishment.

In the cart there would be a screen in which the list with the scanned products would be seen
and would serve as an interface with the user. Through it you could modify the units of the
scanned products, thus avoiding the hassle of having to repeatedly scan the same product.

The trolley would also incorporate a weighing system as the main safety system. As products
were introduced, it would take samples of the weight, in this way theuser would be informed
through the screen if the weight of his cart corresponds to that of the products in his list.

The packaging of the purchase would be carried out during the purchase with bag dispensers
distributed by the establishment. Thus, after payment the customer could leave quietly with
his purchase already in bags.

Even with this weight checking system, there are several problems in being able to verify the
list with certainty. On the one hand there are products of very similar weights that could be
confused, and on the other hand, there are products with weight variations that can
camouflage some very light products. At the time of checking, a customer could take a very
expensive product instead of a cheaper product of the same weight, and the system would
not detect it.

To this end, the second security system would be introduced, which isthe sampling system
previously explained. It would consist of random controls that would be carried out on three
types of customers: on the one hand, customers who when paying did not match the weight
with that of their cart; on the other hand, customers who, througha surveillance system, have
been seen with suspicious attitudes; and finally, to random customers.

The surveillance systems could be security cameras or guards, which would allow to inform
about the clients to whom the control is carried out .

Finally, after the collection terminals there would be normally closed doors that would only
open once the payment was made. In this way, from the purchase control area it could be
controlled that suspicious customers did notleave the establishment without paying.
Automatic collection system for supermarkets Page. 41
Page. 42 Memory

6. Detail design
Once the process of generating ideas and selecting alternatives has been completed, from
now on the definitive solution explained in the previous section will be studied in depth. We
are going to divide it into two large blocks, on the one hand the purchase control system and,
on the other, the collection post.

Thepurchasing control system is the one that will allow the customer to make the purchase
and, to the supermarket itself, to have control over the purchase process of each customer.
As we will see later, it consists of the scanning unit, the weighing unit and thecontrol unit.

The collection post will be the point where customers, once their purchase is finished, must
go to make the payment. There will be several terminals where customers can pay and all of
them will be connected to thecentral database. In this way, when the customer makes the
payment, the purchase data will be collected and so the supermarket will have information
about the demand and stock of all products at all times.

6.1. Logic and algorithmic of the purchase process

A study of each and every one of the physical components that will make up the system has
been carried out, but before going into more depth each of them, it is considered essential
to understand the general functioning of the automaticor collection system that is going to be
designed. A flowchart will be used to break down each and every stage of the purchasing
process, as well as an outline of the system components and their interconnection. Once the
general operation has been explained, each of the blocks into which the system has been
divided will be specifically detailed.

The stages in which the designed purchase process will be divided are five:

1. Acquisition of the reading unit


2. Product selection process
3. Checkweighing
4. Collection rate
5. Possible control of the purchase
The process starts once the customer enters the supermarket. At that time there may be two
possibilities, that the client has a Smartphone or that he does not have it. In the first case, the
customer can scan the products through the supermarket's mobile application, which can be
downloaded free of charge in less than 30 seconds. In the second case, so that
Automatic collection system for supermarkets Page. 43

everyone can use the system, there will be a series of carts that will have alaser gun to scan
bar codes.

The possibility could be envisaged for the user to identify himself to the system, through a
customer card or by registering through the mobile application. In this way you couldbe able
to control the products that each user buys the most and offer personalized offers according
to their preferences. In addition, in the face of supermarkets, implementing this system would
be safer, since it would avoid the use of the system by sporadic customers with the sole
intention of trying to circumvent the system and steal. In that case, the activation of the
systems would be done through the client card and, at this point, any customer would be
ready to start the product selection process.

From there, the operation is very simple: the user will take the products he wants, but before
putting them in the cart, he must scan his barcode, either through the application or with the
laser gun. Immediately, the scanned product will appear on the cart screen, and from there
the customer can modify the units if he wants more than one unit. Then, the customer can
enter the products into the cart.

Thisprocess will be repeated as many times as the customer wants. Once you want to
complete the purchase, you must go to the collection station where you must indicate that
you want to pay on the touch screen of the terminal. This will return a code that the clickmust
enter on the screen of his cart, and once he does, the system will automatically start the
checkweighing process.

There can only be two possibilities, that the weight of the cart "matches" (or is within
tolerances) with that of the items in the customer's list or that it does not. In the positive case,
the customer will proceed with the payment of the amount indicated, in principle by credit
card (although a possible extension of the system and introducing cash collection is not ruled
out). Once the payment is made, the security doors will open and the client will be able to
leave.

In case theweight check is not satisfactory, the customer must go to the manual control station
of the purchase, where the purchase will be reviewed manually. Although it may seem
somewhat tangled, this is what is done in all purchases today, in addition, if the cliente uses
the system correctly it will not have any problems due to the weighing system. Once the
control has been carried out, the client can make the payment and leave the establishment.
Page. 44 Memory

Fig. 6.1.1 – Flow diagram of the purchasing process

In theprevious explanation there are some possibilities that have not been contemplated,
such as a customer wishing to leave a product that he had previously scanned. In that case,
the customer should remove the product from the cart but should also remove the product
from the list of scanned products. It would be as simple as selecting the product on the screen
and pressing a button to delete it. In this way, the customer could leave the product and would
not have problems when checking weight.

Now thatwe know how the system works, let's briefly introduce a diagram of the different
components that will form it (Fig. 6.1.2). The system will revolve around a mini PC, the
Beaglebone Black, which will control everything. The winged screenin the cart will be
responsible for interacting with the customer throughout the purchase process. It will see the
products that the customer is scanning with the laser gun of the cart or with the mobile
application. In the second case, the bar codes of the products will be sent via Bluetooth to
the microcontroller. On the other hand will be the load cells, which will weigh the cart basket
at all times and send the information to the microcontroller.
Automatic collection system for supermarkets Page. 45

Fig. 6.1.2 - Diagram of the components of the purchasing control system

Finally, we have to explain the operation of the components of the collection post, which will
come into action when the customer wishes to complete the purchase. To do this you must
go to the collection station, where you will be given a code that you must enter on the screen
of your cart. Once it does, the final weight check will automatically begin. If this is satisfactory,
the customer will put the credit card in the reader and enter the PIN through the screen of
the collection station. If everything goes as it should, the purchase receipt will be printed for
the customer and, subsequently, the security doors will be opened, through which the
customer can leave the establishment.
Page. 46 Memory

Fig. 6.1.3 - Diagram of the operation of the components of the collection station

6.2. Purchase control system

Specs

The requirements of the purchase control system are as follows:

• The system must allow the insertion and removal of purchased products in a list
through the use of the mobile application.
• The system must be able to comparethe weight of the product list with the reference
weights stored in memory.
• The granularity of the weighing must be 5 gr weighing about 30 kg.
• The system must allow connection to the charging terminal. You must transmit
information on theamount made and the amount to be collected.
• The transmission of the purchase data must be done by means of waves.
• The system must allow autonomous operation of the system for at least 12 hours,
which corresponds to the opening hours of our target customers.
• The full charge time of the batteries must be less than 10 hours (maximum time
between closing and opening of the supermarket)
Automatic collection system for supermarkets Page. 47

Morphology of the Purchasing Control System

The purchase control system can be divided into three large blocks, each consisting of
various components. Each of them will be briefly described below and then the components
that form them will be more specifically detailed.

Weighing Unit Control Unit Handheld Unit

1. Weighing Unit

The function of the weighing unit is to continuously check the weight of the shopping cart
basket and provide the information to the control unit. It consists of the three load cells
mounted directly on the cart, which provide a voltage directly proportional to the weight placed
in the basket. From these, an analog signal will be obtained that will be treated and then
transmitted to the control unit.

In this report the selection of load cells will not be emphasized , since it is part of the study of
my project colleague Carlos Darder. What will be studied will be the signal adequacy circuit
of the load cells chosen by my colleague.

2. Control Unit

The control unit islocated on the handle of the trolley and will allow the buyer to see at all
times the status of his purchase as well as make various modifications. Once the purchase
is finished, this unit must check that the weight of the cart matches that of the shopping
liststored in the cart device. If the weight is correct, you must transmit the dice to the payment
terminal.

The control unit will be coordinated by a microcontroller that will link to all peripherals, which
will be mostly located in this unit. The elements that constitute the control unit are:

- Load cell signal matching circuit


- Microcontroller

- Touch screen
- Bluetooth module
Page. 48 Memory

3. Handheld unit

This unit basically consists of the customer's mobile phone or the scanning gun enabled in
the cart.

In the first case, the only thing the user will need is to have downloaded the mobile application
of the supermarket, with which the customer will connect via Bluetooth with the cart he has
taken. Through the application the user must scan the products they want to buy before
entering them into the cart. In this way, the data will be sent directly to the microcontroller via
Bluetooth, then the customer will see the products he has scanned reflected on the screen
incorporated in the cart. Through it you can modify the units, thus avoiding the hassle of
having to scan the same product several times. In the case of the scanner, it would be
connected directly to the microcontroller, so the connection would not be wireless.

You could consider the possibility of combining both systems, or simply, enable some carts
with a gun and others without. In this way,customers who did not have a smartphone, would
take the carts with scanner included and those that did, the others.

Description of the components

Signal amplification and filtering circuit

As mentioned, for the acquisition of the data of theweighing unit, a previous conditioning of
the signal is necessary to make effective measurements of the load cells. The basic
requirements for measuring a load cell are excitation, signal amplification and bridge eq.

The load cells selected by my project colleague Carlos


Darder are the SX-1 of the Senel brand. They are S
cells that have been selected basically for their perfect
adaptation to the structure of the cart and the weighing
system that has been designed. Fig. 6.2.1 – SX-1 load
cells.
Source: Senel website
The recommended supply voltage for these cells is between 5 and 15 V, therefore, for the
excitation of the load cells, the batterythat will feed all the components of the system will be
used directly. This voltage (7.4 V) seems adequate since a higher excitation voltage would
proportionally generate a higher output voltage, but could also cause greater errors due to
Automatic collection system for supermarkets Page. 49

self-heating. It is very important that the excitation voltage is very precise and stable, so it will
have to be taken into account when selecting the battery.

The output of the load cells is normally relatively small. In this particular case the selected
cells provide an output of 2 mV/V, that is, with an excitation voltage of 7.4 V, the output signal
is 14.8 mV. Therefore, a load cell signal conditioner will be necessary. This usually includes
an amplifier to amplify the signal and a low-pass filter, in order to increase the level of
resolution of the measurement and improve the signal-to-noise ratio.

The decision of the circuit will be determined by the precision that you want to have in
theheavy system. The analog inputs of the Beaglebone Black have a resolution of 12 bits,
therefore, its output is a value between 0 and 4095 (through code the reading is transformed
into weight). The load cells also have a maximum precision and weight capacity. Depending
on whether the accuracy of the cells is less or greater than that of the analog inputs of the
Beaglebone Black, it will be used to perform the analog-to-digital conversion or not.

Let's take an example, if the selected cellshave a weight range of 75 kg and the accuracy
class is C3, i.e. 3000 divisions, the accuracy of the cells will be 75000/3000 = 25 grams. On
the other hand, if we make the 75 kg correspond to the maximum allowable voltage in the
analog inputs of the microcontroller (1.8 V) and therefore work in the entire available range,
the accuracy would be 75000/4095 = 18.3 grams. In this case, the same Beaglebone Black
could be used to perform the analog-to-digital conversion, since this would have more
resolution than the precision of the load cells. Only an instrumentation amplifier should be
used, which increases the output of the load cells and thus allows readings to be taken with
the microcontroller.

In the opposite case, an ADC (Analog-to-Digital) converter should be placed.


Converter) of a resolution greater than the 12 bits offered by the Beaglebone Black. Once the
conversion is done, the output of the converter would be connected to the Beaglebone, but
this time as a digital input. A good choice would be the ADS1231, which is a24-bit converter
with specific characteristics for sensors with Wheatstone bridges, as in our case.
Page. 50 Memory

Fig. 6.2.2 – Typical connection of ADS1231 on a balance.


Fuente: Texas Instruments

When installing a jumper it is very unlikely that the jumper will output exactly 0 V when no
voltage is applied. Conversely, slight variations between the resistors of the bridge and the
resistance of the cables can generate aninitial voltage other than 0 V (offset voltage). There
are different ways in which a system can handle this initial offset stress.

1. Software compensation: The first method compensates for the initial offset stress using
software. With this method, aninitial measurement is taken before applying the input
voltage. This is also known as auto-zero. This method is simple, fast and requires no
manual adjustments. The disadvantage of the software compensation method is that the
"offset" electrical stress of the bridge will not be removed. If the offset is large enough, it
will limit the gain that the amplifier can apply to the output voltage, thus limiting the
dynamic range of the measurement.

2. Offset cancellation circuit: The second balancing method consists of an adjustable


resistor, or potentiometer, to physically adjust the bridge output to 0V. By varying the
position of the potentiometer you can control the level of the bridge output – initial
adjustment of the output to 0 V.

3. Overriding the offset via buffer: The third method, like the software balancing method,
does not affect the bridge directly. With an override buffer, an override circuit adds an
adjustable voltage to the output of the instrumentation amplifier.

In this case, the systemthat best suits is the Software Compensation system. In this way the
customer does not have to worry about calibrating the balance but automatically when a
customer starts the purchase process, the system will take a measurement of the "offset"
tension. This will be taken as a reference and the weight of zero grams will be attributed to it.
Automatic collection system for supermarkets Page. 51

Beaglebone Black

Beaglebone Black [14] is a development board


based on a Sitara class AM335x ARM Cortex-
A8 microprocessor from Texas Instrument's
Sitara class that operates at 1 GHz.

The main features of this minicomputer are two


32-bit PRU SS RISC, a 3D graphics accelerator,
2 GB of memory Fig. 6.2.3 – Bealgebone Black. integrated flash and 512 MB RAM,
Source: Maker Shed

plus a microSD slot. As far as ports are concerned, it includes two USB inputs, a standard
size host type and another micro USB client port type. It also has an Ethernet connection, a
micro-HDMI output, and two 46-pin connectors.

The default operating system isAngstrom Linux, which is included as standard in the internal
memory, but also supports Ubuntu or Android. Below you can see its main features:
Characteristics
Processor Sitara AM3359AZCZ100 1 GHz, 2000 MIPS0
Graphics engine SGX530 3D, 20 M Polygons/S
SDRAM memory 512 MB DDR3L 800 MHz
Flash memory 2 GB, 8 Bit MMC embebida
PMIC TPS65217C PMIC regulator i an additional LDO
Debug Support Optional 20-pin CTI JTAG, Serial Head
Power supply Mini USB, USB or Power 5 V DC External via expansion
Connector connector

PCB 86 x 53 mm 6 layers
Indicators LEDs: 1 Power, 2 Ethernet and 4 user controllable
HS USB 3.0 Client Port Access to USB0 via mini USb, client type
HS USB 2.0 Host Port USB1 Type-A Socket, 500 mA LS/FS/HS Access
Puerto Serial UART0 access via pin 6 3.3 V TTL head.
Ethernet 10/100, RJ45
SD/MMC Connector microSD, 3.3 V
User Input Reset button, Start button, Power button
Video output 16b HDMI, 1280X1024 (MAX)
1024x768, 1280x720, 1440x900, 1920x1080@24Hz
Audio Via HDMI connection, Stereo
Page. 52 Memory

Expansion connectors Power 5V, 3.3V, VDD_ADC(1.8V)


3.3V I/O on all signals
McASP0, SPI1, I2C, GPIO(69 max), LCD, GPMC, MMC1, MMC2, 7
AIN(1.8V MAX), 4 Timers, 4 Serial Ports, CAN0,
EHRPWM(0,2), XDMA Interrupt, Power button, Expansion Board
ID
(Up to 4 can be mounted)
Weight 39.68 grams

Table 6.2.1 – Characteristics of the Beaglebone Black

Touch screen

The touch screen is responsible for


interacting with the customer and
informing him of the status of his
purchase at all times. The screen will be
located on the handle of the cart, as it is
a comfortable place for interaction with
the user and

From the point of view ofthe design is the


More ergonomic place. This location Fig. 6.2.4 - BB-View cape. Source: Element 14 allows
you to consult data easily and does not reduce the volume of the cart basket. Not being limited
by questionsof space, it has been possible to select a relatively large screen that allows more
information to be exposed and consulted more easily. Since it is a novel system aimed at a
very wide range of customers, the large size of the screenwill allow buyers to internalize its
operation more quickly.

The screen that has been chosen is the BB-View of Element14, which is a layer or
expansion for Beaglebone Black consisting of a resistive touch screen of 7'' TFT LCD (Thin
Film Transistor – Liquid Crystal Display). It has been designed specifically for the
BeagleBone Black, which we remember is the one that will control the system.

This is connected to the LCD screen through an FPC (Flexible Printed Cable) cable and
also being an expansion for Beaglebone Black extends the inputs and outputs of the same
allowing users to use the LCD module with touch screen ssacrifice the I/O interface access.
Another ease it offers is that the touchscreen is powered directly from the board thus
eliminating the need for external power.
Automatic collection system for supermarkets Page. 53

Feature
LCD size 7 inches
Panel type a-Si TFT active matrix
Resolution 800 x 480
Colors 16.7M
Interface RGB 16-bit
Touch screen Resistive
Supply voltage 5V
Feeding intensity 750 – 1000 mA

Table 6.2.2 – Main features of the BB View Cape

Bluetooth module

As the Beaglebone Black does not have a Bluetooth


connection, an adapter must be incorporated so that data
can be exchanged with the Smartphone and with the
collection terminal. Since the Beaglebone Black has a USB
port, it will be used to connect an adapter
Bluetooth with USB connection. The
IOGEAR Bluetooth 4.0 USB Micro Adapter, por sus Fig. 6.2.5 – IOGEAR Bluetooth.
small dimensions, but many other models couldSource : Iogear serve to perform this function.

Battery

For the choice of the battery, three factors have been taken into account that it had to meet
for the correct functioning of the entire system.

First, that the power circuit was able to provide all the voltages required by the set of circuits.
This means that in order for costs to be lower and the autonomy to be greater, the battery
must provide the maximum voltages, to avoid the use of boost converters, which represent
an increase in price in the circuit and a significant increase in energy consumption, given the
low performance of these converters.

Secondly, it was necessary that the battery was able to provide the currentand necessary for
the proper functioning of the circuit in conditions close to the nominal ones. All batteries can
serve peak currents well above their rated levels, but this causes substantial drops in battery
charge that reduce the time needed between charges.
Page. 54 Memory

Finally, it has been taken into account that it was not necessary to recharge the battery during
the period in which the supermarket is open, that is, the battery must allow the continuous
use of the system for about 12 hours, which correspond to the opening hours of our target
customers.

In order to meet all these conditions we carry out a study of the nominal voltages and currents
required by the different sub-circuits:
Component Voltage (V) Rated current (mA)
Beaglebone Black 5 210 -460
LCD Touch Screen 5 1000
Bluetooth module 5 500
Load cells 5 - 15 10*

Table 6.2.3 – Electrical specifications of components

* It is an estimate, since the intensity will depend on the load, but in any case the value will
be negligible with respect to that of the other components

From the above data we obtain that the characteristics of the battery to be sought are a
nominal voltage of 5 V, a nominal current at that voltage of 1.5 A, and that in the previous
conditions it endures the full commercial day of 12 hours. You have to size the batteries this
way, they would probably be oversized, since the consumption would be this if the cart was
in operation and the screens on throughout the day. The consumption of these decreases
significantly when they are not used, since it can be programmed that the LEDs that illuminate
it are turned off.

After contemplating several possibilities, finally some Lithium-Ion batteries of 3.7 V and 10
Ah capacity of the manufacturer UL have been chosen. As a higher voltage is needed to
power the components, two must be placed in series and thus have 7.4 volts. This voltage
is suitable for directly feeding the load cells, but to power the Beaglebone Black, the
reference voltage of 5 V must be generated. For this, theREF-02 circuit will be used, which
generates the desired voltage without further problems.
Automatic collection system for supermarkets Page. 55

Fig. 6.2.6 – Li Battery-Ion 3.7V 10Ah. Fig. 6.2.7 - Ref-02. Fuente: Texas
Fuente: Battery space Instruments

Another advantage that the cells had is that due to their dimensions and shape, they were
suitable to place them behind the screen selected for the cart. This made it much easier to
incorporate the entire system into the cart.

With two batteries in series, the capacity would still be 10 Ah. If we take into account that the
discharge will be carried out at approximately 1.5 A, we can calculate that approximately
there will be an autonomy of 6.6 hours, although the relationship is notcompletely linear.
According to the specification sheet, a discharge at 0.2C, which would be 2 A, the battery life
would be greater than 5 hours. Therefore we can already get an idea that the autonomy
would be around 6 hours.

If it is not considered sufficient, two more cells should be placed in parallel and the capacity
doubled. But it has been considered excessive, since the current consumption is probably
less than that used to size the batteries, and the autonomy would be greater thanthe 6 hours
calculated.

If these battery packs are built autonomously, a BMS (Battery Management System) must be
installed, which is an electronic device that manages and controls rechargeable cells and is
commonly usedto control batteries composed of several cells. For lithium batteries, its use is
almost indispensable due to the delicacy of this type of battery. The primary functions of the
BMS are to control and protect the battery cells, to extend their useful life, to equalize the
voltages of the different cells and to keep the battery in a state where it can meet the
requirements for which it has been specified. The basic protection parameters are usually:
excess currentduring charging or discharging, short circuit, overloading, over-discharge,
ambient temperature control or overheating. And it does this by controlling the status of the
battery through various parameters such as voltage, intensity, temperature, state of charge
Page. 56 Memory

(SOC, in English, State of Charge), depth of discharge (DOD, in English, Depth of Discharge)
or state of life (SOH, in English, State of Health).

With the batteries that have been chosen, we need the following parameters to be controlled:

• Protection against overloads greater than 4.2


V/cell
• Protection against over-discharge below 2.5
V/cell
• Protection from maximum drainage current
• Short circuit protection
Fig. 6.2.8 – PCM connection.
Source: BatterySpace
Therefore we will need a PCB or PCM (in English, Protection Circuit Board or Module) which
are small inserts that perform the functions previously commented. The PCB-S2A7 B model
has been chosen, which is a model for 7.4 V Li-ion two-cell battery packs with a discharge
current of less than 3 A.

6.3. Collection station

Specs

The specifications of this system are those mentioned below:

• Collection time less than 1.5 minutes.


• Ease of use is one of the main aspects. To establish a reference, the system
must be as easy as a parking collection machine.
• You must be able to receive the purchase data sent to you from the carts via
Bluetooth.
• It has to be connected to the central database and be able to transmit the
purchase information via Ethernet.
• The system must have self-protection against anomalous actions to the usual
use, such as theft, blows, etc.
• Ease of maintenance: it must be easy to change components, either by
breakdown or by updating them.
• It must allow payment by card and allow a possible expansion in case you want
to add cash payment.
Automatic collection system for supermarkets Page. 57

• Quick error resolution(connection with the control system so that they come to
help or repair)
• It must be a safe system that does not give theft facilities to customers.

Morphology of the Collection Post

The collection station can be divided into three large functionalblocks, all controlled by a PC.
The first block would be the acquisition of the data transmitted from the cart, the second the
collection process and the third the anti-theft system.

Acquisition of
Collection process Anti-theft system
data
When the customer decides to complete the purchase, the control unit checks that the weight
was correct, and if so, sends the purchase data to the payment terminal. This is when the
function of the collection terminal would begin.

1. Data acquisition

This system consists of a Bluetooth module that will receive the information sent to it from the
cart. Remember that the data will only be sent if the weight of the cart is correct, so now the
system will be limited to receiving the products, quantities and the amount that must be
charged to the customer in question. The system will transmit the information to the central
Ethernet database, in order to have a control of the stock and demand in the supermarket.

2. Collection process

This block corresponds to the cob ro stationitself, therefore it is formed by the different
elements necessary to make the collection. At first the payment will be made by card,
although the possibility of incorporating cash payment would be left open. Everything will be
automatic and without the interventionof the supermarket staff.

The customer, when he arrives at the collection station, must touch the screen and there will
appear a code. Then, you must enter the code on the screen of your cart and it will
automatically proceed to performthe checkcheck. If the weight of the cart matches the
shopping list, the data will be sent to the collection machine and the customer will see on the
screen the amount to be paid. It will only be necessary to insert the credit card through the
reader slot and the card will be validated using the PIN code, which will be entered through
the keyboard on the touch screen. If correct, the amount will be transmitted by contacting the
Page. 58 Memory

bank via the Internet (thanks to anADSL connection). Then the card would be returned to the
customer and here the functions corresponding to the collection process would end.

The components that will form the payment terminal are the following:

• Credit card reader.


• Thermal printerto print the shopping list.

• Touch screen to display information and enter the PIN code of the card.
• PC where the database and the necessary collection programs are stored.
• Bluetooth to receive the data sent from the cart.
• 12 V DC supplemental power supply

3. Anti-theft system

The function of this block is to prevent theft by means of a normally closed door mechanism
that will only open if the payment terminal sends a signal according to the collection operation
has been carried out correctly. In this way, if the customer has made the payment transaction
without any anomaly, the doors will open giving free passage to the clientwith his cart. This
system will prevent a customer from leaving the establishment without paying.

Description of the components

Once the functional blocks of the collection post have been described, it will be determined
which components have beentaken to constitute them. The process has been as follows:
from the specifications and requirements necessary for each block, existing components
have been searched and those most suitable for the desired application have been selected.
The idea is that there is more than one collection terminal in the establishments, but for the
moment the components corresponding to a single automatic collection unit will be selected,
understanding that a replicable modular design would be made.

Creditito card reader

Two options have been considered for the card reader, manual and motorized. In the first the
card has to be swiped by the reader by the same client, while in the second, you place the
card in the slot and the mechanism takes it. For its functionality and comfort for the user, the
motorized one was chosen, since it exempts the user from any work and also does not give
so many reading errors because it is the mechanism itself that places the card in the ideal
position for reading.
Automatic collection system for supermarkets Page. 59

The selected model is the Hitachi-Omron V2BF that has basically been chosen for its compact
design. The connection to the PC of the collection station is made by RS232 connection. The
problem is that it needs a supply voltage of 12 VDC, so you will have to add a power supply
of that voltage.

Fig. 6.3.1 – Credit card reader Fig. 6.3.2 – Power supply 12 VDC
Source: Hitachi-Omron Source: Weidmüller

A switching power supply of the Weidmüller brand has been chosen, specifically the CP SNT
55W 12-15 V 3 A model. As the name suggests, it provides a power of 55 W, which is higher
than that required by the credit card reader.

Printer to print the shopping list

Its function is to issue the customer's purchase receipt once he has made the payment. Two
possibilities were considered, thermal printers and dot matrix printers (also known as impact
or ajuga, respectively). Several aspects were taken into account, such as reliability, speed,
print quality, silence of operation, connection, maintenance cost or investment in the
purchase.

Dot matrix printers draw text using impacts, using a technique similar to typewriters . They
make noise, need ink from time to time, have lower print qualityand are slower than thermal
printers. As advantages, they use plain paper (cheaper and easier to find than thermal),
support paper with copy and are cheaper than thermal.

Thermal printers draw the text usingcalor, heat the paper so that the text appears. They do
not make noise, do not need ink and are very fast, but paper is more expensive than normal.
Unlike matrixes, they can also print barcodes or logos on tickets. In addition, the print quality
is constant throughout the cycle, yes, the life span of the print is shorter.
Page. 60 Memory

As for the acquisition price, there are already thermal printers only slightly more expensive
(less than 10%) than a matrix, and although it has some limitations they are perfectly valid
for this particular case. This price is more than compensated by the speed of printing, silence
and, given the lower number of mobile parts, thegreater reliability.

As for the drawbacks of thermal printers, the maintenance cost is higher, but in return a very
high print quality is maintained at all times. In matrixes, both paper and tape are cheaper but
the print quality is actually lost appreciably from the second pass of the tape.

The problem of the relatively short duration of a thermal printing would only affect if it were
impossible for theticket to have a very long life, as for example in the case of a guarantee.
But for this use it is irrelevant, as it will last long enough.

In summary, due to the speed of printing, silence in its operation, print quality and imagen,
the decision was made to use a thermal one. So various possibilities were considered among
these according to the type of connection.

• The RS-232 connection is slower than the others, and is almost already in danger of
"extinction". The RS-2 32 is used less and lessand as mentioned, these printers last
a long time. So it could be the situation that in a few years it was decided to change
the PC of the collection station and it did not have RS-232 connection (RS232-USB
adapters are sold that could be a solution).

• Another option is LPT or parallel port printers. It is a fast, bidirectional port, and is used
almost exclusively for printers.

• The third option is the USB connection, which is probably the most recommended
since, despite being the one that takes less time in the market, it works perfectly and
also, today all computers have USB connections. Although they are usually a little
more expensive.
Automatic collection system for supermarkets Page. 61

Finally the chosen one has been the Epson TM-T20


which is a thermal printer and with USB connection.
This printer has been chosen since Epson is the most
consolidated brand in this sector, and also offers us
good functionalities. It is compatible with all current
operating systems and also includes a built-in AC
adapter (alternating core), AC cable, and interface
cable. So it can be connected directly to the network,
thus saving us an additional power supply. Fig. 6.3.3 -
Epson TM-T20 printer. It prints at a speed of 150 mm per second, the Source: PC
Components that ensures a fast printing. In addition, the dimensions of the paper roll are 80
mm, which is the standard measure of tickets.

Touch screen to display information and enter the card PIN code

Thefunction of the screen will allow the customer to see his shopping list, as well as the
price he must pay, before proceeding to do so. Later it will also serve for the customer to
enter the pin code of his credit card.

It was decided to use a touch screen to make the


collection station more compact and thus not have to
incorporate an additional keyboard. Finally, a 5-wire
resistive 15-inch TFT-LCD (Thin Film Transistor –
Liquid Crystal Display) touch monitor was chosen ,
with a resolution of 1024x768. The monitor is from the
manufacturer MaxPos and the model is the DTK-
1598.
It is similar to the one chosen for the cart but of greater
Fig. 6.3.4 – Touch screen. Source: dimension, as this way it can beintroduced

Commercial POS
easily the pin code and display the list of the
purchase. The connection of the touch screen to the PC will be made via a USB connection
and will be powered directly from the network.

PC for database and collection programs.

The PC of the collection station must have all the information of the products, in addition it
must be able to support without problem the programs of the collection system. Nowadays
Page. 62 Memory

most computers meet these requirements, sono specific model will be specified. Probably
with an Intel Core i5 processor, two or four cores of 2GHz speed, 4GB of RAM and 500 GB
of memory would already be enough. You could also put an additional 500 GB hard drive, in
case the main one does not fail the whole system. In addition, it should also have USB and
RS-232 ports for connections to installed peripherals. The operating system could be
Windows 7, since it is the one that supports the most software for the POS. Finally, you would
need to network via ADSL, since the flow of information between the PC and the different
bank branches and between the PC and the general database and the manual control unit
located in the same store has to be as fastas possible.

Electrically operated door system

The function of this system is to prevent a customer from leaving the supermarket without
paying. As the payment in the designed system is made without any human control, a physical
system is necessary thatonly lets customers out if they have made the payment. For this
reason, it was thought of a door mechanism that was normally closed and that would only
open when the collection station gave the signal. In this way, when the client had paid, the
PC would send the signal to the doors to open and the client could leave.

After considering various options, finally the model chosen has been the "PNG390 Twin" of
Automatic Systems. The system consists of a safety corridor, consisting of two longitudinal
modules located on the sides, each of which incorporates a thick glass, which prevents
people from passing between the two modules. One of the reasons why this model has been
chosen is because the width of the pads is900 mm and therefore allow the passage of
shopping carts (630 mm maximum width) perfectly. Another reason is their versatility, as they
can offer different configurations. If a single output is desired, only the two modules of Fig.
6.3.6 are needed, but in case you want several adjacent aisles to optimize space and
performance, there is the PNG380 Twin version (Fig. 6.3.5), which offers two independent
compact aisles. By combining both, you canplace as many aisles as you want. The various
elements are fixed to the ground and fed at 230 V, with a grounding for each.
Automatic collection system for supermarkets Page. 63

Fig. 6.3.6 – PNG390 FIg. 6.3.5 – PNG390 Twin


Fuente: Automatic Systems Fuente: Automatic Systems

The mechanism has a USB port to configure the operation of the microcontroller that controls
the doors. This way you can connect directly to the PC of the collection station, through which
the orders will be sent to you. Then you can program your signal corresponds tothe active
state (for example, input bit = 1) and which corresponds to the idle state (input bit = 0). In this
way if you receive a "0", the doors will remain closed preventing the passage, while if you
receive a signal iguto "1", the doors will open.

6.4. Possible control of the purchase from certain customers

Specs

• Help customers who have not passed the weight control and, therefore, the collection
station does not let them pay.
• Detect those customerswho have tried to circumvent the weight control system.
• Coercing those customers with intent to steal.
• Gain insight into the performance and effectiveness of the weighing system.
• Create a database with the information of the controls to carry out statistical studies.

Operation

This stage will only be passed by some customers and, therefore, is not a stage of the
standard purchase process. It consists of a null review of thepurchase that will be made only
to customers who have not been able to make the payment correctly, that is, that the weight
of their cart has not coincided with that of their shopping list.
Page. 64 Memory

Customers who havebeen observed, through surveillance cameras, trying to circumvent the
system during the purchase or are suspected of having made some irregularities may also
be retained.

In addition to these checks due to anomalies, it is also planned to carry outperiodic random
checks. This will provide information on the effectiveness of the system and possible
corrective measures can be applied in the event that many anomalies are detected in the
controls. In addition, when customers know that random controls are carried out, they would
be coerced by the possibility of stealing and therefore, significantly reduce thefts.

In these controls, three main aspects would be verified. First of all, that all the products
deposited in the cart are on the list. In this case it could happen that the client was trying to
steal, that the reading units have failed, or that the client has forgotten to modify the units in
his list.

Secondly , the opposite case would be verified,i.e. that there were not all the products read
by the scanner in the cart. It could happen that a customer will decide to leave a product that
they had previously scanned, but will not remember to remove it from the list.

Finally, it would be checked whether, despite the products in the basket coinciding with those
on the list, the total cumulative weight had deviated significantly from the estimated weight.
In this case the problem would be the weighing system of the cart, and it would be reviewedif
it has been a punctual event or the certain cart needs an adjustment.

A database would be created with the results and information of all the controls, in order to
carry out a statistical study. Not only to know which cars need tobe repaired, but also to
determine the type of customer who steals the most or the most conflicting time slots.

Customers who passed the control positively, would be offered a discount, offer or gift for the
inconvenience caused, and de this way To reward the inconvenience to those customers
subject to control and that the status of their purchase was correct, they could be offered
some type of discount or offer on the next purchase.
Automatic collection system for supermarkets Page. 65

6.5. Software

Mobile App

Whendeveloping an application for Smartphones, it must be taken into account that there are
several mobile platforms, the most important being Android, iOS, Windows Phone and
Blackberry, and each of them has its own methodology and development language.
Therefore, it is necessary to analyze what is the trend of the mobile phone market in terms
of operating systems, in order to opt for the one with the greatest presence.

Operating system Creator Programming language

BlackBerry OS RIM Java

iPhone OS Apple Objective C


Windows Phone Microsoft C#

Android Google Java

Table 6.5.1 – Characteristics of the main operating systems

According to the agency Kantar [15], very referenced for this type of analytics, both iOS and
Windows Phone have experienced an increase in Spain in terms of market share this last
year. In the case of iOS rising from 3.1% to 7.6% (4.5%). In the case of the Microsoft system,
the increase is somewhat more timid, staying at 1.7%, so that it is now established at 3%
share in the Spanish market.

As for Android, it is still the king in Spain accumulating 88.6% of the market. Despite this, the
increases in iOS and Windows Phone have clearly affected the popular platform and is that,
in the same period of 2013, the operating system enjoyed a higher percentage, 93.7%.

In the EU5 (France, Germany, Italy, Spain and the United Kingdom), on the other hand, the
market share ofAndroid has increased slightly compared to last year and is now at 70.7%,
mainly thanks to the increase experienced in Italy, which has been more than 8%.
Page. 66 Memory

Fig. 6.5.1 – Excerpt from Kantar data. Source: TechCrunch

Given these data, it would probably be decided to initially create the application for Android
and, depending on the acceptance of the system, the creation of this for iPhone would be
considered. For each of the two cases, the development tools aredifferent so below we will
detail how it would be done in each of the cases.

Android is a mobile platform based on Linux that was born in 2008, by the Open Handset
Alliance, led by Google. The official Android work environment is developed by Google and
has a web page that explains, in detail and with some examples, the use of the development
environment or API (Application Programming Interface) through the programming language
"Java". The recommendedthing for the development of applications using this API, called
Android SDK, is the installation of a comprehensive development platform (IDE) such as
Eclipse or NetBeans, which must be configured to work with the Android environment.

In the case of iOS, which we remember is Apple's mobile platform, it revolutionized the market
5 years ago and stands out thanks to its fluidity and design. To develop applications for
iPhone it is necessary to familiarize yourself with the Objective-C language, a
supercontogether with C, oriented to objects. Additionally, to be able to work on iOS it is
necessary to understand its development API (iOS SDK). It is also necessary to work using
the Xcode development tool, since it is the only one officially supported by Apple that is
available for iOS development.
Automatic collection system for supermarkets Page. 67

Another option would be cross-platform hybrid apps [16] based on HTML5. Hybrid
applications allow us to take advantage of a single common development in HTML5 and
export it to all platforms. Of course, the result will not be the same as that of an application
developed in native language but it will allow us to reach more platforms with less
development time.

Cart screen software

The operating system that comes by default inthe Beaglebone Black is Angstrom Linux, but
installing Ubuntu or Android is not complicated. It also supports Windows Embedded CE,
QNX or ThreadX, so the options are multiple. It also comes with the Cloud9, which is an IDE
that runs on a browser and from the browser you can access, compile and run programs.

Then, the application for the cart screen, through which the purchase process will be
controlled and which will serve as an interface with the client, will be developed with
adevelopment platform or another depending on the operating system chosen for the
Beaglebone Black. In principle the most common are Angstrom Linux and Android, although
Windows Embedded Compact 7 would also be an option to contemplate.

In Angstrom Linux, which is the default option, the application could be created through
VisualGDB [17], which is an option of Visual Studio (any version since 2005). Then the option
"Linux Project Wizard" (Fig. 6.5.2) and as the project template "A Qt-based application" (Fig.
6.5.3) would be chosen. Qt is a widely used cross-platform library for developing applications
with graphical user interfaces, as well as for the development of programs without a graphical
interface, such as command-line toolsand server consoles.

As the construction of the project on the Beaglebone Black could be very slow, a cross-
compiler (allows you to create executable code for a platform other than the one on which
the compiler runs) would be used to support Embedded Qt in Beaglebones (Fig. 6.5.4).
Page. 68 Memory

Fig. 6.5.2 – Create a project for Linux with VisualGDB

Fig. 6.5.3 – Select “A Qt-based Fig. 6.5.4 – Compiler option -cross for
application” Beaglebone
7. Design and construction of the prototype

7.1. Specifications

With the realization of this prototype has tried to give a clear vision of the purchase process
and reproduce the operation of the designed system. This will see the treatment that system
gives to the various inputs and how is the interaction of this with theend user, the client.

The objective has been to achieve a system in which the customer develops the purchase
process in the simplest and most intuitive way for him, even taking into account the strong
changes that would present with respect to the current purchase system. To this end, we
have tried to provide maximum flexibility to the system, so that the client enjoys the same
Automatic collection system for supermarkets Page. 69

freedom that he has in current systems. It has even tried to improve the current purchase
process, giving information to the customerat all times, both the status of their purchase and
possible offers that may interest them.

7.2. Scope

The prototype is not intended to be a real copy of the final system, in fact it has not been
developed with the components selected for it. Theprototype only aims to bring us closer to
the final solution once implemented and simulate its operation. With the exception of the final
part of payment, the whole system has been simulated as a whole since it has been
considered that being an innovative method of purchaseto which the customer is not
accustomed, a demonstration of its operation would be useful. In addition, this simulation has
been carried out with the intention of demonstrating that the system designed can be a real
solution and that it adapts to the specifics of theproject.

The scope of the demonstration ranges from the creation of the mobile application to scan
the products, to the final pre-payment weight checking system, which assembles the
computer purchasing software with theweighing balance of products. It will then explain how
each of the components of the prototype that simulates the final system have been designed
and developed as well as the integrated operation of all of them.

7.3. Hardware

Design

As mentioned above, for the creation of the prototype, some components different from those
of the final system have been used. What is intended to demonstrate with this first prototype
is the operation of the system and the treatment of the informationof the various peripherals
that the system performs. To this end, it was considered neither economically viable nor
necessary to purchase the elements that were going to be installed in reality, but rather
components or systems that reproduced the notificationof the final component were sought.
For those elements that have been replaced, Table 7.3.1 shows the equivalence between the
prototype elements and what they would represent in the final system.
PROTOTYPE FINAL SYSTEM
Arduino UNO Beaglebone Black
PC Cart screen
Modified bathroom scale Cart weighing system

Table 7.3.1 - Equivalences between final system components and prototype


Page. 70 Memory

Next, the components that have been used to design each of the systems that make up the
prototype will be explained in detail. But first, as we have done with the final system, we will
explain through a scheme of the prototype componentsthe general operation.

The mobile application that has been created will be used to scan the barcodes of the
products, which via Bluetooth will be sent to the Arduino. This will be powered by the USB
connection withthe laptop, in which the application created in Visual Basic for the simulation
of the cart screen will run. Finally, this same path will follow the data that will be sent from the
balance that simulates the weighing system. The signal of the balance, will be suitable with
an instrumentation amplifier to be read through an analog pin of the Arduino, which will send
through the USB connection the data to the PC. Therefore, the computer will receive the
barcodes and the balance texts, and in this way the designed purchase process can be
simulated.

Fig. 7.3.1 – Schematic of prototype components

Arduino UNO

For the prototype, an Arduino UNO has been used as a replacement for the Beaglebone
Black. This development card has been chosen since it was the most accessible in the
Automatic collection system for supermarkets Page. 71

market and of which more knowledge was had, apart from having sufficient and good
specificationsto meet the objectives of the prototype.

As its creators indicate, Arduino [18] is an open-source electronic prototyping platform based
on flexible and relatively easy-to-use hardware and software. It was created for artists,
designers, hobbyists and anyone interested in creating interactive environments or objects.

Another decisive factor was that Arduino is an open source platform. That is why there is a
large community of artists,designers and amateurs constantly creating projects with this
microcontroller. Fact that greatly facilitates learning for someone who seeks to deepen their
knowledge in the world of electronics and Arduino programming.

Next, the structure of the board chosen for the prototype, the Arduino UNO, will be explained
a little more deeply.

Fig. 7.3.2 – Arduino UNO board. Source: CortoCircuito

Its size is 74x53 mm. We program it through a USB connection that will also be used to
power it (5 V). There is the possibility of using the external power supply, which must be 9 V.
It has 14 digital I/O pins (6 of which can be used as PWMs) and 6 analog pins. In addition, it
gives the opportunity to power the circuits with two different voltages, 5 V or 3.3 V.
Page. 72 Memory

Each part will be explained in more detail below. The most important is the ATmega328
microprocessor, which has a flash memory of 32 KB (512 bytes are usedby the bootloader),
RAM of 2 KB and 1 KB of EEPROM memory. The operating voltage, as already said, is 5 V
and the working frequency of the clock is 16 MHz.

It has a reset button (red button) that provides a LOW value that restarts the microcontroller.
Next to it, there is the ICSP (In Circuit Serial Programming) connector, which is the system
used in PIC devices to program them without the need to remove the chip from the circuit of
which it was part.

Respecto a los pines:

Pins 3, 5, 6, 9, 10 and 11 are pins with 8-bit PWM (pulse width modulation) output. These
pins allow us to obtain information from the outside and that the board acts according to this
information (sensors, motors,servos,..).

Pins 0 (Rx) and 1 (Tx) are responsible for sending and receiving TTL serial data.

The function of pins 2 and 3 is to handle interrupts (Arduino UNO is only capable of handling
two interrupts therefore).

We found thatpins 10, 11, 12 and 13 support SPI communication with the SPI library. The
SPI (Serial Peripheral Interface) bus is a communications standard, used primarily for the
transfer of information between circuits embeddedin electronic equipment. It is a standard for
the control of any digital electronic device that accepts a clock-regulated serial bitstream.

There are 3 ground pins marked GND (0 V). The power supply to the circuit can be 5 V or
3.3 V in its respective pin. We can apply an input voltage to the board using the Vin pin when
it is powered by an external source and know the exact value of the voltage applied to the
board.

Regarding analog inputs, Arduino UNO has 6 distributed in pins A0, A1, A2, A3, A4 and A5.
Each provides a resolution of 10 bits (1024 values). By default it is measured on these ground
pins at 5 V, although we can change the upper bound of this range using the AREF pin,
which is responsible for the reference voltage for analog inputs.

The USB port allows us to communicate with the computer using the standard USB COM
controllers, without the need for an external driver. The board warns us with a flicker of the
Rx and Tx LEDs that communication is taking place.
Automatic collection system for supermarkets Page. 73

The 2.1 mm female plug connector can be used to power the board externally, thus avoiding
the use of USB (if the sketch is already loaded on the board, we do not need the computer
for the board to work, just power it).

Table 7.3.2 summarizes the main features of the Arduino UNO.


Microcontroller ATmega328
Operating voltage 5V
Input voltage (recommended) 7-12 V
Input voltage (limit) 6-20 V
Digital I/O Pins 14 (of which 6 can generate PWM)
Analog input pins 6
I/O pin current 40 mA
Current for 3.3V pin 50 mA
Flash memory 32 KB (0.5 KB used for bootloader)
BLEMISH 2 KB
EEPROM 1 KB
Clock speed 16 MHz

Table 7.3.2 – Main characteristics of the Arduino UNO

Bluetooth module

The function of the Bluetooth module will be to communicate with the Smartphone. The
Bluetooth HC-05 module will be used since it is a relatively inexpensive device (€ 7.3) and
that it has a format that allows it to be easily inserted into a protoboard. In addition, it is
mounted on a board that adapts the voltage levels to the Arduino, so it can be connected
directly to it. (Fig. 7.3.3)

Fig. 7.3.3 – Bluetooth module HC-05. Source: BotScience


Page. 74 Memory

This HC-05 model can work in both master and slave mode, which means that in addition to
receiving connections from a PC or a Smartphone, it is also capable of generating
connections to other Bluetooth devices.

The HC-05 has two operating modes: configuration mode and communication mode. The
configuration mode must be activated by a high state on the "Key" pin (pin 34). Once activated
we can send AT commands to change or view the configuration settings of the module, that
is, the device name, the pairing password or the master/slave mode. In communication mode
it works transparently, that is, all the information that is sent to the HC-0 5 is transmitted by
Bluetooth and all the information that is received is sent to the Arduino.

The module has the connection pins TXD, RXD, VCC, GND, KEY and STATE, which later
we will see what they are for and how they are connected.

Balance

To simulate the weighing system of products in the cart basket, the simulation has been
carried out with a bathroom scale that has been modified to obtain more resolution.

First of all we tried to use a scale that the director of the work haddamaged in his house, since
we were only interested in load cells and the problem was perhaps electronic. But after
disassembling it, it was found that there were two cells that did not work.

So we bought a low quality bathroom scale, to get an idea it cost less than 10 €. The capacity
of the scale ranged from 5 to 150 kg, with an accuracy of 100 g. As can be guessed from Fig.
7.3.4 it has four load cells, one in each
corner.

Fig. 7.3.4 – Sinbo SBS-4414 bathroom scale. Source: Sinbo


Automatic collection system for supermarkets Page. 75

Finally, the load cells of the purchased scale were used and the glass platform of the scale
provided by the project manager was used.

Load cell signal matching circuit

As explained in section 0 "Description of the components" of the final system, the output of
the load cells is usually very small, so it usually needs a signal matching circuit. This usually
includes an amplifier and a filter, in order to increase the level of resolution of the
measurement and the signal-to-noise ratio. In addition, the amplification will allow to take the
measurements of the analog signal through the analog pins of the Arduino and perform
analog-digital conversion with the same Arduino.
In the implementation section, the implemented circuit will be explained in more detail.

Implementation

This section will explain how theimplementation of the hardware elements explained in the
previous section has been carried out, as well as their interconnection. The first step has
been to provide the Arduino UNO with Bluetooth, by coupling the HC-05 module. On the other
hand, it has been implemented

Arduino UNO Connection - Bluetooth Module

The HC-05 Bluetooth module was purchased already mounted on a voltage matching board
so that it can be connected directly to the Arduino. On the board are screen-printed the
connection pins TXD, RXD, VCC, GND, KEY and STATE.

It has started by connecting the GND pin of theHC-05 to the GND pin of the Arduino, and the
VCC power pin with the 5V pin of the Arduino. In this way we can turn the module on and off
from the program.

To download the programming code to the microcontroller we will do itby directly connecting
a USB cable, between the PC and the Arduino, which creates a serial communication. This
fact has conditioned the connections between the Bluetooth module and the Arduino, and
that is why the RX and TX serial ports of the microcontroller have not been usedto exchange
data with the HC-05. If we did so, in case at the time of downloading the code from the PC
to the Arduino, Bluetooth was also sending serial data, the code would not be downloaded
correctly. That is why a library has been used that allows you to use any pin of the Arduino
as a serial port, so that pins 10 and 11 have been enabled.
Page. 76 Memory

The TXD and RXD pins of the module have been connected to pins 10 and 11 of the Arduino.
In this way, the serial ports available to Arduino (TX and RX pins) will be left free for the
debugging of the program.

It only remains to connect the pin marked as KEY to pin 4 of the Arduino, which must be in a
state of high voltage when the module is turned on or reset and also allows to change the
operating mode of the module.

Fig. 7.3.5 – Diagram of connections between the Arduino and the Bluetooth module HC-05

Balance

It began by eliminating all the digital electronics from the scale that had been purchased and
leaving only the analog part: four weight sensors (load cells) with three output cables each.
Four wires were expected in each load cell, i.e. the cell had the typical Wheatstone bridge-
like configuration (Fig. 7.3.9), but after a little search it was discovered that they were "half-
bridge" load cells (Fig. 7.3.11), that is, they only had two of the bridge gauges. To understand
everything better, we will briefly explain how load cells work.

A load cell is a transducer that is used to convert a force into an electrical signal. They use
an array of gauges to measure the deformation of a component of a structure and convert it
into an electrical signal.
Automatic collection system for supermarkets Page. 77

Strain gauges measure deformation, or stress, to


determine the applied force or load. Extension is
defined as the change in length (∆L), divided by length
L, and varies directly proportionally.

to the applied load (Fig. 7.3.6).


Fig. 7.3.6 –
Voltage
definition

The metal strain gauge consists of a very thin wire,


most commonly, a metal sheet organized in a grid
pattern. This maximizes the amount ofmetal cab le, or
blade, subject to tension in the parallel direction (Fig.
7.3.7). The grid is attached to a thin backrest, called
a carrier, which attaches directly to the metal structure
of the cell itself. Therefore, the tension experienced
Fig. 7.3.7 - Strain gauge by the component is
transferred directly to the strain gauge, which
responds by
a linear change in electrical resistance. Strain gauges are commercially available withnon-
minal resistance values from 30 to 3000 Ω, with 120, 350 and 1000 being Ω the most frequent
values.

In practice, voltage measurements rarely involve amounts greater than a few millivolts.
Therefore, stress measurement requiresexattitude in the detection of very small changes in
resistance. To measure such changes in resistance, strain gauges are almost always
employed in bridge configurations with a voltage excitation source. The Whea tstone General
Bridge, illustrated in Fig.

7.3.8, consists of four resistors with an excitation voltage (VEX) that is applied at two bridge
terminals.
Page. 78 Memory

Fig. 7.3.8 – Wheatstone bridge configuration

The output voltage of the bridge, VO, is equal to:

(Ec. 7.3.1)

From this equation, it can be seen that when R1/R2 = R4/R3, the output voltage, V0, is zero.
Under these conditions, the bridge is said to be tilted. To improve the sensitivity of the circuit,
what is done is that the four resistors of the bridge are active strain gauges, thus leaving the
configuration of Fig. 7.3.9. Any change in the resistance of either arm of thebridge will result
in a non-zero output voltage.

Fig. 7.3.9 - Structure of a full-bridge load cell


When an excitation voltage is applied and the previous value, and the differential
bridge is balanced, the voltage at the terminals voltage at the output Vs=(S+-S-)
S+ and S- is equal to 1/2 Vexc. But cells are ceases to be zero. This potential
designed so that when they are acted upon, the difference is what is telling us the
opposing resistances change at the ±∆R bridge. amount of force or pressure acting
Then the voltage in S+ and S- varies from the on the sensor.
Automatic collection system for supermarkets Page. 79

Fig. 7.3.10 – Wheatstone bridge when applying


a force

In the case of the cells of the bathroom scale that had been disassembled, the load cells
were half bridge, that is, they only had two strain gauges formed what would be one side
of the complete bridge.

Fig. 7.3.11 -Half-bridge load cell Fig. 7.3.12 – Load cells

Not having the technical sheet of the gauges, to identify which cable was the output and
which were the power supply, the resistance between each pair of cables was measured,
obtaining the following results:

R blue-red =2000 Ω R blue-white =1000 Ω R red-white =1000 Ω

Therefore, it was undoubtedly a "half brigde", schematized in Fig. 7.3.11

The next problem was how to connect the four sensors so that they worked properly
together. In the end it was decided to create two complete Wheatstone bridges, connecting
the four cells in pairs, and later, connecting the two complete bridges in parallel to obtain at
the output the joint reading of the two [19]. The swim connectioncorresponds exactly to the
scheme in Fig. 7.3.13. As you can see the output and excitation lines of the two
Page. 80 Memory

bridges are connected in parallel. The load cells have been identified as A, B, C and D and
the two excitation termi nal as Vex+ and Vex- have been marked, as well as the Vs+ and
Vs- outputs.

Fig. 7.3.13- Connection of load cells

This diagram taken to the scale actually corresponds to that of Fig. 7.3.14.

Fig. 7.3.14 - Diagram of the connection on the balance


With an amplifier from the laboratory, the readings of the load cells were observed and it
was verified that the fourcells were well connected and that all four contributed to the final
reading of the scale. It also helped us to get an idea of the order of the output voltage of the
load cells and the amplification that we would have to have to do in order to make the
readings with the Arduino.
Automatic collection system for supermarkets Page. 81

The next step was to design the signal conditioning circuit. In a first attempt, a differential
amplifier was built with a simple operational amplifier, since it was the onlyelectronic circle
with this utility that was known from the subject of Electronics.

Fig. 7.3.15 – Single differential amplifier

The problem with this circuit is that the input impedance is relatively small and to calculate
the gain the source impedance must be taken into account.

A little research found that there were instrumentation amplifiers, whichwere devices
created from operational amplifiers. Instrumentation amplifiers are differential amplifiers
that have been specifically designed to obtain good characteristics in measurement
applications, such as very low offset voltage, low drift, low noise, very high open loop gain,
high input impedance and high common mode rejection (CMRR). 1 In addition, you can find
encapsulated, which simplifiedthe circuit a lot. In the end, what it does is the subtraction of
its two entries multiplied by a factor.

The following figure shows the structure of an instrumentation amplifier.

1
It's a performance specification that's basically a measure of how well an operational amplifier is. It
can ignore the voltages that are common to both of its direct current inputs, and therefore describes
how cleanly it amplifies the signals that appear as voltage differences in its inputs. The CMRR,
then, is the difference gaindivided by profit in common mode. Differential gain is the voltage at the
output of the operational amplifiers, divided by the difference in voltage measured at the two inputs.
Common-mode gain is measured by reference to both inputs into a single voltage, and dividing the
output voltage measured by the input voltage.
Page. 82 Memory

Fig. 7.3.16 – Schematic of an instrumentation amplifier

In case the resistors are not equal, the total gain of the instrumentation amplifier will be:

(Eq. 7.3.2)
In integrated circuits, everything is usually encapsulated except the
resistanceRg in order to control the gain. The grounding can also be replaced
by another at a given voltage.

In the end for simplicity and functionality it was decided to use an integrated instrumentation
amplifier, since it offers us a great precission and stability of the circuit in the short and long
term. Among the various models, the INA125p was chosen, which is an instrumentation
amplifier widely used for the amplification of Wheatstone bridges. Table 7.3.3 shows itsmain
specifications.
Automatic collection system for supermarkets Page. 83

Low quiescent 460 µA


current

Precise 1.24V, 2.5V, 5V y 10V


reference voltages

Low offset voltage 250μV max

Low offset deviation 2μV/ºC max

Low input bias 20nA max


current

Alto CMR 100 dB min


Low noise 38nV/Hz1/2 a f=1kHz
Ingress protection ±40V

Wide power range Única: 2.7V and 36V


Doble: ± 1.35V and
±18V

Table 7.3.3 – Specifications INA125p Fig. 7.3.17 – INA125p schematic


Fuente: Texas Instruments

The following will explain how the load cells were connected to the INA125p.

The output voltage of the cells is directly proportional to the excitation voltage. Therefore,
the circuit must either maintain the constant supply voltageat the same precision as the
desired measurement, or compensate for changes in supply voltage. The simplest way to
compensate for changes in excitation voltage is to derive the reference voltage of the
instrumentation amplifier from the excitation of the bridge. Another option that was
considered was to use the reference voltages offered by the INA125p, but after reading the
specification sheet it was discovered that the supply voltage of the chiphad to be 1.25V
above the desired reference voltage. This is because the amplifier uses 1.25V to generate
the reference voltages. Since the supply voltage of our circuit is 5V, we could only have
used the reference volts of 2.5V or 1.24V to excite the cells. It was considered that this
voltage was too low and that the subsequent amplification should be too large. Even so, in
the specification sheet it is recommended to connect the V REF OUT pin toone of the
reference voltage pins to avoid saturating the reference amplifier (Ref Amp).
Page. 84 Memory

On the other hand, IAREF has been jointly grounded, which is the reference with respect to
which the output of the instrumentation amplifier is given, V REFCOM, ditto that of the
previous one but for the reference voltage pins, and V-. The negative excitation terminal of
the cells has also been connected to them.

Finally, the SLEEP pin has been connected to V+ since it will not be used in any case. Pins6
and 7 are the inputs of the instrumentation amplifier to which the output terminals of the
load cells will be connected. Finally, pins 10 and 11, corresponding to the output and the
SENSE pin respectively, have been connected. The output will be connected directly to the
A0 analog input of the Arduino.

Fig. 7.3.18 – Connection of load cells and instrumentation amplifier


Now it only remains to fix the gain of the INA125p, which can be regulated with the external
resistance RG contacted between pins 8 and 9 according to the expression:

(Ec. 7.3.3)

In this way, we can make the maximum permissible weight in the balance, correspond to
the maximum voltage allowed in the Arduino analog inputs. Finally, in order not to have to
excessively amplify the signal, the reference voltageof the Arduino inputs has been lowered
from 5V to 1.1V using the AREF command. Thus, it has been

fixed the resistance RG to a value of 56Ω, which through the


(Eq. 7.3.3) corresponds to a gain of 111.14. In this way the balance of the
prototype has a weight range from 0 to approximately 20 kg.
Automatic collection system for supermarkets Page. 85

Assembly

Initially, to test and design the circuits of the Bluetooth module, the load cells and the signal
matching circuit was done on a protoboard. But once the final design was made, it was
decided to buy a plate of moles and weld everything on it. In this way it was possible to
reduce the noise caused by poor connections and the design was much more compact and
reliable.

Fig. 7.3.19 – Final state of the weighing system

7.4. Software

In order to carry out the necessary operations to achieve a correct functioning of the
system, it is not enough with the hardware elements, but the programming of a software is
also necessary. This is responsible for managing and controlling the various physical
elements so that they function according to the design specifications.

The software programmed in this project runs on three platforms. In the place section we
will try to explain the reasons why each of them has been chosen and, later, the code that
has been generated will be explained
Page. 86 Memory

Design

Android - AppInventor

To make the mobile application for scanning the products it was


decided to use theAndroid operating system, among other
options available as iOS, Symbian or Windows Phone for
several reasons.

In the first place, because despite being a relatively new


operating system it has managed to gain an important position
in the mobile phone market. It is currently one of Fig. 7.4.1 – Icon of the most used
platforms in many countries and is the one that Android is undergoing the greatest
expansion in recent years.

Secondly, there are many very broad development tools for programming on Android and
the learning curve is not very high. In addition, it has a community of developers who
continuously create applications and share their knowledge in Forums,a fact that greatly
facilitates learning.

Finally, the fact that an Android phone was available made the development more practical,
since it did not have to use any simulator but was tested directly on the mobile.

The official Android work environment is developed by Google and has a website that
explains, in detail and with some examples, the use of the API ( Application Programming
Interface) through the programming language"Java". The recommended thing for the
development of applications using this API is the installation of an integral development
platform (IDE) such as Eclipse or NetBeans, which must be configured to work with the
Android environment.

However,although this is the most stable, complete and recommended option, there are
multiple options on the network that allow developers to program applications using other
methods and programming languages other than Java. These alternatives, known as
frameworks, seek to facilitate application programming and offer an alternative option to
development using native libraries.

One of them is AppInventor [20], which uses Android's native API, although it uses it by
joining visual blocks. It is a free visual web development environment, which allows you to
Automatic collection system for supermarkets Page. 87

build applications that do not require extensive use of Android libraries, since it is done by
using blocks in the style of puzzle pieces. This way, there is no need to write lines of
programming code. It was announced by Google in 2010 and is based on the Java Open
Blocks library, distributed by the Massachusetts Institute of Technology (MIT ) under its
free license (MIT License).

Fig. 7.4.2 . Android AppInventor icon

Visually and from a set of basic tools, the user can link a series of blocks to create the
application. AppInventor applications are limited insimplicity, but allow a large number of
basic needs to be covered on a mobile device.

During the development process, applications built with AppInventor are not stored on the
computer's hard drive but are located on the network, so they can be accessed from any
computer with internet access and that has the Google SDK installed. Once the
development process is complete, the framework allows you to compile the application and
create an executable file." Apk" that can be installed on an Android device.

Programming is done through the use of two interfaces, on the one hand the AppInventor
Designer (Fig. 7.4.3) and on the other, the AppInventor Blocks Editor (Fig. 7.4.4).

You start designing the application in the first one. It includes all the elements and
components that will be used in the application, both visible and non-visible. The first are
those that allow you to create the graphical interface of the application, that is, the buttons,
images or fields, for example. The non-visible ones are those that allow access to phone
tools or control events (Bluetooth, sensors, barcode scanner, camera). It consists of four
basic parts, which have been differentiated into colores in Fig. 7.4.3: Palette, which contains
the elements and tools supported by the framework; Viewer, which is the window that
simulates the mobile screen; Components, which is a list of items entered in the Viewer;
and finally, Properties, which allows you to modify the properties of the selected element.
Page. 88 Memory

Fig. 7.4.3 - "AppInventor Designer" interface (marked in colors the different sections)

The "Blocks Editor" is made up of blocks linked to each other and is what the application
code would represent. These elements work similarly to the pieces of a puzzle, where two
blocks can only be joined together if the output of one fits with the input of the other. The
blocks represent the components that were defined in the "App Inventor Designer" and
the functions that can be performed with them. In addition to the components, there are
multiple parts that allow the development of the application logic, such as comparators or
constraints.

Fig. 7.4.4 - AppInventor Blocks Editor interface


Automatic collection system for supermarkets Page. 89

Arduino

In section 7.3 of hardware has already explained what Arduino is and the reason for its use.
But it has not been seen how a program is actually implemented. The working mode is
usually as follows: connect the Arduino to the PC using a serial cable, open the IDE
(arounddevelopment), load the desired program and download it to the micro. If an
alternative power supply to USB is available, the cable can be disconnected and the
Arduino can perform the functions specified in the loaded program.

The Arduino IDE (Fig. 7.4.5) is quite simple and intuitive and it is not the objective of this
document to explain its full operation but we will give a couple of brushstrokes.

There is an icon of special interest, at the top right called "Serial Monitor" that opens a new
window. All the data that arrive by serial communication from the micro, will be displayed in
this window. That is, if a sensor is connected to the microphone and it sends its readings
through the serial port to the PC, you cansee this data in the serial monitor window. In this
particular case, the data received via Bluetooth from the mobile application will be received,
as well as the readings of the balance.

The microcontroller on the Arduino board is programmed using the Arduino programming
language (based on Wiring) and the Arduino development environment (based on
Processing). In addition, the language can be extended through C++ libraries. The source
code of the programs is divided into three main distinct blocks:

• Declaration of variables: the declaration of all the variables that are going to be used
throughout the program is carried out and the loading of the necessary libraries is
also carried out.
• Block setup: The code written in this block is executed only once, when the program
is started for the first time like the previous block. It defines the physical pins of the
card as input or output, as well as the parameters of the connections (in our cas
orBluetooth).
• Loop block: This block as its name suggests is a loop so that every time it reaches
the end, it will execute the loop again from the first instruction continuously.
Page. 90 Memory

Fig. 7.4.5 - IDE Arduino y Serial Monitor


Visuat Studio 2013

To carry out the shopping cart software, the Visual Studio Ultimate 2013 program has been
used [21]. Before carrying out the project there was no knowledge of this program, and it
was on the recommendation of the project manager andused.

Microsoft Visual Studio is an integrated development environment (IDE) for Windows


operating systems. It supports multiple programming languages such as Visual Basic.NET,
C#, C++, Java, Python among others. Visual Studio can be usedto build applications that
target Windows (using Windows Forms), Web (using ASP.NET and Web Services), and
portable devices (using the .NET Compact Framework). In short, it is one of the best and
complete IDEs available in Windows.

In addition, it allowed us to interact with the information of a database created in Microsoft


Office Access, which simulates the database of a supermarket with the information of all its
products, together with the readings of the scale andthe products scanned with the mobile
application. All this was possible using "Windows Forms" from the Visual Studio program.

Implementation

Balance reading

Because the behavior of the balance when placing weights on it seemed that it was not
entirelylinear, as can be seen in Fig. 7.4.6, it was tested experimentally. To do
Automatic collection system for supermarkets Page. 91

so, various weights were placed at intervals of 500 g and the reading was noted for each.
This work was repeated 5 times to obtain better results.

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000
Weight [g]

Fig. 7.4.6 - Nonlinear behavior of the balance

Once the data was collected, the readings obtained with the
Arduino depending on the weight placed on the scale. As can be seen in Fig. 7.4.6 there is
a marked nonlinearity for values less than 4 kg. Another problem that was observed was
that every time the system was reassembled, the offset changed. As can be seen in Fig.
7.4.7, the measurements from one reading to another are out of phase approximately the
same value for each series of the graph.
Page. 92 Memory

140
135
130
125
120 1
115
110 2
105
100 3
95
90 4
85
80 5
0 50 100 200 300 400 500 700 1000 1500 2000
Weight

Fig. 7.4.7 - Chart of readings for different weights


Then, two solutions were proposed. On the one hand, try to adjust mathematical models,
one for weights less than 1 kg, another for weights between 1 and 6 kg and another for
higher weights, using regression models. The other solution wasto enter reference values
for different weights in the Arduino code, making the intervals relatively small. Then, each
time a measurement was made, it would be checked within which range it is and
interpolated between the tworeference values to obtain the weight. We tried to implement
the two solutions, but finally the second was chosen as we reached greater precision.

The problem was that every time the assembly of the entire system was carried out,
theffset changed. Then, the reference values entered in the code were no longer valid and
the precision in the measurements was very low.

As can be seen in Fig. 7.4.7, in different readings approximately parallel curves were
obtained, that is, the measurements were the same but displaced by a certain distance
(the difference between the reference offset and the new "offset"). Then it was concluded
that the behavior of the balance was always the same, but the "off set" had to be
adjustedwith respect to the reference. So it was decided to introduce a balance calibration
function (Fig. 7.4.8), which would be executed at the beginning of the purchase process.
Automatic collection system for supermarkets Page. 93

With this function, a series of measurements are


made with the balance without weight and the
average is calculated, which is the new offset
(zero variable of the code). Then, the difference
between the reference offset (analogval1A
variable) and the newnewly calculated offset value
is calculated.

With this function we calculate the value of the variable x, which will be added to all the
readings before making

Fig. 7.4.8 – Function calibrating interpolation and obtaining weight. In this way, we adapted
the reading to thereference values that we had
entered in the code.
Page. 94 Memory

For better accuracy we divided the data into 11 groups.


As it had been observed that the behavior was linear
from five 5 kg, 10 intervals were created for the smallest
weights and one for weights greater than 5 kg. As you
can see, for each weight in grams (loadX) the PI reading
is fixedn
Arduino analog (analogvalX).

Fig. 7.4.9 – Reference values


for interpolation

Once the reference values and the


calibration function have been set, all that
remains is to explain the weighing function.
To obtain more stable measurements, as in
the calibration function, a series of readings
are taken and the average is made. To the
mean is added the variable x, calculated in
the function of

the calibration and thus the reading is obtained


Fig. 7.4.10 – Code of the weigh function
(weight variable). Then it is checked within which range the reading is by comparing it with
the different reference values.

Next, to calculate the weight in grams, the analogToLoad function is used, which in turn
uses the mapfloat function. These functions simply serve to perform interpolation by taking
as reference the weights and their corresponding readings assigned as reference.

Fig. 7.4.11 – Functions for interpolating and calculatingr the weight in grams of the
reading
Automatic collection system for supermarkets Page. 95

Android App

As mentioned, the Android application has been made with the AppInventor framework.
The operation of the application and how it has been created will be explained below
without going into specific detailsof the programming, which has already been included in
Annex C.

As explained in the final system section, the purpose of the application is to scan the
products and send the code to the microcontroller of the cart, so that the product appears
on the screen.

Because there was nocommercial intent with the creation of the application, it has not been
uploaded to Google Play, where Android users can download the applications. The
executable file has simply been created." apk" and this has been installed on a device with
Android.

The main screen of the application is the first one that appears in Fig. 7.4.13. It shows the
name that has been given to the application and tries to reflect the idea of the system that
has been created. If the customer decides to start the purchase and does not have
Bluetooth activated, a notification jumps reminding him and until the user activates it, he
can not proceed. Next, the customer gets a list with active Bluetooth devices, which in a
real case would be all the carts in thesupermarket. Then the customer would choose the
cart he had taken (they would be numbered and the number would appear in the list).
Page. 96 Memory

Fig. 7.4.13 - Main screen of the application Fig. 7.4.12 – Devices/ Trolleys
Once you have selected the cart to connect to, if the connection is successful, the scan
screen appears. It highlights the "Scan product" button, which is the one that the customer
has to press if he wants to read a code of a product. If you tap it, the Barcode Scanner app
screen appears . This is an application that serves to scan barcodes and that opens when
you press the scan button. In this case you should also have this application installed,
which is free and can be easily downloaded from Google Play in a minute. If this application
were eventually created for a real application, the barcode reader would probably probably
be included in the same application.
Automatic collection system for supermarkets Page. 97

Fig. 7.4.16 – Fig. 7.4.14 Screen – Barcode Scanner Fig. 7.4.15 – Write scan code

Once the barcode is read, the application sends the product code via Bluetooth directly to
the Arduino, which must be programmed to receive it.

Additionally, a field has been entered to enter the code manually in case the scanner does
not work. The user just has to type it and press the submit button.

Android Communication – Arduino

The communication between Android and Arduino, as already mentioned, is done via
Bluetooth. The Arduino by itself does not have Bluetooth, but as already explained, the HC-
05 module has been used to make it so.
Page. 98 Memory

In the first part of declaration of variables and


libraries, the SoftwareSerial library has been used.
This allows us to set pins 10 and 11 of the Arduino
as a serial port and thus perform serial
communication with the Bluetooth module.

As mentioned in the hardware section, where it has


been explained how the Bluetooth module was
connected, the pin Key must be in high state to turn
on and reset the module. Therefore, in the setup
block of the code, the pin4 of the Arduino is set to
high state.
In addition,the speed of the
port of the Bluetooth module and opens Fig. 7.4.17 – Bluetooth communication serial
communication with the PC and sets its speed.

In the loop block, which is repeated cyclically, it is filtered that in the Serial Monitor the
barcode is usually written, since the HC-05 module sent feedback of the type "OK" or
"Disconnected", which did not interest in the face of communication with the application of
the cart screen. The full code is included in Annex C.

Cart softwarewith Visual Basic

The programming code for the program in Visual Studio is very extensive and has been
included in Annex C. Below we will describe the interface and how to interact with it,
although only the main details will be explained,since in Annex D a simulation of the
purchase process has been carried out with the prototype in which all the details and
possible options are included.
Automatic collection system for supermarkets Page. 99

Fig. 7.4.18 – Main screen of the program

On the main screen you can see the buttons that allow you to access the various
functionalities that the software will offer. Below we will describe each of them in more
detail.

Your list

In this screen the user will be able to see the listof his purchase, with information of each
of the products as well as the total amount. As you scan the products, they will be
automatically added to the list and, in addition, the last one you have scanned will appear
in the image on the right.

On the right side you can see a photo, product information and its price. The user can also
modify the units of the selected product from there, entering the number and clicking on
OK. Apart from modifying the units, youcan also remove a product from your list, if you
finally do not want to buy it.

Finally, at the bottom, the user will see if the weight of their cart matches the weight of the
items that appear in their list. In this way the user will know if hehas problems in his cart or
everything goes in order, which will be a fact of vital importance since we remember that
Page. 100 Memory

the customer will not be able to make the payment, and therefore leave, if the weight is not
correct. In the lower right corner you have enabledor a button to return to the main menu.

Fig. 7.4.19 – Your List Menu

Seeker

This screen consists of a product finder and has three different functions. On the one hand,
it allows users to search if there is a product in the establishment orcertain or not. On the
other hand, it allows you to check the price of a certain product without having to look for it
in the establishment. Finally, it allows users who try to scan a product and the scanner
does not work for them, to enter them throughthis screen in their list.

The operation is very simple, the user must write at the top the product he wants. Being
the touch screen, a keyboard integrated into the screen has been created that allows users
to type without theneed for an external keyboard. In addition, the program has been
implemented so that an active search for matches is carried out as it is written. The user,
simply by clicking on a product in the list of matches, will see the product on the right side
of the screen. If desired, the user can enter the number of units he wants and add them to
his list. These will automatically be added to the menu list explained above.
Automatic collection system for supermarkets Page. 101

Fig. 7.4.20 – Search Menu

Offers

On this screen the user will be able to see the offers available in the establishment. In this
way the information is provided to the user efficiently and, probably, consulting the menu
the client realizes offers that he madeor the purchase with the current system would not
see. The objective is to increase the sales of the products of offer thanks to this menu.

The operation is very simple, with the arrows passing the images in which the offers appear.
Finally, at thebottom right is the button to return to the main menu.

Fig. 7.4.21 – Offers menu


Page. 102 Memory

Pay

This screen is the last of the main menu options. It will be accessed when the customer
wishes to complete the purchase, and as can beseen in Fig. 7.4.22 will be given the option
to review the list of scanned products before proceeding with the payment. Next, the
customer must go to the collection post, where he will be indicated a code that the client
must enter on his screen. If the code is correct, the checkweighing will automatically
proceed.

Fig. 7.4.22 – Pay menu

Fig. 7.4.23 – Weight check


Automatic collection system for supermarkets Page. 103

8. Economic study

This chapter covers all the economic aspects related to this project, including a budget on
the cost of carrying out this project and an economic estimate of the price of a possible
implementation of the system on a real surface.

8.1. Project budget

In the budget of this project we can differentiate two items: the cost of the work done and
the cost of the prototype.

To calculate the engineer's fees, the hours of learning and searching for information have
not been taken into account, since it is assumed that the engineer must already be
prepared when facing a project of this type. Then, only the hours of system design and
choice of components and the hours of software design and prototype implementation have
been taken into account.
COST HOURS OF WORK

Concept Hours Price/Hour Import (€)


Design of the collection system 60 50 3000
Choice of components 40 35 1400
Software Design 60 30 1800
Prototype implementation 40 25 1000
TOTAL 7200

Table 8.1.1 – Engineer's fees

Below is the budget of the components that have been purchased to make the prototype.
Only those components or materials that have had to be purchased are included, since the
measuring tools and instrumentswere either borrowed.

PROTOTYPE BUDGET

Unit price
Component Model Units Import (€)
(€/out)
Balance Sinbo SBS-4414 1 12 12
Page. 104 Memory

Microcontroller Arduino UNO 1 24 24


Bluetooth adapter HC-05 1 14,66 14,66
Amplific. instrumentation INA125p 1 8,09 8,09
Breadboard 1 9,8 9,8
Prototyping board 1 2,84 2,84
TOTAL 71,39

Table 8.1.2 – Prototype component budget

Once the items corresponding to this project budget have been added, it has been
calculated for a value of € 7271.39.

8.2. Economic estimation of the final system

From the components that have been selected for the automatic collection system in the
detail design section, an economic estimate of the price of the electronic part of it will be
made. Later the economic estimate of the mechanical design made by my project partner,
Carlos Darder, will be added, and in this way you will have a general idea of an approximate
price of what the project would cost as a whole. The electronic part has been separated
into two: on the one hand, the components integrated in the cart and on the other, those of
the collection station.
SHOPPING CART ELECTRONICS

Unit price
Component Model Units Import (€)
(€/out)
Amplif. Instrumentation INA125p 1 4,77 4,77
A/D Converter ADS1231 1 4,41 4,41
Microcomputer Beaglebone Black 1 45 45
Touch screen BB View Cape - LCD 7'' 1 91,83 91,83
Bluetooth adapter IOGEAR Bluetooth 4.0 1 14,73 14,73
Battery UL Li-Ion 3,7V 10Ah 2 21,45 42,9
Voltage adapter REF02 1 2,62 2,62
TOTAL 206,26

Table 8.2.1- Economic estimation of shopping cart electronics


According to the estimates made by my partner, the cost of the materials necessary to
make the structure of the cart itself, is € 243.92. Therefore, the cost of a cart as a whole
would be about € 450.18.
COLLECTION STATION
Automatic collection system for supermarkets Page. 105

Unit price
Component Model Units Import (€)
(€/out)
Credit card reader Hitachi-Omron V2BF 1 200 200
Power supply CP SNT 55W 12V DC 1 100 100
Thermal ticket printer Epson TM-T20 1 139 139
Touch screen MaxPos DOE-1598 1 171,6 171,6
Automatic doors PNG 390 2 1000 2000
POS computer 1 600 600
TOTAL 3210,6

Table 8.2.2 – Economic estimation of the collection post

It should be noted that the prices of the components have been obtained through the
websites of the respective manufacturers or directly by consulting with a supplier.
Therefore, we assume that in reality some discount would be made if the system were
actually going to be implemented and the purchase of components was not unitary. On the
other hand, the project could perhaps become more expensive if at the time of assembling
everything some problems arose that had not been taken into account.

In short, we can say that the economic estimates that have been made of both the price of
the cart, as of the collection post are approximate. Considering the two cases mentioned
above, there could be variations of ±20% of theestimated price.
Page. 106 Memory

9. Planning
The project has been carried out in different consecutive stages but, due to the nature of
the project, some have been carried out in parallel. This is due on the one hand to the two
main parts in which it is divided: on the one hand, the design of the real system and, on the
other, the implementation of a first prototype. In addition, in the latter there is a clear
distinction between hardware tasks (assembly of the prototype) and logical tasks such as
programming.

As we can see in the Gantt chart (Fig. 8.2.1), the planning that has been followed can be
divided into five large blocks.

It began with a first phase of initiation and introduction, in which information was sought on
current collection systems and new technologies were believed to have an application in
the system. In addition, several visits were made to establishments with innovative
collection systems implemented. In this way we were able to talk to various employees,
who explained to us how their systems worked, what problemsthey faced their system and
what aspects they thought could be improved.

Once this first phase of information absorption and brainstorming was completed, the
design of various alternatives began. After evaluating each of them, we chose how the final
system and the scope of the project would be.

Because of its attractiveness and the desire to start seeing results, work began on the
prototype. First creating the mobile application, then with the scale and finally with the cart
software withVisual Studio. Subsequently, the three subsystems created for their joint
operation were assembled.

In parallel with some activities of the prototype, the components of the final system began
to be chosen, being of great helpthe experience acquired with the creation of the prototype.

Finally, the writing of this report was finished, in which all the work done is reflected.
Automatic collection system for supermarkets Page. 107

Concept Start date End


date

1 Planning the PFG 6-feb 10-feb


2 Search for product coding systems 6-feb 20-feb
3 State-of-the-art search 6-feb 20-feb
4 Brainstorming of possible solutions 10-feb 17-feb
5 Contact and visit to some establishments 10-feb 14-feb
6 System specifications 17-feb 20-feb
7 Conceptual design of alternatives 20-feb 1-mar
8 Decision of the chosen alternative 1-mar 3-mar
9 Creating the mobile app 3-mar 20-mar
10 Implementation of the prototype balance 3-mar 20-Apr
11 Prototype Software with Visual Studio 20-mar 17-Apr
12 Detail design of the actual system 7-Apr 1-may
13 Assembly of prototype systems 17-Apr 8-may
14 Drafting of the report 8-may 26-Jun

Fig. 8.2.1 - Gantt diagram


10. Environmental impact
This project is subject to current regulations governing all types of work with electrical and
electronic equipment (WEEE). The two environmental directives that regulate it are from
2002 although they have recently been consolidated:
Page. 108 Memory

• WEEE (Waste Electrical and Electronic Equipment) 2012/19/EU, or in Spanish,


Directive on Waste Electrical and Electronic Equipment.
• RoHS (Restriction of the use of certain Hazardous Substances), 2011/65/EU, in
Spanish, Restriction of Certain Hazardous Substances in electricaland electronic
devices.

In Spain, the RoHS Directive together with the WEEE have been transposed into the same
Royal Decree, R.D. 208/2005. [22]

The WEEE directive aims to promote the recycling, reuse and recovery of electronic and
electrical equipment waste to reduce its pollution. It makes producers responsible for
assuming the costs of managing the waste generated, even if this means the payment of
a recycling fee by the consumer when purchasing the electrical or electronic product. If the
manufacturer is obliged to bear these costs at the end of the product's life cycle, this forces
him to rethink the design stagein order to adapt it to waste management requirements and
thus reduce these subsequent costs. In this initial stage will be where a complementary
directive intervenes, the RoHS and in the final stage, the WEEE. RoHS restricts the use
tosome extent of six hazardous materials in the manufacture of various types of electrical
and electronic equipment. The substances are: Lead, Mercury, Cadmium and Chromium
IV (heavy metals) and PBB and PBDE (flame retardant substances used in some plastics)

Both policies apply to computers defined as:

• Large appliances
• Small appliances
• Communications and IT equipment
• Consumer electrical appliances

• Lighting fixtures, including filament bulbs


• Power and electronic tools
• Toys, sports and leisure equipment
• Vending machines

*Batteries are not included within RoHS range.


Automatic collection system for supermarkets Page. 109

In view of these regulations, a selective collection of waste from the electrical and electronic
equipment of the designed system must be taken into account, for its correct recycling. In
this way, the regulations will be complied with, minimizing the disposal of waste electrical
and electronic equipment with unselected urban waste.
Page. 110 Memory

Conclusions
At the beginning of this project, many ideas emerged about possible solutions to perform
an automatic collection process forsupermarkets, but they all had some weakness. Finally,
the self-scanning of products with the weight checking system was chosen as the final
solution, since it was believed to be the most complete option with more possibilities of
development. The critical point of this solution is clearly the weighing system, but in the
end my colleague Carlos Darder has found a good solution, although with the testing of the
first prototype better conclusions would be obtained.

As in any commercial project or application, in this first version of the prototype that has
been made there are elements that could not be introduced and others that have been
replaced for economic reasons. Obviously, in four months it is not possible to carry out all
the theoretical design and implement several prototypes to improve the final solution. So
in real life this project would continue with the implementation of a prototype with all the
elements of the final system designed, in order to see possible problems and improve the
solution.

Many times it is said that in the university a lot of theoretical knowledge is acquired, but the
real problems that an engineer can find in his day to day are not faced, something that with
the realization of this project has been done. The projectsummarizes the general phases
of work that can be carried out by an engineer. This is known as a person who, based on
knowledge, seeks solutions to real problems and needs from a technical point of view. That
is why the search for information, the realization of various solution proposals, the analysis
of possible problems, the modification of the proposals and, finally, the implementation of
the solution in a practical way, is their daily bread. Some stages that, in part, are the phases
that have been followed for the realization of this project of design of an automatic collection
system.

As a final conclusion, it should be noted that this final degree project, in addition to allowing
the application of knowledge and skills acquired during the degree, has also served for the
student to acquire great knowledge about some disciplines of which there was no previous
knowledge. You have learned to create a mobile application for Android, to know and
program an Arduino, to make applications for Windows with the Visual Studio program, or
Automatic collection system for supermarkets Page. 111

to use Access databases in real time, with the learning of their respective programming
languages that this implies.

For all this, and for the satisfactory final result of the work, the experience and knowledge
acquired with the completion of this final degree project can be valued very positively.
Page. 112 Memory

Thanks
At this point I would like to thank all the people who have directlyor indirectly contributed to
this project.

First of all, I would like to thank the director of the work, Emilio Angulo Navarro, for his help
and advice throughout these four months in which the project has been carried out. Also
thank Maria Magdalena Pastor Artigues, for her help in the administrative issue and her
recommendation of the project director.

I would also like to thank my project partner, Carlos Darder Bennassar, for the many hours
we have spent together carrying out the project. In addition, thanks to its contribution to the
project, the designed system has been given greater reality, since it allows to see the
physical result and the assembly of everything designed in this memory.

I would like to thank the Department of Materials Resistancefor allowing access to their
laboratory to develop the prototype. More specifically to the laboratory technicians, Juan
Espada Sánchez and Francesc Joaquim García Rabella, since the implementation of the
prototype was made much easier thanks to the facilities they offered when it came to
lending all the tools and instruments necessary to work, even giving some advice and
teaching some practical aspects that unfortunately in the University are not usually learned.

Finally, I would not like to forget my university classmates, my family, my friends and my
partner, since thanks to them everything has been much easier. Not only during these four
months of development of the project, but throughout thisfour-year stage that this work
closes.
Bibliography

10.1. References

[1] At all hours [online]. Barcelona: A todas horas, 2005 - [Accessed: 7 February 2014].
Available in: < http://www.atodashoras.com >

[2] Openval [online] - [Accessed: 7 February 2014]. Available in: <


http://www.openval.es >

[3] Sony Hernandez, Tesco presents "Homeplus Subway Virtual Store" [online]. Blog
Clicker360, 2011–[Accessed: 7 February 2014]. Available in:
< http://www.clicker360.com/blog/2011/07/tesco-presenta-homeplus-subway-virtualstore/
>

[4] With the Introduction of RAPTOR, ECRS Looks to Change How Groceries are
Purchased [online]. Businesswire, January 2014 – [Accessed: 7 February 2014].
Available in:
<http://www.businesswire.com/news/home/20140110005796/en/IntroductionRAPTOR-
ECRS-Change-Groceries-Purchased#. U7LApvl_uSp >

[5] New Computers make grocery carts smarter [online]. USA Today, Chicaco, March 2005 –
[Accessed: February 7,2014]. Available in:
< http://usatoday30.usatoday.com/tech/news/2005-05-03-smart-carts_x.htm >

[6] Jose Andrade, Shopping with Fujitsu's Shopping Navis Wagon with RFID and LCD
[online]. Engadget, January 2006 – [Consultto: 9 February 2014]. Available in:
<http://es.engadget.com/2006/01/25/de-shopping-with-the-shopping-navis-wagon-de
fujitsu-with-rfid-and-lcd/ >

[7] Future Store: Starting Out on the Future of Retailing [en línea]. Metro Group, abril 2003
– [Accessed: 9 February 2014]. Available in:
< http://www.metrogroup.de/internet/site/metrogroup/node/164845/Len/index.html >

Page 122 Report


Automatic collection system for supermarkets Page. 115

[8] Woodman’s Markets shoppers get fast, easy mobile shopping with NCR Mobile Shopper
[en línea]. NCR, enerio 2013 – [Consulta: 9 febrero 2014]. Disponible en:
< http://www.ncr.com/newsroom/resources/woodmans-market-mobile >

[9] QThru gears up for US expansion as its self-checkout apps for grocery stores go live
[en línea]. The next web, diciembre 2012 – [Consulta: 9 febrero 2014].
Dispoinble en: < http://thenextweb.com/insider/2012/12/04/qthru-is-gearing-
up-to-expand-over-theus-as-its-ios -and-android-apps-go-live/ >

[10] Carrefour Scan & Go – An innovation of the customer experience [online]. Social
Media Experience, Junio 2010 – [Accessed: 12 February 2014]. Available in:
<http://socialmediaexperience.wordpress.com/2010/06/28/carrefour-scan-go-an
innovation-of-the-customer-experience/ >

[11] Scan & Go, Smart shopping at your fingertips [online]. Walmart – [Accessed: 12 February
2014]. Available in: < http://wm5.walmart.com/scanandgo/ >

[12] IBM Self Checkout Solutions [online]. IBM Retail store


Solutions – [Accessed: 15 February 2012]. Available in:
< ftp://public.dhe.ibm.com/la/documents/stg/retail/RTB12504-ESES-01.pdf >

[13] Espadds. Royal decree 1801/2008, of 3 November, by which establish relative norms to
the nominal quantities for packaged products and to the control of his effective content.
Official State Gazette, 4 November 2008, No. 266
[Accessed: February 30, 2014]. Available in:
< http://www.boe.es/boe/dias/2008/11/04/pdfs/A43706-43712.pdf >

[14] Beagleboard: BeagleBoneBlack [online]. The official BeagleBone Black Wiki. Available in:
< http://elinux.org/Beagleboard:BeagleBoneBlack >

[15] Smartphone OS market share [online]. Kantar Worldpanel, 2014 – [Accessed: 20 April
2014]. Available in:
<http://www.kantarworldpanel.com/smartphone-os-market-share/>

[16] Marco Doncel, Application Development [online]. Startcapps, 2014 - [Accessed:


20 April 2014]. Available in:
< http://www.startcapps.com/blog/desarrollo-of-applications/ >
[17] Creating Qt-Embedded Projects for Beaglebone [en línea]. VisualGDB, 2014 –
[Accessed: 20 April 2014]. Available in:
< http://visualgdb.com/tutorials/beaglebone/qt-embedded/ >

[18] ArduinoUNO Board [online]. Arduino Official Page. Available in:


< http://arduino.cc/en/Main/arduinoBoardUno >

[19] Load Cell Cabling [online]. Revere Transducers, 2002 – [Accessed: 25 March
2014]. Available in:
< http://revere-transducers.centralcarolinascale.com/Loadcell_Cabling.pdf >

[20] MIT Appinventor [online]. Appinventor Offical Page. Available in: <
http://appinventor.mit.edu/explore/ >

[21] Visual Studio [online]. Visual Studio Official Page. Available in: <
http://www.visualstudio.com/ >

[22] Spain. Royal Decree 208/2005, of 25 February, on electrical and electronic equipment and
the management of its waste. Official State Gazette, February 26, 2005, No. 49 [Accessed:
June 1, 2014]. Available in:
< http://www.boe.es/boe/dias/2005/02/26/pdfs/A07112-07121.pdf >

10.2. Further reading


• Information about load cells and the circuits of adequacy of your signal:

< http://www.ricelake.com/docs/prodinfo/Manuals/load-cells/lch_22054.pdf >

< http://www. societyofrobots.com/robottheory/load_cell_primer.pdf >

< http://www.ni.com/white-paper/7130/es/ >

< http://www.semtech.com/images/datasheet/sensing-applications-book.pdf >

< http://www.analog.com/static/imported-files/product_highlights/PrecisionADCs.pdf >

• Beaglebone Black Reference Manual:

< http://www.adafruit.com/datasheets/BBB_SRM.pdf >

Page 124 Report


Automatic collection system for supermarkets Page. 117

• Tutorials for learning how to program in Visual Basic:

< http://codigofacilito.com/cursos/VB-NET >

• Knowledge about reading with Arduino analog pins:

Arduino tutorial: < http://arduino.cc/en/Tutorial/ReadAnalogVoltage >


AtMega DS: <http://www.atmel.com/devices/ATMEGA2560.aspx?tab=documents >
Arduino reference: < http://arduino.cc/en/Reference/AnalogReference >

You might also like