Barcode and QR Code Scanner
Barcode and QR Code Scanner
Barcode and QR Code Scanner
Scanner
Barcode scanners (readers)
• A barcode is a series of dark and light parallel lines of varying
thickness.
• The numbers 0 to 9 are each represented by a unique series of lines.
The example we shall use adopts different codes
for digits appearing on the left and for digits
appearing on the right of the barcode:
Note: there are different patterns for digits on the left-hand side and for digits on the right-hand side.
The section of barcode to represent the number 5 4 3 0 5
2 would therefore be:
• Each digit is made up of 2 dark lines and two light lines.
• The width representing each digit is the same.
• The digits on the left have an odd number of dark elements and
always begin with a light bar; the digits on the right have an even
number of dark elements and always begin with a dark bar.
• This arrangement allows a barcode to be scanned in any direction.
what happens when a barcode is
scanned?
1. the barcode is first of all read by a red laser or red LED (light
emitting diode)
2. light is reflected back off the barcode; the dark areas reflect little or
no light, which allows the bars to be read
3. the reflected light is read by sensors (photoelectric cells)
4. as the laser or LED light is scanned across the barcode, a pattern is
generated, which is converted into digital data - this allows the
computer to understand the barcode
• for example: the digit '3' on the left generates the pattern: LDDDDLD
(where L = light and D = dark).
• this has the binary equivalent of: 0111101 (where L = 0 and D = 1).
So, the barcode has been read, then
what happens?
1. the barcode number is looked up in the stock database (the barcode is known
as the key field in the stock item record); this key field uniquely identifies each
stock item
2. when the barcode number is found, the stock item record is looked up
3. the price and other stock item details are sent back to the checkout (or point
of sale terminal (POS))
4. the number of stock items in the record is reduced by 1 each time the barcode
is read
5. this new value for number of stock is written back to the stock item record
6. the number of stock items is compared to the re-order level; if it is less than or
equal to this value, more stock items are automatically ordered
7. once an order for more stock items is generated, a flag is added to the record
to stop re-ordering every time the stock item barcode is read
8. when new stock items arrive, the stock levels are updated in the database.
Advantages to the management of
using barcodes:
• much easier and faster to change prices on stock items
• much better, more up-to-date sales information/sales trends
• no need to price every stock item on the shelves (this reduces time
and cost to the management)
• allows for automatic stock control
• possible to check customer buying habits more easily by linking
barcodes to, for example, customer loyalty cards.
Advantages to the customers of
using barcodes
• faster checkout queues (staff don't need to remember/look up prices
of items)
• errors in charging customers is reduced
• the customer is given an itemised bill
• cost savings can be passed on to the customer
• better track of 'sell by dates' so food should be fresher.
Uses of Barcode in Library
• barcodes can be utilised in libraries where they are used in books and
on the borrower's library card. Every time a book is taken out, the
borrower is linked to the book automatically. This allows automatic
checking of when the book is due to be returned.
Typical applications for
barcodes
• Tracking/identifying items in warehouses and factories
• Retail checkouts, e.g. to find product prices and
descriptions; automatic stock control management from
a database
• Airports, e.g. tracking luggage
• Library systems, e.g. tracking books and borrowers
Benefits of barcodes
• Quick and easy to identify products
• Additional information can be easily retrieved from a
database
• Allows the use of automated stock control and sales
reports
• Related information (e.g. product price) is changed in
the database, meaning the barcode always remains the
same
Drawbacks of barcodes
• Difficult to use if damaged
• Requires expertise to setup a database
QR(Quick
Response)
Code
Scanner
Quick response (QR) codes
• Another type of barcode is the quick response (QR) code.
• This is made up of a matrix of filled-in dark squares on a light
background.
• A QR code is a computer generate pattern capable of
holding a modest amount of data.
• QR codes often store simple data such as a URL address, contact
information, calendar entries and product details (in factories and
warehouses etc).
• QR codes can hold considerably more information than the more
conventional barcodes described earlier.
Description of QR codes
• A QR code consists of a block of small squares (light and dark) known as
pixels.
• It can presently hold up to 4296 characters (or up to 7089 digits) and
also allows internet addresses to be encoded within the QR code. This
compares to the 30 digits that is the maximum for a barcode.
• However, as more and more data is added, the structure of the QR code
becomes more complex.
• The three large squares at the corners of the code function as a form of
alignment; the remaining small corner square is used to ensure the
correct size and correct angle of the camera shot when the QR code is
read.
Because of modern smartphones and tablets, which allow
internet access on the move, QR codes can be scanned
anywhere. This gives rise to a number of uses:
• advertising products
• giving automatic access to a website or contact telephone number
• storing boarding passes electronically at airports and train stations
By using the built-in camera on a mobile
smartphone or tablet and by downloading a QR
app (application), it is possible to read QR codes
on the move using the following method:
• point the phone or tablet camera at the QR code
• the app will now process the image taken by the camera, converting
the squares into readable data
• the browser software on the mobile phone or tablet automatically
reads the data generated by the app; it will also decode any web
addresses contained within the QR code
• the user will then be sent to a website automatically (or if a telephone
number was embedded in the code, the user will be sent to the
phone app
Advantages of QR codes compared to
traditional barcodes
• They can hold much more information
• There will be fewer errors; the higher capacity of the QR code allows the
use of built-in error-checking systems - normal barcodes contain almost no
data redundancy (data which is duplicated) therefore it isn't possible to
guard against badly printed or damaged barcodes
• QR codes are easier to read; they don't need expensive laser or LED (light
emitting diode) scanners like barcodes - they can be read by the cameras on
smartphones or tablets
• It is easy to transmit QR codes either as text messages or images
• It is also possible to encrypt QR codes which gives them greater protection
than traditional barcodes.
Disadvantages of QR codes compared to
traditional barcodes
1. More than one QR format is available.
2. QR codes can be used to transmit malicious codes - known as attagging.
• Since there are a large number of free apps available to a user for
generating QR codes, that means anyone can do this.
• It is relatively easy to write malicious code and embed this within the
QR code. When the code is scanned, it is possible the creator of the
malicious code could gain access to everything on the user's phone
(for example, photographs, address book, stored passwords, and so
on).
• The user could also be sent to a fake website or it is even possible for
a virus to be downloaded.
New developments
Frame QR code
• Newer QR codes (called frame QR codes) are now being used because of the
increased ability to add advertising logos.
• Frame QR codes come with a 'canvas area' where it is possible to include graphics or
images inside the code itself.
• Unlike normal QR codes, software to do this isn't usually free.
Typical applications for QR
codes
• Packaging
• Promotional materials
• Warehouses
Benefits of QR codes
• Data is stored within the pattern, so no need for a
connected database
• Simple and quick way to store and retrieve information
• Can store a variety of information
Drawbacks of QR codes
• Changing the data alters the pattern, so not suitable for
information that changes regularly, e.g. prices.
• People need a device (and software) that can read the
QR code